Rusty Ross

Q: 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

Close

Q: Server 3.2.1 (10.9.5) – Postgres won't start

  • All replies
  • Helpful answers

first Previous Page 4 of 7 last Next
  • by ArgonautIowa,

    ArgonautIowa ArgonautIowa Sep 26, 2014 4:07 PM in response to René de Vries
    Level 1 (20 points)
    Sep 26, 2014 4:07 PM in response to René de Vries

    René de Vries wrote:

     

    I ran the script (after doing chown on the PostgreSQL directory) but I'm still getting the error messages:

     

    sh-3.2# serveradmin start postgres

    postgres:error = "CANNOT_START_SERVICE_TIMEOUT_ERR"

     

    NEW: Now got it to work, somehow the socket dir had the wrong permissions.

    What steps did you take to fix this?

  • by Ted Dively,

    Ted Dively Ted Dively Sep 26, 2014 5:59 PM in response to ArgonautIowa
    Level 1 (0 points)
    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.

  • by Crow78,

    Crow78 Crow78 Sep 27, 2014 3:20 AM in response to Rusty Ross
    Level 1 (0 points)
    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.

  • by René de Vries,

    René de Vries René de Vries Sep 27, 2014 4:43 AM in response to Crow78
    Level 1 (0 points)
    Sep 27, 2014 4:43 AM in response to Crow78

    Hi,

     

    Start the script in a directory where you have write access (e.g. /tmp)

     

    René

  • by Allart Van Holten,

    Allart Van Holten Allart Van Holten Sep 28, 2014 12:23 PM in response to René de Vries
    Level 1 (70 points)
    Sep 28, 2014 12:23 PM in response to René de Vries

    Hi René,

     

    I get the same error. In fact I also get a permissions denied error at the initdb step. (line 15).

    Since you solved your problems by changing permissions, would you mind telling me what you did?

  • by René de Vries,

    René de Vries René de Vries Sep 29, 2014 4:03 AM in response to Allart Van Holten
    Level 1 (0 points)
    Sep 29, 2014 4:03 AM in response to Allart Van Holten

    Allart,

     

    Take care that the directories are writeable by the chosen user.

    Both a "chown -R _postgres /Library/Server/PostgreSQL" and a "chmod -R u+w" of the same directory shoul help.

     

    René

  • by Bryan Schramm,

    Bryan Schramm Bryan Schramm Sep 29, 2014 12:26 PM in response to Rusty Ross
    Level 1 (15 points)
    Sep 29, 2014 12:26 PM in response to Rusty Ross

    I am unable to get PostgreSQL to start.  It appears I do not have a Config folder.  Any idea how to have it recreate one?

     

    drwxrwxrwx   3 _postgres  _postgres  102 Sep 29 12:15 .

    drwxr-xr-x  25 root       wheel      850 Sep 29 12:14 ..

    drwxrwxrwx  19 _postgres  _postgres  646 Sep 29 12:15 Data

  • by Rusty Ross,

    Rusty Ross Rusty Ross Sep 29, 2014 12:29 PM in response to Bryan Schramm
    Level 2 (175 points)
    Sep 29, 2014 12:29 PM in response to Bryan Schramm

    You could do something like:

     

    sudo mkdir -p /Library/Server/PostgreSQL/Config

    sudo chown -R _postgres:_postgres  /Library/Server/PostgreSQL/Config

    sudo chmod -R 755  /Library/Server/PostgreSQL/Config

  • by Bryan Schramm,

    Bryan Schramm Bryan Schramm Sep 29, 2014 12:32 PM in response to Rusty Ross
    Level 1 (15 points)
    Sep 29, 2014 12:32 PM in response to Rusty Ross

    Thanks, but, how do I get it to recreate the config file so the daemon will start?

  • by Rusty Ross,

    Rusty Ross Rusty Ross Sep 29, 2014 12:35 PM in response to Bryan Schramm
    Level 2 (175 points)
    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>

  • by Bryan Schramm,

    Bryan Schramm Bryan Schramm Sep 29, 2014 12:37 PM in response to Rusty Ross
    Level 1 (15 points)
    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.

  • by Bryan Schramm,

    Bryan Schramm Bryan Schramm Sep 29, 2014 12:42 PM in response to Rusty Ross
    Level 1 (15 points)
    Sep 29, 2014 12:42 PM in response to Rusty Ross

    Who knows....  It still will not start, and, there is nothing in the logs.  I've went as far as removing server.app, and, reinstalling it, yet, the problem persists.

  • by Allart Van Holten,

    Allart Van Holten Allart Van Holten Sep 29, 2014 2:28 PM in response to Bryan Schramm
    Level 1 (70 points)
    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?

  • by Bryan Schramm,

    Bryan Schramm Bryan Schramm Sep 29, 2014 2:45 PM in response to Rusty Ross
    Level 1 (15 points)
    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?

  • by UptimeJeff,

    UptimeJeff UptimeJeff Sep 29, 2014 6:05 PM in response to Rusty Ross
    Level 4 (3,477 points)
    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

first Previous Page 4 of 7 last Next