2 Replies Latest reply: Feb 26, 2013 11:00 PM by Gnarlodious
James Rothschild Level 1 Level 1 (55 points)

Oh Dear, for some reason we get this error:

 

DATABASE ERROR: CONNECTION FAILED!

Unable to connect to the database!
Please contact your server-administrator.

 

On our Mac OS X Server 10.7.3 hosted at: https://mail.pantheonmacro.com/webmail/

 

Maill will not send or receive, no error on clients, just no traffic.

I think this was after a privilege error (see below from the system log) on the VAR folder changed by a third party:-)

 

Any help very welcome, thank you,

 

Feb 24 22:47:37 pantheonmacro org.jabber.proxy65[73467]:   File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twi sted/application/app.py", line 378, in run

Feb 24 22:47:37 pantheonmacro org.jabber.proxy65[73467]:     self.logger.start(self.application)

Feb 24 22:47:37 pantheonmacro org.jabber.proxy65[73467]:   File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twi sted/application/app.py", line 216, in start

Feb 24 22:47:37 pantheonmacro org.jabber.proxy65[73467]:     observer = self._getLogObserver()

Feb 24 22:47:37 pantheonmacro org.jabber.proxy65[73467]:   File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twi sted/scripts/_twistd_unix.py", line 139, in _getLogObserver

Feb 24 22:47:37 pantheonmacro org.jabber.proxy65[73467]:     logFile = logfile.LogFile.fromFullPath(self._logfilename)

Feb 24 22:47:37 pantheonmacro org.jabber.proxy65[73467]:   File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twi sted/python/logfile.py", line 48, in fromFullPath

Feb 24 22:47:37 pantheonmacro org.jabber.proxy65[73467]:     os.path.dirname(logPath), *args, **kwargs)

Feb 24 22:47:37 pantheonmacro org.jabber.proxy65[73467]:   File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twi sted/python/logfile.py", line 161, in __init__

Feb 24 22:47:37 pantheonmacro org.jabber.proxy65[73467]:     BaseLogFile.__init__(self, name, directory, defaultMode)

Feb 24 22:47:37 pantheonmacro org.jabber.proxy65[73467]:   File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twi sted/python/logfile.py", line 40, in __init__

Feb 24 22:47:37 pantheonmacro org.jabber.proxy65[73467]:     self._openFile()

Feb 24 22:47:37 pantheonmacro org.jabber.proxy65[73467]:   File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twi sted/python/logfile.py", line 166, in _openFile

Feb 24 22:47:37 pantheonmacro org.jabber.proxy65[73467]:     BaseLogFile._openFile(self)

Feb 24 22:47:37 pantheonmacro org.jabber.proxy65[73467]:   File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twi sted/python/logfile.py", line 64, in _openFile

Feb 24 22:47:37 pantheonmacro org.jabber.proxy65[73467]:     self._file = file(self.path, "r+", 1)

Feb 24 22:47:37 pantheonmacro org.jabber.proxy65[73467]: IOError:

Feb 24 22:47:37 pantheonmacro org.jabber.proxy65[73467]: [Errno 13] Permission denied: '/private/var/jabberd/log/proxy65.log'

Feb 24 22:47:37 pantheonmacro com.apple.launchd[1] (org.jabber.proxy65[73467]): Exited with code: 1

Feb 24 22:47:37 pantheonmacro com.apple.launchd[1] (org.jabber.proxy65): Throttling respawn: Will start in 10 seconds

Feb 24 22:47:37 pantheonmacro org.postgresql.postgres[73529]: 2013-02-24 22:47:37 GMT FATAL:  data directory "/var/pgsql" has wrong ownership

Feb 24 22:47:37 pantheonmacro org.postgresql.postgres[73529]: 2013-02-24 22:47:37 GMT HINT:  The server must be started by the user that owns the data directory.

Feb 24 22:47:37 pantheonmacro com.apple.launchd[1] (org.postgresql.postgres[73529]): Exited with code: 1

Feb 24 22:47:37 pantheonmacro com.apple.launchd[1] (org.postgresql.postgres): Throttling respawn: Will start in 10 seconds



Mac mini, Mac OS X (10.7.3), Server
  • 1. Re: DATABASE ERROR: CONNECTION FAILED!
    James Rothschild Level 1 Level 1 (55 points)

    anyone please :-(

  • 2. Re: DATABASE ERROR: CONNECTION FAILED!
    Gnarlodious Level 4 Level 4 (3,220 points)

    It means the files have the wrong owner so the OS won't let the server access them. The launchd daemon keeps on trying every 10 seconds to start up the webapp but can't because file permissions are wrong.

     

    Apache by default runs as user www or _www, but installed files would usually have ownership by user root. User root is a tighter security user than www, so the files are blocked by the OS. All the relevant files and folders need to be accessible to Apache for the webapp to work.

     

    The easiest way to do this is to simply set all folders and files to world readable, and some files need to be world writable if databases need to be written to. However this solution may be insecure for an internet-facing server. It is however expedient and a good tool for diagnosis.

     

    You should lso look at the error.log for the domain for more information. There's also a setting to have Apache write a startup.log at every startup, but it is not active in the default configuration.