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 6 of 7 last Next
  • by bubbaglia,

    bubbaglia bubbaglia Oct 17, 2014 8:54 AM in response to Rusty Ross
    Level 1 (4 points)
    Servers Enterprise
    Oct 17, 2014 8:54 AM in response to Rusty Ross

    I bypassed any problems with these commands:

     

    #DUMP DB BEFORE UPDATE SERVER.APP. USE TERMINAL

    sudo /Applications/Server.app/Contents/ServerRoot/usr/bin/pg_dumpall -h /Library/Server/ProfileManager/Config/var/PostgreSQL/ -U _devicemgr -c -f ~/Desktop/profilemanager_dumpall.pgdump

     

    #DELETE /Library/Server/ProfileManager

    sudo rm -R /Library/Server/ProfileManager

     

    #UPDATE SERVER.APP, CLOSE IT AND RESTORE USING TERMINAL

    sudo serveradmin stop devicemgr

    sudo /Applications/Server.app/Contents/ServerRoot/usr/share/devicemgr/backend/wipeDB .sh

    sudo dropdb -h "/Library/Server/ProfileManager/Config/var/PostgreSQL" -U _devicemgr devicemgr_v2m0

    sudo createdb -h "/Library/Server/ProfileManager/Config/var/PostgreSQL" -U _devicemgr devicemgr_v2m0

    sudo psql -h "/Library/Server/ProfileManager/Config/var/PostgreSQL" -U _devicemgr -d devicemgr_v2m0 -f ~/Desktop/profilemanager_dumpall.pgdump

    sudo psql -U _devicemgr -d devicemgr_v2m0 -h /Library/Server/ProfileManager/Config/var/PostgreSQL -c "UPDATE auto_join_profiles SET usage_log = NULL"

    sudo /Applications/Server.app/Contents/ServerRoot/usr/share/devicemgr/config/migrate DB

    sudo serveradmin start devicemgr

  • by Johan Ylinenjarvi,

    Johan Ylinenjarvi Johan Ylinenjarvi Oct 17, 2014 12:05 PM in response to Benezet
    Level 1 (11 points)
    Mac OS X
    Oct 17, 2014 12:05 PM in response to Benezet

    Apple breaks everything down with 3.2.2 again, this script (with 1 edit) fixed my Roundcube even though every user lost their personal setting.

  • by Bryan Schramm,

    Bryan Schramm Bryan Schramm Oct 17, 2014 12:09 PM in response to Johan Ylinenjarvi
    Level 1 (15 points)
    Oct 17, 2014 12:09 PM in response to Johan Ylinenjarvi

    Server 4.0, is even worse.  I had my sites all configured as webapps, now, it unchecks them as soon as clicking OK.  When I assigned my 3rd party SSL certificate to the web service, it also reverts back to the built-in certificate whenever I try to enable a webapp.  Everything was working perfectly on Server 3.2.1; however as usual, Apple breaks it with upgrades.  This is getting to be completely ridiculous.  I don't think Apple, really cares about supporting a server any longer.  I give up.  This is just a server for my family's email, file sharing, calendaring, iTunes server, needs; however, I am done.  I am tired.  My plan is to move to a hosted email service like Yahoo, or something.

  • by techiejohn,

    techiejohn techiejohn Oct 18, 2014 5:25 AM in response to Rusty Ross
    Level 1 (5 points)
    Oct 18, 2014 5:25 AM in response to Rusty Ross

    Does 3.2.2 fix all these issues with 3.2.1? I managed to restore the mess to pre-3.2.1 state (to version 3.1.2 by restoring TM backup of Server.app and /Library/Server), and I'd rather not go through it again if 3.2.2 is just as big of a failure.

  • by essandess,

    essandess essandess Oct 18, 2014 6:13 AM in response to techiejohn
    Level 1 (28 points)
    Applications
    Oct 18, 2014 6:13 AM in response to techiejohn

    I'm not sure if 3.2.2 fixes the problem, but it didn't break my own postgres fix.

  • by techiejohn,

    techiejohn techiejohn Oct 18, 2014 6:37 AM in response to essandess
    Level 1 (5 points)
    Oct 18, 2014 6:37 AM in response to essandess

    I had a combination of these issues, and every time I fixed something, something else broke; the DB upgrade worked (after tweaking two of the locale settings), but after a reboot the data files ended up corrupt from which I could not recover (DB wouldn't start). So, I just reverted which luckily worked (but don't know if it was supposed to have which is why I hesitate trying it again).

  • by Bryan Schramm,

    Bryan Schramm Bryan Schramm Oct 18, 2014 9:16 AM in response to techiejohn
    Level 1 (15 points)
    Oct 18, 2014 9:16 AM in response to techiejohn

    3.2.2 broke Postgres, on my server just like 3.2.1 did.  Also, do not upgrade to Yosemite & Server 4.0, too many issues and broken things to list.

  • by GSOY,

    GSOY GSOY Oct 18, 2014 2:28 PM in response to Bryan Schramm
    Level 1 (15 points)
    Oct 18, 2014 2:28 PM in response to Bryan Schramm

    FWIW: I got Postgres back to run when using 3.2.1 after following several of the directions in this thread (mostly Rusty's). After updating to 3.2.2, Postgres didn't start up again (CANNOT_START_SERVICE_TIMEOUT_ERR), but a new error showed in my system.log:

    1. run
      sudo serveradmin start postgres
      
    2. this shows up in system.log:
      com.apple.serverd[115]: ERROR: SMJobSubmit: The operation couldn't be completed. (kSMErrorDomainLaunchd error 9 - The job dictionary specifies that it is disabled.)
      

     

    I don't remember if this was caused by my fiddling when trying to get Postgres running again after the 3.2.1 update, but the launchd overrides plist actually had an entry to disable postgres. I could swear that this error didn't show up in attempts to start postgres with OSX Server 3.2.1, and I had Postgres running with 3.2.1.

     

    Anyway: If you get this error after trying to start postgres, have a look in the launchd overrides plist file:

    sudo nano /var/db/launchd.db/com.apple.launchd/overrides.plist 
    

     

    Search for the postgres entry (Ctrl+W in nano) and have a look if its key “Disabled” is set to FALSE. If it isn't, change it and try to start postgres.

     

    In my case, Postgres started up without a hitch, is running smoothly and the error above does no longer show up in my system.log.

  • by pbanta,

    pbanta pbanta Oct 22, 2014 8:59 PM in response to Rusty Ross
    Level 1 (0 points)
    Oct 22, 2014 8:59 PM in response to Rusty Ross

    Rusty,

     

    Thank you!  I didn't run as a script but these steps worked for me.  Thanks, again, for contributing this information to the forum.

     

    Paul

  • by dane,

    dane dane Oct 27, 2014 9:15 PM in response to GSOY
    Level 1 (4 points)
    Servers Enterprise
    Oct 27, 2014 9:15 PM in response to GSOY

    Perfect Thanks

  • by lgrijalvh,

    lgrijalvh lgrijalvh Oct 31, 2014 6:57 PM in response to GSOY
    Level 1 (0 points)
    Oct 31, 2014 6:57 PM in response to GSOY

    Thanks GSOY, this fix my broken server

     

    Luis G.

  • by lgrijalvh,

    lgrijalvh lgrijalvh Nov 8, 2014 4:00 PM in response to Bryan Schramm
    Level 1 (0 points)
    Nov 8, 2014 4:00 PM in response to Bryan Schramm

    for those with problems with server 4.0, this seems to  fix my postgresql, http://foobartel.com/2014/10/yosemite-upgrade-postgresql/

    I still have problems trying to load openerp 7.0 web interface (maybe a python issue)

     

    Luis G

  • by Christian Arild Strømmen,

    Christian Arild Strømmen Christian Arild Strømmen Nov 10, 2014 2:49 AM in response to lgrijalvh
    Level 1 (5 points)
    Nov 10, 2014 2:49 AM in response to lgrijalvh

    So I'm at a complete loss here.

     

    Upgraded to 3.2.2 on a Mavericks install, and I had the dreaded error with postgres not starting (as symptomized by Profile Manager not running). Realizing that the last backup was not available I immediately panicked, and started googling. I have over 200 iPads out of physical reach that is enrolled with this computer, and the thought of having to re-enroll them all is a horrible nightmare.

     

    So I found this thread, confirmed that I had the directory/directories error in my logs, and sighed a relief thinking there might be a fix. Changed the line in the config, and postgres immediately started by itself (no I didn't stop it to begin with). Quickly realized that the data had already been migrated as I got the ""Old cluster data and binary directories are from different major versions."" mesage, and went to check, but I still had the error in Server.app (Error Reading Settings).

     

    I see I'm also having a ton of errors in the xpostgres.log file, the same as a few other users here:

    2014-11-10 11:48:53 XPG.914:  Spawning... ('/usr/bin/tar', '-xz', '-f', '/Library/Server/ProfileManager/Config/ServiceData/Data/backup/base_backup/base _complete.tar.gz', '-C', '/Library/Server/ProfileManager/Config/ServiceData/Data/PostgreSQL')

    2014-11-10 11:48:55 XPG.914:  Preparing to upgrade outdated database cluster.

    Traceback (most recent call last):

      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twi sted/internet/defer.py", line 397, in errback

        self._startRunCallbacks(fail)

      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twi sted/internet/defer.py", line 464, in _startRunCallbacks

        self._runCallbacks()

      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twi sted/internet/defer.py", line 551, in _runCallbacks

        current.result = callback(current.result, *args, **kw)

      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twi sted/internet/defer.py", line 1101, in gotResult

        _inlineCallbacks(r, g, deferred)

    --- <exception caught here> ---

      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twi sted/internet/defer.py", line 1043, in _inlineCallbacks

        result = result.throwExceptionIntoGenerator(g)

      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twi sted/python/failure.py", line 382, in throwExceptionIntoGenerator

        return g.throw(self.type, self.value, self.tb)

      File "/Applications/Server.app/Contents/ServerRoot/usr/bin/xpostgres", line 2033, in main

        result = yield xpg.do_everything(argv, environ)

      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twi sted/internet/defer.py", line 1043, in _inlineCallbacks

        result = result.throwExceptionIntoGenerator(g)

      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twi sted/python/failure.py", line 382, in throwExceptionIntoGenerator

        return g.throw(self.type, self.value, self.tb)

      File "/Applications/Server.app/Contents/ServerRoot/usr/bin/xpostgres", line 1094, in do_everything

        yield self.do_restore()

      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twi sted/internet/defer.py", line 1045, in _inlineCallbacks

        result = g.send(result)

      File "/Applications/Server.app/Contents/ServerRoot/usr/bin/xpostgres", line 1028, in do_restore

        did_upgrade = self.upgrade_cluster_if_needed()

      File "/Applications/Server.app/Contents/ServerRoot/usr/bin/xpostgres", line 1455, in upgrade_cluster_if_needed

        os.rename(self.data_directory, orig_data_dir)

    exceptions.OSError: [Errno 66] Directory not empty

     

     

    Anybody successfully solved this and got their old database back?

  • by Eicoun,

    Eicoun Eicoun Nov 17, 2014 8:44 AM in response to Rusty Ross
    Level 1 (4 points)
    Mac OS X
    Nov 17, 2014 8:44 AM in response to Rusty Ross

    This now going on now for more then two months and still no fix from apple, not even a comment from them. I was fortunate enough to roll back my server to the previous version, but i am stuck now with the old version.

     

    This is kind of ridiculous.

  • by lightbe_corp,

    lightbe_corp lightbe_corp Nov 17, 2014 9:48 AM in response to Eicoun
    Level 1 (0 points)
    Nov 17, 2014 9:48 AM in response to Eicoun

    I strongly suggest that no one upgrade to Yosemite.  I did that on both my servers and completely lost PosgreSQL, that is, I could not run the server app.  Thankfully I had not done a lot of updates.  I restored both of my servers to Mavericks before the latest version of the Server app was installed.  I'm moving my databases to postgres.app.  My problem is that I use several features in the server app (DNS,FTP, Web Service, VPN).  It appears that the Yosemite version of the server app is worse than the Mavericks version.  At least with the Mavericks version I can use the server app.

     

    Not good software development or testing.

first Previous Page 6 of 7 last Next