Newsroom Update

Beginning in May, a special Today at Apple series titled “Made for Business” will offer small business owners and entrepreneurs free opportunities to learn how Apple products and services can support their growth and success. Learn more >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Postgres not responding

After a RAM failure my lion server machine went into a recurring kernel panic which forced me to restore the machine from the time machine backup after I'd changed the RAM.


But after the restore, webmail and my wiki is not working.

When trying to view the settings of the wiki in Server.app I get the message "Error Reading Settings"

And if I try to open webmail in a browser I get this message:

DATABASE ERROR: CONNECTION FAILED!

Unable to connect to the database!
Please contact your server-administrator.


When I do "$ sudo serveradmin fullstatus postgres" I get this:

postgres:dataDirHasBeenInitialized = yes

postgres:PG_VERSION = "9.0.5"

postgres:dataDir = "/var/pgsql"

postgres:postgresIsResponding = no

postgres:dataDirIsDirectory = yes

postgres:PGserverVersion = 0

postgres:dataDirExists = yes

postgres:setStateVersion = 1

postgres:state = "RUNNING"


I've tried doing sudo serveradmin stop postgres, which gives me this:

postgres:state = "STOPPED"

But then when I do sudo serveradmin start postgres I get this:

postgres:error = "CANNOT_START_SERVICE_TIMEOUT_ERR"


I've tried running the scripts in /system/library/ServerSetup/CommonExtras/PosgresSQLExtras/ under sudo, but then I get this:

psql: could not connect to server: No such file or directory

Is the server running locally and accepting

connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?


I gave my self read/write perms to the pgsql folders in /var/ but to no avail.


If I do "ls -l /Library/Logs/PostgreSQL.log" under bash, I get this:

-rw-r--r-- 1 _postgres _postgres 0 Feb 12 16:57 /Library/Logs/PostgreSQL.log

So I guess it's able to write to the log.


So I'm feeling a bit lost, annyone that could help me see what I'm missing?

Mac mini

Posted on Feb 12, 2012 4:52 PM

Reply
Question marked as Best reply

Posted on Feb 12, 2012 5:23 PM

I'd see that nothing is using that old (now seemingly stale) socket file, via:


sudo lsof | grep


And if not, still ensure that postgres is stopped,
sudo launchctl unload /System/Library/LaunchDaemons/org.postgresql.postgres.plist


Clear out any files in /var/pgsql_socket
eg:

cd /var/pgsql_socket
sudo rm .s.PGSQL*


then reload postgres via

sudo launchctl load /System/Library/LaunchDaemons/org.postgresql.postgres.plist


THEN try.

4 replies
Question marked as Best reply

Feb 12, 2012 5:23 PM in response to Eirikur

I'd see that nothing is using that old (now seemingly stale) socket file, via:


sudo lsof | grep


And if not, still ensure that postgres is stopped,
sudo launchctl unload /System/Library/LaunchDaemons/org.postgresql.postgres.plist


Clear out any files in /var/pgsql_socket
eg:

cd /var/pgsql_socket
sudo rm .s.PGSQL*


then reload postgres via

sudo launchctl load /System/Library/LaunchDaemons/org.postgresql.postgres.plist


THEN try.

Postgres not responding

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.