Fixing Server PostgreSQL Services

A few weeks ago, my hard drive died on me. I hadn't backed up in a while, so I used DataRescue to recover most of my drive (and replaced anything it marked as corrupt) followed by a clean install and migration from the recovered data. However, I don't think it did a great job with permissions. I think I've fixed most of it, but I'm having some issues with Server. In the logs, I see the following message constantly:


Aug 8 01:20:28 shakespeare com.apple.launchd[1] (com.apple.postgres[491]): Exited with code: 2

Aug 8 01:20:28 shakespeare com.apple.launchd[1] (com.apple.postgres): Throttling respawn: Will start in 10 seconds


In Server, it can't load the settings for several services (wiki, profile manager, mail) and gives me the following message:


An error occurred on the server while reading settings.

The error occurred while reading settings for the Mail service.


At the same time, in the console I see:


Aug 8 22:27:51 shakespeare.local collabd[18403]: [CSConnectionPool:152 8481000 +0ms] Could not open a connection to Postgres. Please make sure it is running and has the correct access.


I've also seen other postgre related log messages:


Aug 7 23:51:28 shakespeare.local sudo[1248]: root : user NOT in sudoers ; TTY=unknown ; PWD=/ ; USER=_postgres ; COMMAND=/Applications/Server.app/Contents/ServerRoot/usr/bin/initdb --encoding UTF8 -D /Library/Server/PostgreSQL For Server Services/Data

Aug 7 23:51:43 shakespeare.local serveradmin[1918]: servermgr_postgres_server: waiting for postgres to respond



From all of this, I sermize that it's a permissions issue related to the user _postgres. Does anyone know how to fix this? Which file's permissions should I look at?

MacBook Pro (13-inch Mid 2009), OS X Mountain Lion (10.8.4)

Posted on Aug 8, 2013 7:32 PM

Reply
16 replies

Aug 8, 2013 10:08 PM in response to khassani

If you have more than one user account, you must be logged in as an administrator to carry out these instructions.


Triple-click anywhere in the line below to select it:

sudo grep root /e*/su* | open -f -a TextEdit


Copy the selected text to the Clipboard (command-C).


Launch the Terminal application in any of the following ways:


☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)


☞ In the Finder, select Go Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.


☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.


Paste into the Terminal window (command-V). You'll be prompted for your login password. Nothing will be displayed when you type it. If you don’t have a login password, you’ll need to set one before you can run the command. You may get a one-time warning not to screw up. Confirm. You don't need to post the warning.


If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator. Log in as one and start over.


A TextEdit window will open. If the command produced no output, the window will be empty. Post the contents of the TextEdit window (not the Terminal window), if any — the text, please, not a screenshot. The title of the window doesn't matter, and you don't need to post that.

Aug 10, 2013 12:33 PM in response to Linc Davis

Library/Server/PostgreSQL:

total 0

drwxr-xr-x 3 216 216 - 102 Aug 7 23:51 .

drwxr-xr-x 19 0 0 - 646 Aug 7 23:52 ..

drwxr-xr-x 3 216 216 - 102 Aug 7 23:51 Config



/Library/Server/PostgreSQL For Server Services:

total 0

drwxr-xr-x 5 216 216 - 170 Aug 7 23:51 .

drwxr-xr-x 19 0 0 - 646 Aug 7 23:52 ..

drwxr-xr-x 3 216 216 - 102 Aug 7 23:51 Config

drwx------ 2 216 216 - 68 Aug 7 23:51 Data

drwxr-xr-x 2 216 216 - 68 Aug 7 23:51 Socket

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Fixing Server PostgreSQL Services

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