Skip to content

Gitea 1.15 does not work on postgres <9.5: Submitting a new issue gives 500 error #17067

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

Closed
artu72 opened this issue Sep 16, 2021 · 8 comments
Closed
Labels
issue/not-a-bug The reported issue is the intended behavior or the problem is not inside Gitea

Comments

@artu72
Copy link

artu72 commented Sep 16, 2021

Gitea Version

1.15.2

Git Version

2.16.5

Operating System

Linux RHEL 7.6

How are you running Gitea?

Downloaded the 64bit version binary Linux executable, and running it as a service.

Database

PostgreSQL

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

2021/09/16 10:00:32 models/issue.go:1012:NewIssue() [I] [SQL] ROLLBACK [] - 40.9
49µs
2021/09/16 10:00:32 ...rs/web/repo/issue.go:980:NewIssuePost() [E] NewIssue: gen
erate issue index failed: pq: syntax error at or near "ON"

Description

Updated from gitea 1.14.6 to 1.15.2. Now, creating a new issue in every repository gives a 500 error.

Screenshots

No response

@zeripath
Copy link
Contributor

what version of Postgres are you running?

@zeripath
Copy link
Contributor

zeripath commented Sep 17, 2021

The SQL this is failing on is:

INSERT INTO issue_index (group_id, max_index) "+
			"VALUES (?,1) ON CONFLICT (group_id) DO UPDATE SET max_index = issue_index.max_index+1

which implies you have a version of Postgres that does not support ON CONFLICT

This has been present in Postgres since version 9.5 which itself is so old that it is unsupported by Postgres.

You need to upgrade your version of Postgres.

@zeripath zeripath reopened this Sep 17, 2021
@artu72
Copy link
Author

artu72 commented Sep 17, 2021

what version of Postgres are you running?

9.2. So i will try to update postgres. I'll report you, thanks.

@zeripath
Copy link
Contributor

I don't think we state anywhere what the minimal supported version of postgres is but I think it's entirely reasonable to set that at at least 9.5.

I guess we need to detect the version of postgres at time of startup and warn users and update the documentation.

@zeripath zeripath changed the title Submitting a new issue gives 500 error Gitea 1.15 does not work on postgres <9.5: Submitting a new issue gives 500 error Sep 17, 2021
@zeripath zeripath added the issue/not-a-bug The reported issue is the intended behavior or the problem is not inside Gitea label Sep 17, 2021
@zeripath
Copy link
Contributor

I've retitled the bug - so a PR doing the above could reference this issue and close it.

@artu72
Copy link
Author

artu72 commented Sep 17, 2021

I've retitled the bug - so a PR doing the above could reference this issue and close it.

Ok, thank you for the effort. Ii is fine to specify minimum requirements of the database from now on. However, my only issue is the creation of a issue, git interation is still ok.

@zeripath
Copy link
Contributor

Yeah unfortunately we absolutely have to have postgres >= 9.5.

I've added a docs PR so I will close this now.

@artu72
Copy link
Author

artu72 commented Sep 21, 2021

I confirm that upgrading postgres to 9.6 solved the problem.

@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/not-a-bug The reported issue is the intended behavior or the problem is not inside Gitea
Projects
None yet
Development

No branches or pull requests

2 participants