HTTP Error 500 when publishing openid url #2416

Closed
opened 2025-11-02 04:35:17 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @simmstein on GitHub (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

Originally created by @simmstein on GitHub (Oct 18, 2018). - Gitea version (or commit ref): 1.5.0 - Git version: 2.1.14 - Operating system: Debian GNU/Linux Jessie - Database: - [ ] PostgreSQL - [x] 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 ![](https://upload.deblan.org/u/2018-10/5bc89a07.png)
GiteaMirror added the type/bug label 2025-11-02 04:35:17 -06:00
Author
Owner

@filipnavara commented on GitHub (Oct 18, 2018):

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

@filipnavara commented on GitHub (Oct 18, 2018): Hmm, seems to be issue with "show" being a keyword in MySQL and not being quoted in the SQL syntax.
Author
Owner

@filipnavara commented on GitHub (Oct 18, 2018):

I guess changing this line:

801843b011/models/user_openid.go (L96)

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

@filipnavara commented on GitHub (Oct 18, 2018): I guess changing this line: https://github.com/go-gitea/gitea/blob/801843b0115e29ba2304fa6a5bea1ae169a58e02/models/user_openid.go#L96 to something like `x.Exec("update user_open_id set \"show\" = not \"show\" where id = ?", id)` should help.
Author
Owner

@strk commented on GitHub (Oct 18, 2018):

Filip can you try sending a PR with this change ?
I'll be happy to review, I love OpenID-2.0 users ! :)

@strk commented on GitHub (Oct 18, 2018): Filip can you try sending a PR with this change ? I'll be happy to review, I love OpenID-2.0 users ! :)
Author
Owner

@filipnavara commented on GitHub (Oct 18, 2018):

@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.

@filipnavara commented on GitHub (Oct 18, 2018): @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.
Author
Owner

@strk commented on GitHub (Oct 18, 2018):

On Thu, Oct 18, 2018 at 06:32:43PM +0000, Filip Navara wrote:

@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.

There are integrations tests running as part of the testsuite,
maybe you could try to add tests for OpenID usage ?
(challenging task, mind you!)

@strk commented on GitHub (Oct 18, 2018): On Thu, Oct 18, 2018 at 06:32:43PM +0000, Filip Navara wrote: > @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. There are integrations tests running as part of the testsuite, maybe you could try to add tests for OpenID usage ? (challenging task, mind you!)
Author
Owner

@strk commented on GitHub (Oct 18, 2018):

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

@strk commented on GitHub (Oct 18, 2018): also I guess @simmstein would be up to test your PR ?
Author
Owner

@simmstein commented on GitHub (Oct 19, 2018):

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

@simmstein commented on GitHub (Oct 19, 2018): Of course! I just need a binary beause it's the way I choose to use gitea.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2416