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

Server 3.2.1 (10.9.5) – Postgres won't start

After upgrading from Server 3.1.2 (Mavericks 10.9.3) to Server 3.2.1 (Mavericks 10.9.5), I cannot start Postgres:


# serveradmin start postgres

postgres:error = "CANNOT_START_SERVICE_TIMEOUT_ERR"


Here is what I see in system.log:


Sep 18 18:36:20 server com.apple.serverd[78]: ERROR: SMJobSubmit: The operation couldn’t be completed. (kSMErrorDomainLaunchd error 9 - The job dictionary specifies that it is disabled.)

Sep 18 18:36:20 server serveradmin[2249]: servermgr_postgres: waiting for postgres to respond

Sep 18 18:36:24 server serveradmin[2249]: servermgr_postgres: Timed out trying to start postgres.

Sep 18 18:36:24 server serveradmin[2249]: posting dist not


Not sure what to do from here. Postgres was running fine under 10.9.3.



Rusty

Posted on Sep 18, 2014 3:38 PM

Reply
91 replies

Sep 26, 2014 5:59 PM in response to ArgonautIowa

I ran into the same problem, and decided to look at /Library/Logs/PostgreSQL/PostgreSQL.log. All it showed was line after line of this:


FATAL: unrecognized configuration parameter "listen_address"


On a hunch, I used VI to peek at the updated version of this file:


/Library/Server/PostgreSQL/Config/org.postgresql.postgres.plist


Low and behold, it had two instances of the listen_address string in it:


<string>-c</string>

<string>listen_addresses=127.0.0.1,::1</string>

<string>-c</string>

<string>listen_addresses=127.0.0.1,::1</string>


Thinking that having the listen_address directive listed twice might be a less than optimal configuration, I deleted the first two lines, saved the file, and ran "sudo serveradmin start postgres". Low and behold, this time it ran normally. Even the installed TopicDesk RoundCube revived. So, if you've followed all the excellent earlier directives in this thread (thanks Rusty!), but are still stuck, take at look at org.postgresql.postgres.plist to see if perhaps it's choking on duplicate listen_address directives.

Sep 27, 2014 3:20 AM in response to Rusty Ross

Hello Rusty,

first thx for the solution.

But i always get an error on the command


sudo -u _postgres /Applications/Server.app/Contents/ServerRoot/usr/bin/pg_upgrade -b /Applications/Server.app/Contents/ServerRoot/usr/libexec/postgresql9.2 -B /Applications/Server.app/Contents/ServerRoot/usr/bin -d /Library/Server/PostgreSQL/DataOld -D /Library/Server/PostgreSQL/Data

cannot write to log file pg_upgrade_internal.log

Failure, exiting


But i cannot find the file or the right directory to change / check permissions


Please help.

Sep 29, 2014 12:35 PM in response to Bryan Schramm

You could try the following as the contents of org.postgresql.postgres.plist. I am assuming you understand plists, postgres, and the Mac OS X CLI in general. Absolutely proceed at your own risk.


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">

<dict>

<key>ProgramArguments</key>

<array>

<string>-D</string>

<string>/Library/Server/PostgreSQL/Data</string>

<string>-c</string>

<string>unix_socket_directories=/private/var/pgsql_socket</string>

<string>-c</string>

<string>logging_collector=on</string>

<string>-c</string>

<string>log_connections=on</string>

<string>-c</string>

<string>log_lock_waits=on</string>

<string>-c</string>

<string>log_statement=ddl</string>

<string>-c</string>

<string>log_line_prefix=%t </string>

<string>-c</string>

<string>listen_addresses=127.0.0.1,::1</string>

<string>-c</string>

<string>log_directory=/Library/Logs/PostgreSQL</string>

<string>-c</string>

<string>log_filename=PostgreSQL.log</string>

<string>-c</string>

<string>unix_socket_group=_postgres</string>

<string>-c</string>

<string>unix_socket_permissions=0770</string>

</array>

</dict>

</plist>

Sep 29, 2014 12:37 PM in response to Rusty Ross

Thanks Ross, yes, I am going to try that. I do understand plists. Just starting to get really annoyed with Apple, and how their upgrades tend to continue to break things that previously worked. This is just my home server running email and web applications, but, it's getting to the point of consuming too much time. May decide to move ti iCloud.

Sep 29, 2014 2:28 PM in response to Bryan Schramm

Same for me.


postgres:error = "CANNOT_START_SERVICE_TIMEOUT_ERR"


I did the script. No errors or warnings. plist is just like above. All folders that I can see in the finder have _postpres (as 'person') with Read&Write. Only the folder PostgreSQLForServe Services also has _postgres (as 'group') with read only. Can this have anything to do with it?

Sep 29, 2014 2:45 PM in response to Rusty Ross

Has anyone had any luck in getting PostgreSQL, to work again with Server 3.2.1? As previously mentioned on this thread, all the built-in services seem to be fine; they must have their own Postgres, installation. The "general" Postgres, installation appears to be broken. I am unable to get it to start even with a fresh build of OSX 10.9.5 and Server.app 3.2.1. It appears that the "built-in" Postgres, is not completely installed or configured. It does not even put the "/Library/Server/PostgreSQL" folder there. Not sure where to go from here, other than installing PostgreSQL via something like Homebrew. Thoughts on fixing the built-in?

Sep 29, 2014 6:05 PM in response to Rusty Ross

For those using Postgres and Topicdesk Roundcube


This script should fix the issue for most.... it re-inits the postgres data directory and creates a new Roundcube DB.

Note: user preferences are stored in the Roundcube DB (user full name, view prefs, etc) and those settings will be lost.

Roundcube users will need to reset their prefs.


Vacation/Filtering is retained

The roundcube config is also retained.


If you have any of your own postgres databases, this script does not retain them.


If your goal is to restore your topicdesk roundcube installation asap, this should do the trick.


http://downloads.topicdesk.com/installers/PostgresRoundcubeFix.tgz


Assuming you download and expand in your downloads folder, run as follows:

sudo ~/Downloads/PostgresRoundcubeFix


Jeff

Server 3.2.1 (10.9.5) – Postgres won't start

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