creating issue cause an error 500 #7749

Closed
opened 2025-11-02 07:35:22 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @homburgs on GitHub (Aug 24, 2021).

  • Gitea version (or commit ref): 1.15.0
  • Git version:
  • Operating system: Ubuntu 10.18-0ubuntu0.18.04.1
  • Database (use [x]):
    • PostgreSQL 9.3.24
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes
    • No
  • Log gist:
    2021/08/24 23:51:38 ...rs/web/repo/issue.go:983:NewIssuePost() [E] NewIssue: generate issue index failed: pq: syntax error at or near "ON"
    2021/08/24 23:51:38 ...s/context/context.go:185:HTML() [D] Template: status/500

Description

After submitting the new issue form the error 500 occurred

Originally created by @homburgs on GitHub (Aug 24, 2021). - Gitea version (or commit ref): 1.15.0 - Git version: - Operating system: Ubuntu 10.18-0ubuntu0.18.04.1 - Database (use `[x]`): - [x] PostgreSQL 9.3.24 - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes - [x] No - Log gist: 2021/08/24 23:51:38 ...rs/web/repo/issue.go:983:NewIssuePost() [E] NewIssue: generate issue index failed: pq: syntax error at or near "ON" 2021/08/24 23:51:38 ...s/context/context.go:185:HTML() [D] Template: status/500 ## Description After submitting the new issue form the error 500 occurred
Author
Owner

@noerw commented on GitHub (Aug 25, 2021):

Looks like postgres doesn't like this statement (introduced in https://github.com/go-gitea/gitea/pull/15599)
06f82641cb/models/index.go (L29-L32)

edit: your postgres version is old, you may want to consider upgrading (not sure what the minimum supported version by gitea is, I suspect 10)

@noerw commented on GitHub (Aug 25, 2021): Looks like postgres doesn't like this statement (introduced in https://github.com/go-gitea/gitea/pull/15599) https://github.com/go-gitea/gitea/blob/06f82641cb65c88d89bfaeca01f9fc3b32bb76b8/models/index.go#L29-L32 edit: your postgres version is *old*, you may want to consider upgrading (not sure what the minimum supported version by gitea is, I suspect 10)
Author
Owner

@zeripath commented on GitHub (Aug 25, 2021):

ON CONFLICT was added to Postgres in version 9.5.

I'm not sure we can really support postgres that does not have this

@zeripath commented on GitHub (Aug 25, 2021): ON CONFLICT was added to Postgres in version 9.5. I'm not sure we can really support postgres that does not have this
Author
Owner

@lunny commented on GitHub (Aug 25, 2021):

Since postgres has coming into v12, I think v9.5 is the minimal requirement. I myself had tested this PR before it merged in my postgres 9.5 instance.

@lunny commented on GitHub (Aug 25, 2021): Since postgres has coming into v12, I think v9.5 is the minimal requirement. I myself had tested this PR before it merged in my postgres 9.5 instance.
Author
Owner

@BastienVigneron commented on GitHub (Sep 3, 2021):

Hello,

After migrating on gitea 1.15.1 with postgres 12 :

2021-09-03 12:16:59.748 UTC [36] ERROR:  there is no unique or exclusion constraint matching the ON CONFLICT specification
2021-09-03 12:16:59.748 UTC [36] STATEMENT:  INSERT INTO issue_index (group_id, max_index) VALUES ($1,1) ON CONFLICT (group_id) DO UPDATE SET max_index = issue_index.max_index+1
@BastienVigneron commented on GitHub (Sep 3, 2021): Hello, After migrating on gitea 1.15.1 with postgres 12 : ``` 2021-09-03 12:16:59.748 UTC [36] ERROR: there is no unique or exclusion constraint matching the ON CONFLICT specification 2021-09-03 12:16:59.748 UTC [36] STATEMENT: INSERT INTO issue_index (group_id, max_index) VALUES ($1,1) ON CONFLICT (group_id) DO UPDATE SET max_index = issue_index.max_index+1 ```
Author
Owner

@zeripath commented on GitHub (Sep 3, 2021):

See: https://github.com/go-gitea/gitea/issues/16936

gitea doctor recreate-table issue_index

@zeripath commented on GitHub (Sep 3, 2021): See: https://github.com/go-gitea/gitea/issues/16936 `gitea doctor recreate-table issue_index`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7749