-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Gitea can't authenticate against Postgres 13 #17285
Comments
How are you connecting to postgres both as the postgres client and for Gitea? Do not assume that just because Gitea can connect over the unix socket - just set |
My Postgres DB runs on an other server. For now i am not using an encrypted connection, so that i can see problems in tcpdump/wireshark.
|
Are there any special characters in your password? |
no, it has only caracters from A-Z, a-z and 0-9. |
and it fails even when i change the password to AAAAAAAA. |
I literally have no idea what could be causing this except for some authentication/configuration issue on behalf of postgres which is not allowing the gitea process to connect. We convert the information to a connection url using: gitea/modules/setting/database.go Lines 166 to 168 in ff9a8a2
e.g. in your case this should be:
Perhaps some additional parameters are needed? If you change the name from I guess double-checking if the above configuration url works on psql would be helpful. Ensure that you're running psql from the same place that gitea is running too in case it's some firewall/IP issue. |
i ran |
Does postgres give us any more information as to why it is rejecting gitea's connection? |
Actually it does: |
I am willing to bet is not supported by the Switch that to md5 |
I set it up like the docs said: https://docs.gitea.io/en-us/database-prep/#postgresql |
i tested it and nothing has changed |
OK I've just I think this has to be a configuration issue. Try setting your host to all and work back from there. |
@zeripath Thanks for the test using the official package. |
I made an small example program that uses the golang pq, pgx and xorm lib to connect to my database. |
Same problem with Gitea I am in the process of migrating from a generic local installation to a Kubernetes installation of Gitea and I want to keep my old database. I experience the same problems, as described here. I can connect perfectly fine on the CLI with I excluded common errors and human mistakes by repeating the restoration process in different ways and I was really careful to make it as working as possible. Still, to no avail. I might try a different Gitea version, to see if it continues to happen then. My legacy Gitea installation is based on a development release of |
I solved my issue by making the Postgres part of the migration process an extremely hughmongous pain in the ass, i.e. doing everything step by step, by hand only. This was an extreme pain. However, I got it to work that way, since I basically used the newly generated database to import the old data, then re-deploy this modified database onto the new Gitea instance, etc......... This was such a pain. It would've helped, if it just worked out of the box. |
Looks like lib/pq#833 has been merged and this is not a problem anymore? |
Gitea now is using lib/pq v1.10.7 |
Gitea Version
1.17.2
Git Version
2.30.2
Operating System
Debian GNU/Linux Bullseye (11)
How are you running Gitea?
currently with sudo manually.
but it is indipendent from the running method.
Database
PostgreSQL
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
https://gist.github.com/stop5/ccfbc4eed19bfa4dfc3754c234a55cac
Description
I have set up gitea and the database as the description.
But the Authentication fails every time.
The authentication with the postgres client runs without problems. The authentication that i recorded using tcpdump also looks ok.
Screenshots
No response
The text was updated successfully, but these errors were encountered: