Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

wiki server failing - postgres error

My wiki server has suddenly stopped working, looks ok in server.app but nothing loads then as proxy error is displayed.

Turning off wiki server allows the default server web page to load.


Ran sudo serveradmin fullstatus postgres, and got:


postgres:error = <62706c69 73743030 d4010203 04050618 19582476 65727369 6f6e5824 6f626a65 63747359 24617263 68697665 72542474 6f701200 0186a0a4 07081112 55246e75 6c6cd409 0a0b0c0d 0e0f1056 4e53436f 64655a4e 53557365 72496e66 6f584e53 446f6d61 696e5624 636c6173 73100180 00800280 035f1014 636f6d2e 6170706c 652e7365 72766572 6d677264 d2131415 165a2463 6c617373 6e616d65 5824636c 61737365 73574e53 4572726f 72a21517 584e534f 626a6563 745f100f 4e534b65 79656441 72636869 766572d1 1a1b5472 6f6f7480 0108111a 232d3237 3c424b52 5d666d6f 7173758c 919ca5ad b0b9cbce d3000000 00000001 01000000 00000000 1c000000 00000000 00000000 00000000 d5>

postgres:errorDescription = "The operation couldn’t be completed. (com.apple.servermgrd error 1.)"

postgres:errorCode = 1



Same error when trying to stop and start postgres

Posted on Jul 27, 2015 11:01 AM

Reply
15 replies

Jul 28, 2015 2:22 PM in response to Linc Davis

System Log

28/07/2015 22:13:47.026 collabd[34716]: [PGCServer.m:134 7d7e4300 +30390ms] Error starting postgres, status=1

28/07/2015 22:13:47.028 com.apple.xpc.launchd[1]: (com.apple.collabd[34716]) Service exited with abnormal code: 4

28/07/2015 22:14:17.415 collabd[34740]: [PGCServer.m:134 7d7e4300 +30360ms] Error starting postgres, status=1

28/07/2015 22:14:17.417 com.apple.xpc.launchd[1]: (com.apple.collabd[34740]) Service exited with abnormal code: 4


PostgresSQL log

empty


xpostgres.log

2015-07-27 20:16:50 XPG.327: Postgres exited.

2015-07-27 20:16:50 XPG.327: pg_receivexlog still running; terminating.

2015-07-27 20:16:50 XPG.327: log receiver: pg_receivexlog: not renaming "00000001000000010000004B.partial", segment is not complete

pg_receivexlog: received interrupt signal, exiting

2015-07-27 20:19:01 XPG.288: Process parent is PID 1

2015-07-27 20:19:10 XPG.288: Excluding data directory.

2015-07-27 20:19:10 XPG.288: Turning on archive logging.

2015-07-27 20:19:10 XPG.288: Cleaning up any existing postmaster.pid file

2015-07-27 20:19:10 XPG.288: Starting postgres.

2015-07-27 20:19:10 XPG.288: Waiting for data directory: /Library/Server/ProfileManager/Config/ServiceData/Data/PostgreSQL

2015-07-27 20:19:10 XPG.288: Data directory exists.

2015-07-27 20:19:10 XPG.288: Spawning postgres now.

2015-07-27 20:19:10 XPG.288: Waiting for socket to appear in socket directory: /Library/Server/ProfileManager/Config/var/PostgreSQL

2015-07-27 12:19:10.968 PDT LOG: redirecting log output to logging collector process

2015-07-27 12:19:10.968 PDT HINT: Future log output will appear in directory "/Library/Logs/ProfileManager".

2015-07-27 20:19:11 XPG.288: Socket available; starting should now be complete.

2015-07-27 20:19:11 XPG.288: log receiver: pg_receivexlog: starting log streaming at 1/4B000000 (timeline 1)

2015-07-27 20:19:11 XPG.288: Starting backup heartbeat.

2015-07-27 20:50:50 XPG.288: Killing idle connections...

2015-07-27 20:50:50 XPG.288: Spawning... ('/Applications/Server.app/Contents/ServerRoot/usr/bin/psql', '-q', '-h', '/Library/Server/ProfileManager/Config/var/PostgreSQL', '-d', 'postgres', '-c', "SELECT pid, (SELECT pg_terminate_backend(pid)) as killed from pg_stat_activity WHERE state LIKE 'idle';")

pid | killed

-----+--------

403 | t

452 | t

453 | t

460 | t

557 | t

(5 rows)



2015-07-27 20:50:59 XPG.288: log receiver: pg_receivexlog: not renaming "00000001000000010000004C.partial", segment is not complete

pg_receivexlog: replication stream was terminated before stop point

pg_receivexlog: disconnected; waiting 5 seconds to try again

2015-07-27 20:50:59 XPG.288: Postgres exited.

2015-07-27 20:50:59 XPG.288: pg_receivexlog still running; terminating.

2015-07-27 20:50:59 XPG.288: log receiver: pg_receivexlog: could not connect to server: could not connect to server: No such file or directory

Is the server running locally and accepting

connections on Unix domain socket "/Library/Server/ProfileManager/Config/var/PostgreSQL/.s.PGSQL.5432"?

2015-07-27 20:53:01 XPG.323: Process parent is PID 1

2015-07-27 20:53:02 XPG.323: Excluding data directory.

2015-07-27 20:53:02 XPG.323: Turning on archive logging.

2015-07-27 20:53:02 XPG.323: Cleaning up any existing postmaster.pid file

2015-07-27 20:53:02 XPG.323: Starting postgres.

2015-07-27 20:53:02 XPG.323: Waiting for data directory: /Library/Server/ProfileManager/Config/ServiceData/Data/PostgreSQL

2015-07-27 20:53:02 XPG.323: Data directory exists.

2015-07-27 20:53:02 XPG.323: Spawning postgres now.

