Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UpdatePublicKey: near "WHERE": syntax error #1479

Closed
2 of 7 tasks
ncwgf opened this issue Apr 10, 2017 · 2 comments
Closed
2 of 7 tasks

UpdatePublicKey: near "WHERE": syntax error #1479

ncwgf opened this issue Apr 10, 2017 · 2 comments
Labels
Milestone

Comments

@ncwgf
Copy link

ncwgf commented Apr 10, 2017

  • Gitea version (or commit ref): Gitea Version: 1.1.0+115-g54f0293f (Docker image)
  • Git version: git version 1.8.3.1
  • Operating system: CentOS Linux release 7.3.1611 (Core)
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

When using git the pull/push the repo via ssh://git@<host>/<repo>, below error message will display
It do not affect the usage of git (data will update), just show the error from Gitea
When I need to git pull, I need to pull twice because worktree will only update at the second pull

git message

$git pull
remote: Counting objects: 4, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 4 (delta 3), reused 0 (delta 0)
Unpacking objects: 100% (4/4), done.
Gitea: Internal error
UpdatePublicKey: near "WHERE": syntax error
$ git pull
From ssh://<host>/<repo>
   da19297..b471986  master     -> origin/master
Gitea: Internal error
UpdatePublicKey: near "WHERE": syntax error
Updating da19297..b471986
Fast-forward
 libs/<file>.js | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

xorm.log

