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

HTTP Error 500 when publishing openid url #5106

Closed
1 of 7 tasks
simmstein opened this issue Oct 18, 2018 · 7 comments · Fixed by #5117
Closed
1 of 7 tasks

HTTP Error 500 when publishing openid url #5106

simmstein opened this issue Oct 18, 2018 · 7 comments · Fixed by #5117
Labels
Milestone

Comments

@simmstein
Copy link

simmstein commented Oct 18, 2018

  • Gitea version (or commit ref): 1.5.0
  • Git version: 2.1.14
  • Operating system: Debian GNU/Linux Jessie
  • Database:
    • PostgreSQL
    • MySQL (5.5.60-0+deb8u1)
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:
2018/10/18 16:26:18 [I] [SQL] update user_open_id set show = not show where id = ? []interface {}{3}
2018/10/18 16:26:18 [...g/security_openid.go:120 ToggleOpenIDVisibility()] [E] ToggleUserOpenIDVisibility: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show = not show where id = ?' at line 1

Description

After I added my OpenID access using my configuration panel (Profil / Configuration / Security), I wanted to publish on my public profile the OpenID URL. After clicking on the button, I see a HTTP Error 500.

Screenshots

@filipnavara
Copy link
Contributor

Hmm, seems to be issue with "show" being a keyword in MySQL and not being quoted in the SQL syntax.

@filipnavara
Copy link
Contributor

I guess changing this line:

_, err = x.Exec("update user_open_id set show = not show where id = ?", id)

to something like x.Exec("update user_open_id set \"show\" = not \"show\" where id = ?", id) should help.

@strk
Copy link
Member

strk commented Oct 18, 2018 via email

@filipnavara
Copy link
Contributor

@strk I will be happy to submit a PR, but I cannot test it properly since I don't have MySQL setup at the moment.

@strk
Copy link
Member

strk commented Oct 18, 2018 via email

@strk
Copy link
Member

strk commented Oct 18, 2018

also I guess @simmstein would be up to test your PR ?

@simmstein
Copy link
Author

Of course! I just need a binary beause it's the way I choose to use gitea.

@lafriks lafriks added this to the 1.6.0 milestone Oct 19, 2018
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants