Reputation
Top tag
Next privilege 100 Rep.
Edit community wikis
Badges
2 12
Impact
~15k people reached

  • 0 posts edited
  • 0 helpful flags
  • 3 votes cast
Apr
29
awarded  Notable Question
Nov
18
awarded  Popular Question
Aug
29
awarded  Notable Question
Jun
30
awarded  Popular Question
Mar
13
awarded  Popular Question
Nov
22
awarded  Popular Question
Oct
28
awarded  Teacher
Apr
9
awarded  Popular Question
Aug
23
comment How to get rid of “Could not connect to database” with Linux and libnss-pgsql2?
Mark: I then get "Could not connect to database", however, 'psql' does connect. The error is entirely spurious.
Aug
22
comment How to get rid of “Could not connect to database” with Linux and libnss-pgsql2?
Mark, making nss-pgsql-root.conf world readable gets rid of the error message, however, this is not a solution to the problem, as it leaves the system insecure and the official documentation explicitly states that this file must be readable by root only.
Aug
22
revised How to get rid of “Could not connect to database” with Linux and libnss-pgsql2?
Found out this behaviour is a reported bug
Aug
22
comment How to get rid of “Could not connect to database” with Linux and libnss-pgsql2?
Please note that the EACCESS error above if a file system access error and not a database connection error. This is what leads me to think that this is either a bug in libnss-pgsql2 or something happens between this open() attempt and the "Could not connect to database" error.
Aug
22
comment How to get rid of “Could not connect to database” with Linux and libnss-pgsql2?
My pg_hba.conf is available here: p.adora.dk/P2493.html How would you suggest that I relax them? Please note that I get the error even when running the 'psql' command with the postgres user (which has full access to postgres without password via ident). I am worried that the error is actually spurious and that it is not actually the database connection that fails -- I am not sure it even tries to actually connect to the database. What do you get from the trace above?
Aug
22
awarded  Editor
Aug
22
revised How to get rid of “Could not connect to database” with Linux and libnss-pgsql2?
Added strace
Aug
22
comment How to get rid of “Could not connect to database” with Linux and libnss-pgsql2?
DerfK: No errors in PG log. Jenny: No difference if I put in 127.0.0.1 or localhost. I get the error either way. Mark: Thanks.
Aug
22
comment How to get rid of “Could not connect to database” with Linux and libnss-pgsql2?
Thanks for your reply. PostgreSQL logs does not show anything when I receive this error. I have enabled all kinds of logging: paste.adora.dk/P2491.html . Max_connections is set to 100. Of course the PG logs show lots of activity when I do 'id USER', etc. There is almost never more than 1 connection. This DB-server is not used by any internet-facing web-sites that can receive spikes in visitors. Also, the error is 100 % reproducible. It happens never when I do 'id USER', however, it happens everytime I start a screen or the psql client for instance.
Aug
21
comment How to get rid of “Could not connect to database” with Linux and libnss-pgsql2?
I would like to add I also get the error message when I do other commands that are not database related. I am aware that the particular cronjob that I pasted uses postgresql, however, this is a coincidence. I also see the error if I log in as my normal user and then start or resume a screen (gnu.org/software/screen)
Aug
21
asked How to get rid of “Could not connect to database” with Linux and libnss-pgsql2?
Jul
12
accepted Windows equivalent performance counters in Linux with Sysstat (or similar)