2015-07-27 20:53:02 XPG.323: Waiting for socket to appear in socket directory: /Library/Server/ProfileManager/Config/var/PostgreSQL

2015-07-27 12:53:02.745 PDT LOG: redirecting log output to logging collector process

2015-07-27 12:53:02.745 PDT HINT: Future log output will appear in directory "/Library/Logs/ProfileManager".

2015-07-27 20:53:03 XPG.323: Socket available; starting should now be complete.

2015-07-27 20:53:04 XPG.323: log receiver: pg_receivexlog: starting log streaming at 1/4C000000 (timeline 1)

2015-07-27 20:53:04 XPG.323: Starting backup heartbeat.

Jul 29, 2015 5:49 PM in response to Linc Davis

Hi, Linc. Thank you so much for all of your attention to these support communities. I have made use of many of your solutions in the past and am hopeful you will come through for us once again.


I will add what I can to the discussion, though I am little more than a "hobby" level administrator. So, please forgive my ignorance in advance.


1) Running OS X 10.10.4 and Server 1.4.3 - this point update was installed about 1 week before the wiki went down.


2) Even prior to the point update to the Server app, users were seeing wiki instability with exception messages appearing in place of pages. It was one of the motivations for moving forward with the update. I had researched the error in the past and never found a solution, but the problem would resolve with a system restart so it didn't seem any more severe than many other hiccups which have sorted themselves out through updates over the years. This link reports the same error we were seeing: http://serverfault.com/questions/698520/os-x-yosemite-server-wiki-stops-working - though I can't say for sure this is related to the present service failure.


3) I have been troubleshooting this issue since around July 25th when the service went down overnight and would not return the following morning. As with the instability issue above, the Server app continued to report that is was On and Available - all green lights - but only blank pages appeared in place of the earlier exception messages. Other services appeared to be functioning - though we only use caching, file sharing, time machine, DNS, and Open Directory. Attempted the following:


a) restarting the wiki service in the server app

b) system restart

c) server app replacement (leaving data in place)

- This resulted in an indefinite hanging (twice over night) of the Server app installation process when it reached "Updating Wiki Service." In troubleshooting this issue from community forum information, I believed the problem was the Postgres service - based on things like the original poster described above. However, if Grant Bennet's comment above is true, then that may have been an erroneous conclusion as I was reliant upon the same Command Line tools


d) OS reinstall (leaving data in place) followed by server app replacement (leaving data in place)

- Same result as c.


e) Wiki folder replacement from time machine backup

- Same result as c.


f) Complete removal of Server app as you detail here: Uninstall OS X Server completely in Yosemite (including full /Library/Server folder)

- This resulted in a successful Server app installation and working wiki services - though empty, without any of our wiki data


g) Various attempts to either "migrate" or "restore" the wiki data from time machine backups

- sudo wikiadmin migrate -r [Path to Data] :: I could not get this to work, as the former "Collaboration" folder no longer exists, and attempts to direct this process to anything related to the Yosemite wiki file data structure failed to import any data (Error: "Repository does not contain a Groups, Users, or User Preferences folder, so not recognized as a 10.6 Wiki repository.") Does this procudure no longer work in Yosemite?

- sudo psql -U collab -d postgres -f [Path to Dump] -h /Library/Server/Wiki/PostgresSocket AND

- sudo pg_restore -h "/Library/Server/Wiki/PostgresSocket" -d collab -U collab --single-transaction "/Path/to/location/of/collab.pgdump" :: Neither of these methods would work because I lacked the relevant dump file and could no longer create such a file without successfully loading the wiki services


h) Restore entire /Library/Server folder from time machine backup and replace Server app

- Began with restoration points from just prior to failure but encountered the same indefinite hanging of the Server app installation at the Wiki setup stage

- PERHAPS MOST SURPRISINGLY, When I fell back prior to even the installation of the latest point update (which had continued to function for weeks after this backup) the installation process again stalled at the wiki setup. I believed this would succeed because it predated the failure by weeks and had even functioned (though with the periodic exception thrown, as mentioned earlier) serviceably for several weeks after. Perhaps I am missing an important step here.


There are other steps I have taken which did not seem as relevant, so that is the summation of my experience with the issue. I recognize that I may have made many mistakes along the way, but I believed it would be recoverable because I had time machine backups to fall back on. Perhaps that confidence was misplaced? I am now concerned that I may never recover this important resource for my company.


Any insight would be very much appreciated.

Sep 5, 2015 6:44 PM in response to Santa'sLittleHelper

The wiki service in Yosemite server suddenly stopped working with the error:


Caught exception "Connection to DB failed" [CSDatabaseError] executing route /app-context/wiki/


I of course started with turning wiki service on and off a couple times, with no luck. I also turned off the checkbox to enable WebDAV access to wiki files, since we don't need that anyway. Still wasn't working. So I dug into the postgresql database the wiki accesses, to see if I could figure out anything. I didn't see anything obvious in the log files, it just appeared that it was trying to back up while the database system was shutting down. However, the postgres instance owned by _teamsserver was definitely not running.


I happened to notice the pg_hba.conf file (/Library/Server/Wiki/Database.xpg/Cluster.pg/pg_hba.conf) was larger than it should be, up to almost 200K lines. The line


local replication all trust


was repeated many times, and at the end was a lot of blank lines. I deleted all the extra lines, and then cleaned up the stale /Library/Server/Wiki/PostgresSocket/.xpg_ctl.pid file as well, and then the database started up just fine. Note: it doesn't actually start up until you turn wiki service back on and access the wiki.


I'm not sure how the pg_hba.conf file ended up in that state, or even whether it was the problem or the stale .xpg_ctl.pid file. Hopefully this will help somebody else fix their wiki service someday.

wiki server failing - postgres error

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