The Teknologist

Q: For all of you having services failing to start

After 48 hours of struggle with this same issue and 6 clean re-installs of Lion Server I have found the bug in Lion Server causing all ruby based collaboration services (Device Manager, Wiki, ical, some adress book features ie: major screw up in services around server admin tools and server app). The most visible one is in Profile Manager because as you all pointed out it even says sometimes "Error Reading Settings". And if you take a look at the logs its even worst...full of errors...

 

that's how I found out, yes reading all the logs took time:

 

Basically they all fail because they use Postgresql database.

 

At first I did 2 clean re-installs and noticed everytime, after having spent some time configuring the server (open directory/kerneros, creating accounts/mailboxes, profiles etc.). I would do a reboot and everything would break.

 

Now I won't go over all the diggin I did but I finally manage to understand why Postgres at some point was failing.

 

it seems there is a bug.

 

If you turn "Dedicate Resources to Server Services" in the Server.app Hardware Section (next to Push Notifications switch", postgres doesn't start and all depending services (lots) fail.

 

The Solution:  Just turn that OFF as shown below and restart. Everything should get back in order. If you still see some "push_notify: not connected" erros in you console logs (it happened to me even thoug all servcies were restored) the solution is easy. Hit change and redo the setup with you appleid.  You'll be issued new certs by Apple and everything shoudl work fine.

Screen Shot 2011-07-25 at 3.39.57 AM.PNG

That's all.

 

Hope this helps the many people that are frustrated like I was. Now that everything works, it's the perfect server for a mini Cloud. You'll love Profile Manager for provisioning payload to your devices. Elegant, efficient and simple, yet  very flexible with the openDirectory backend.

 

Cheers everyone !

 

Eric

 

twitter: @teknologism

Mac OS X (10.7)

Posted on Jul 24, 2011 7:17 PM

Close

Q: For all of you having services failing to start

  • All replies
  • Helpful answers

first Previous Page 8 of 8
  • by Drizzt,

    Drizzt Drizzt Jul 27, 2012 7:06 PM in response to Benezet
    Level 1 (19 points)
    Servers Enterprise
    Jul 27, 2012 7:06 PM in response to Benezet

    I haven't tried ML yet.. but I don't like what you just wrote. I hope it's going to be fixed for 10.7.5 / 10.8.1!

  • by sevkoms,

    sevkoms sevkoms Jul 29, 2012 10:11 AM in response to Drizzt
    Level 1 (0 points)
    Jul 29, 2012 10:11 AM in response to Drizzt

    That didn't work for me neither on L nor ML servers.  Only way that works for me is to manually start the postgresql process.

  • by Drizzt,

    Drizzt Drizzt Jul 29, 2012 10:47 AM in response to sevkoms
    Level 1 (19 points)
    Servers Enterprise
    Jul 29, 2012 10:47 AM in response to sevkoms

    Try : sudo launchctl load -w /System/Library/LaunchDaemons/org.postgresql.postgres.plist

  • by sevkoms,

    sevkoms sevkoms Jul 29, 2012 6:05 PM in response to Drizzt
    Level 1 (0 points)
    Jul 29, 2012 6:05 PM in response to Drizzt

    When I do sudo launchctl load -w /System/Library/LaunchDaemons/org.postgresql.postgres.plist

    I get: org.postgresql.postgres: Already loaded

     

    So if I do:

    sudo launchctl unload -w /System/Library/LaunchDaemons/org.postgresql.postgres.plist

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

    But no postgres process start.

     

    Profile Manager and Wiki says "Error Reading Settings" in Server.app and the log keeps looping through the messages below:

     

    7/29/12 9:02:55.607 PM com.apple.devicemanager: DEBUG: Initializing DeviceManagerDaemon with ports 3320,3321,3322,3323,3324,3325,3326,3327,3328,3329 (physmem = 16GB)

    7/29/12 9:02:55.607 PM com.apple.devicemanager: DEBUG: Making sure Rails is configured properly

    7/29/12 9:02:55.607 PM com.apple.devicemanager: DEBUG: Running rake command: /usr/bin/rake db:migrate

    7/29/12 9:02:57.354 PM com.apple.devicemanager: rake aborted!

    7/29/12 9:02:57.354 PM com.apple.devicemanager: could not connect to server: No such file or directory

    7/29/12 9:02:57.354 PM com.apple.devicemanager:           Is the server running locally and accepting

    7/29/12 9:02:57.354 PM com.apple.devicemanager:           connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?

    7/29/12 9:02:57.354 PM com.apple.devicemanager: (See full trace by running task with --trace)

    7/29/12 9:02:57.361 PM com.apple.devicemanager: (in /usr/share/devicemgr/backend)

    7/29/12 9:02:57.365 PM com.apple.devicemanager: /usr/share/devicemgr/backend/devicemgrd:109:in `rake': Rake command failed with 256 (RuntimeError)

    7/29/12 9:02:57.365 PM com.apple.devicemanager:           from /usr/share/devicemgr/backend/devicemgrd:103:in `setupRails'

    7/29/12 9:02:57.365 PM com.apple.devicemanager:           from /usr/share/devicemgr/backend/devicemgrd:33:in `run'

    7/29/12 9:02:57.365 PM com.apple.devicemanager:           from /usr/share/devicemgr/backend/devicemgrd:131

    7/29/12 9:02:57.365 PM com.apple.launchd: (com.apple.devicemanager[665]) Exited with code: 1

    7/29/12 9:02:57.365 PM com.apple.launchd: (com.apple.devicemanager) Throttling respawn: Will start in 9 seconds

    7/29/12 9:03:04.318 PM com.apple.launchd: (org.postgresql.postgres[668]) Exited with code: 1

    7/29/12 9:03:04.318 PM com.apple.launchd: (org.postgresql.postgres) Throttling respawn: Will start in 10 seconds



  • by Drizzt,

    Drizzt Drizzt Jul 29, 2012 6:32 PM in response to sevkoms
    Level 1 (19 points)
    Servers Enterprise
    Jul 29, 2012 6:32 PM in response to sevkoms

    This line :

    com.apple.launchd: (org.postgresql.postgres) Throttling respawn: Will start in 10 seconds

     

    Means that Postgres stops. You can have a look in /Library/Logs/PostgreSQL/PostgreSQL.log ans see why it stoped. Since you start it by yourself, could it be that you left it openned? Once launchd can start it for good, you'll be fine.

  • by Beno 44,

    Beno 44 Beno 44 Jul 29, 2012 6:41 PM in response to Drizzt
    Level 1 (15 points)
    Jul 29, 2012 6:41 PM in response to Drizzt

    Have u tried this

     

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

     

    serveradmin start postgres

  • by Beno 44,

    Beno 44 Beno 44 Jul 29, 2012 7:13 PM in response to Beno 44
    Level 1 (15 points)
    Jul 29, 2012 7:13 PM in response to Beno 44

    Sorry made a typo

     

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

     

    serveradmin start postgres

  • by paulfromburwood,

    paulfromburwood paulfromburwood Aug 28, 2012 7:03 PM in response to Drizzt
    Level 1 (90 points)
    Aug 28, 2012 7:03 PM in response to Drizzt

    Just to check something, is this a permanent fix for Lion Server?

     

    Will this mean no more living in fear of someone calling me and telling me that the there passwords dont work?

  • by Drizzt,

    Drizzt Drizzt Aug 28, 2012 7:07 PM in response to paulfromburwood
    Level 1 (19 points)
    Servers Enterprise
    Aug 28, 2012 7:07 PM in response to paulfromburwood

    It made my server stable. I currently have 38 days of uptime and all services work as they should!

  • by paulfromburwood,

    paulfromburwood paulfromburwood Aug 28, 2012 7:13 PM in response to Drizzt
    Level 1 (90 points)
    Aug 28, 2012 7:13 PM in response to Drizzt

    Oh - my - god. Drizzt you are a hero, truly, king of kings. I have been regretting moving to Lion server as every week something goes wrong, and I have to restart the server.

     

    Just out of interest, what exactly is that doing does postgresql have a limit of users or something?

     

    So when even I set up a server, I should just run this terminal command straight away!

     

    Has anyone submitted this to Apple? Perhaps this will happen in 10.7.5?

  • by Drizzt,

    Drizzt Drizzt Aug 29, 2012 5:44 AM in response to paulfromburwood
    Level 1 (19 points)
    Servers Enterprise
    Aug 29, 2012 5:44 AM in response to paulfromburwood

    I'm just glad I could help!

    The problem and solution as been explained in this topic earlier. It is a problem with the number of openned files.

     

    I know someone at Apple knows about this. I'm waiting for 10.7.5...

  • by paulfromburwood,

    paulfromburwood paulfromburwood Sep 6, 2012 5:33 PM in response to Drizzt
    Level 1 (90 points)
    Sep 6, 2012 5:33 PM in response to Drizzt

    Well, I had my issue again today, all of a sudden users cant log in to services. So unfortunatly, this hasn’t worked for me.

  • by paulfromburwood,

    paulfromburwood paulfromburwood Sep 6, 2012 5:48 PM in response to paulfromburwood
    Level 1 (90 points)
    Sep 6, 2012 5:48 PM in response to paulfromburwood

    Oh for a bit more info:

     

    Out of the blue, no one can connect to the server, Mail, Calender, Address Book all spit an error, that the password is incorrcet (so it seems like the password server is falling over).

     

    I have to restart to get it back. Once restarted, Mail Address Book work great. iCal does not.

     

    So I have to open terminal and do the following:

     

    sudo serveradmin stop calendar

    sudo serveradmin settings calendar:Authentication:Wiki:URL = "http://127.0.0.1:8089/RPC2"

    sudo serveradmin start calendar

     

    Then it all comes good.

first Previous Page 8 of 8