# pull with deploy key
2017/04/10 01:47:13 [I] [SQL] SELECT `id`, `owner_id`, `name`, `fingerprint`, `content`, `mode`, `type`, `created_unix`, `updated_unix` FROM `public_key` WHERE content like ? LIMIT 1 [<xxx>]
2017/04/10 01:47:13 [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `description`, `num_teams`, `num_members`, `diff_view_style` FROM `user` WHERE `lower_name`=? LIMIT 1 [<name>]
2017/04/10 01:47:13 [I] [SQL] SELECT `id`, `owner_id`, `lower_name`, `name`, `description`, `website`, `default_branch`, `num_watches`, `num_stars`, `num_forks`, `num_issues`, `num_closed_issues`, `num_pulls`, `num_closed_pulls`, `num_milestones`, `num_closed_milestones`, `is_private`, `is_bare`, `is_mirror`, `is_fork`, `fork_id`, `created_unix`, `updated_unix` FROM `repository` WHERE `owner_id`=? AND `lower_name`=? LIMIT 1 [3 <repo_name>]
2017/04/10 01:47:13 [I] [SQL] SELECT `id`, `owner_id`, `name`, `fingerprint`, `content`, `mode`, `type`, `created_unix`, `updated_unix` FROM `public_key` WHERE `id`=? LIMIT 1 [3]
2017/04/10 01:47:13 [I] [SQL] SELECT `id`, `key_id`, `repo_id`, `name`, `fingerprint`, `created_unix`, `updated_unix` FROM `deploy_key` WHERE key_id = ? AND repo_id = ? LIMIT 1 [3 1]
2017/04/10 01:47:13 [I] [SQL] SELECT `id`, `key_id`, `repo_id`, `name`, `fingerprint`, `created_unix`, `updated_unix` FROM `deploy_key` WHERE `key_id`=? AND `repo_id`=? LIMIT 1 [3 1]
2017/04/10 01:47:13 [I] [SQL] UPDATE `deploy_key` SET `key_id` = ?, `repo_id` = ?, `name` = ?, `fingerprint` = ?, `created_unix` = ?, `updated_unix` = ? WHERE `id`=? [3 1 <name> <fingerprint> 1491210652 1491788833 4]
2017/04/10 01:47:13 [I] [SQL] UPDATE `public_key` SET  WHERE `id`=? [3]

#fetch with public_key (SSH keys)
2017/04/10 01:52:36 [I] [SQL] SELECT `id`, `owner_id`, `name`, `fingerprint`, `content`, `mode`, `type`, `created_unix`, `updated_unix` FROM `public_key` WHERE content like ? LIMIT 1 [<xxx>]
2017/04/10 01:52:36 [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `description`, `num_teams`, `num_members`, `diff_view_style` FROM `user` WHERE `lower_name`=? LIMIT 1 [<name>]
2017/04/10 01:52:36 [I] [SQL] SELECT `id`, `owner_id`, `lower_name`, `name`, `description`, `website`, `default_branch`, `num_watches`, `num_stars`, `num_forks`, `num_issues`, `num_closed_issues`, `num_pulls`, `num_closed_pulls`, `num_milestones`, `num_closed_milestones`, `is_private`, `is_bare`, `is_mirror`, `is_fork`, `fork_id`, `created_unix`, `updated_unix` FROM `repository` WHERE `owner_id`=? AND `lower_name`=? LIMIT 1 [3 <repo>]
2017/04/10 01:52:36 [I] [SQL] SELECT `id`, `owner_id`, `name`, `fingerprint`, `content`, `mode`, `type`, `created_unix`, `updated_unix` FROM `public_key` WHERE `id`=? LIMIT 1 [1]
2017/04/10 01:52:36 [I] [SQL] SELECT * FROM `user` INNER JOIN `public_key` ON `public_key`.owner_id = `user`.id WHERE `public_key`.id=? LIMIT 1 [1]
2017/04/10 01:52:36 [I] [SQL] SELECT `id`, `user_id`, `repo_id`, `mode` FROM `access` WHERE `user_id`=? AND `repo_id`=? LIMIT 1 [1 3]
2017/04/10 01:52:36 [I] [SQL] UPDATE `public_key` SET  WHERE `id`=? [1]

#pull with public_key
2017/04/10 02:12:57 [I] [SQL] SELECT `id`, `owner_id`, `name`, `fingerprint`, `content`, `mode`, `type`, `created_unix`, `updated_unix` FROM `public_key` WHERE content like ? LIMIT 1 [<xxx>]
2017/04/10 02:12:57 [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `passwd`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `description`, `num_teams`, `num_members`, `diff_view_style` FROM `user` WHERE `lower_name`=? LIMIT 1 [<name>]
2017/04/10 02:12:57 [I] [SQL] SELECT `id`, `owner_id`, `lower_name`, `name`, `description`, `website`, `default_branch`, `num_watches`, `num_stars`, `num_forks`, `num_issues`, `num_closed_issues`, `num_pulls`, `num_closed_pulls`, `num_milestones`, `num_closed_milestones`, `is_private`, `is_bare`, `is_mirror`, `is_fork`, `fork_id`, `created_unix`, `updated_unix` FROM `repository` WHERE `owner_id`=? AND `lower_name`=? LIMIT 1 [3 <repo>]
2017/04/10 02:12:57 [I] [SQL] SELECT `id`, `owner_id`, `name`, `fingerprint`, `content`, `mode`, `type`, `created_unix`, `updated_unix` FROM `public_key` WHERE `id`=? LIMIT 1 [1]
2017/04/10 02:12:57 [I] [SQL] SELECT * FROM `user` INNER JOIN `public_key` ON `public_key`.owner_id = `user`.id WHERE `public_key`.id=? LIMIT 1 [1]
2017/04/10 02:12:57 [I] [SQL] SELECT `id`, `user_id`, `repo_id`, `mode` FROM `access` WHERE `user_id`=? AND `repo_id`=? LIMIT 1 [1 11]
2017/04/10 02:12:58 [I] [SQL] UPDATE `public_key` SET  WHERE `id`=? [1]

may be the relative commit 5c0bee9

@lunny lunny added the type/bug label Apr 10, 2017
@lunny lunny added this to the 1.2.0 milestone Apr 10, 2017
@lunny
Copy link
Member

lunny commented Apr 10, 2017

This will be resolved by #1471

@lunny
Copy link
Member

lunny commented Apr 19, 2017

resolved by #1471

@lunny lunny closed this as completed Apr 19, 2017
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants