Open taimoorzaeem opened 10 months ago
@steve-chavez Strangely, after #2897 postgrest-test-io
is not failing anymore. All io-tests are passing now.
@taimoorzaeem Hm, so judging by the error you reported it doesn't seem related to https://github.com/PostgREST/postgrest/issues/2896. I was thinking #2897 might have made the db config query faster but some quick testing indicates that in fact it got slower (with the join I added). So strange indeed.
@steve-chavez Ahh, finally got it. The errors are gone because I stopped my locally installed postgresql server running on port 5432. After running systemctl stop postgresql
, the errors got fixed. However if I start the server again my systemctl start postgresql
, all of the 6 errors come up again.
Good to know!
Now postgrest-test-io
should always run against our sandboxed pg. Hm, there must be something wrong with its connection string.
This is not a problem with our tests... it's actually a bug in PostgREST. The relevant IO tests mentioned above try to connect by default - but that's not a problem. As long as postgrest doesn't die, but retries, those errors will be logged on the console, but won't be a problem.
But in this specific case, the pg_hba.conf file is set to allow md5
authentication only - and no password is supplied. This then causes the fe_sendauth: no password supplied
error, which we are not able to handle gracefully. In this case PostgREST just dies. The log output is like this on the latest main branch:
% postgrest-run
09/May/2024:16:00:12 +0200: Starting PostgREST 12.1 (a427fb6)...
09/May/2024:16:00:12 +0200: Attempting to connect to the database...
09/May/2024:16:00:12 +0200: {"code":"PGRST000","details":"connection to server on socket \"/run/postgresql/.s.PGSQL.5432\" failed: fe_sendauth: no password supplied\n","hint":null,"message":"Database connection error. Retrying the connection."}
09/May/2024:16:00:12 +0200: {"code":"PGRST000","details":"connection to server on socket \"/run/postgresql/.s.PGSQL.5432\" failed: fe_sendauth: no password supplied\n","hint":null,"message":"Database connection error. Retrying the connection."}
09/May/2024:16:00:12 +0200: Fatal error encountered. connection to server on socket "/run/postgresql/.s.PGSQL.5432" failed: fe_sendauth: no password supplied
postgrest: thread killed
Note, this is not even the io tests, but just a plain postgrest-run
. I have postgres running on the default port, but needed to change the pg_hba.conf
file to allow md5
instead of trust
authentication from localhost.
Environment
Description of issue
postgrest-test-io
fails locally with the following error:All the 6 errors messages are same as: