4

Over the last few days I've noticed the amount of free space on my HD has been plummeting. After a bit of investigation, I found it was due to the folder /Library/Server/Wiki/Database.xpg. It was created December 11 (4 days ago), and since then its disk usage has increased to 313GB.I think it may have been caused by me starting OS X Server for the first time, but I haven't used any of the functionality from it, and didn't even realize it had a wiki. In the Server services section the Wiki is turned off anyway.

This is a huge problem, as it is still growing very fast. Based on the time machine backup (which unfortunately backed up the directory, wiping all of my backups older than August to fit it in), one day ago it was only 147GB in size. Next, my partition is "only" 1TB in size, and I'm down to 267GB spare.

What actually created the folder, what is the correct way of deleting it, and how can I stop it from happening in the future?

I'm running Mac OSX Mavericks 10.9. The Server version is 3.0.1 (13S2015). The out of sudo stat /Library/Server/Wiki/Database.xpg is:

16777223 154796535 drwx------ 4 _teamsserver _teamsserver 0 136 "Dec 15 02:14:23 2013" "Dec 11 14:34:56 2013" "Dec 11 14:34:56 2013" "Dec 11 14:34:30 2013" 4096 0 0 /Library/Server/Wiki/Database.xpg

Some more info:

> sudo ls -al /Library/Server/Wiki/Database.xpg
drwx------      4 _teamsserver  _teamsserver     136 Dec 11 14:34 .
drwxr-xr-x      8 _teamsserver  _teamsserver     272 Dec 15 02:23 ..
drwx------@    21 _teamsserver  _teamsserver     714 Dec 15 02:23 Cluster.pg
drwx------  10091 _teamsserver  _teamsserver  343094 Dec 15 02:23 backup

Running it again a few minutes later:

sudo ls -al /Library/Server/Wiki/Database.xpg
drwx------      4 _teamsserver  _teamsserver     136 Dec 11 14:34 .
drwxr-xr-x      8 _teamsserver  _teamsserver     272 Dec 15 02:25 ..
drwx------@    21 _teamsserver  _teamsserver     714 Dec 15 02:25 Cluster.pg
drwx------  10095 _teamsserver  _teamsserver  343230 Dec 15 02:25 backup

For whatever reason there are thousands of backup files being created, which are growing by a few every minute.


Edit: I have some more info. I know now the cause of the problem is almost certainly this process:

_teamsserver      578   0.0  0.1  2507572  16240   ??  S    12:51PM   0:00.26 /usr/bin/python /Applications/Server.app/Contents/ServerRoot/usr/bin/xpg_ctl stop -w -t 3600 -D /Library/Server/Wiki/Database.xpg/Cluster.pg -l /Library/Server/Wiki/Logs/postgres-xpg.log -o -c log_line_prefix=%t -c log_lock_waits=on -c log_statement=ddl -c logging_collector=on -c max_connections=500 -c unix_socket_directory=/Library/Server/Wiki/PostgresSocket -c unix_socket_group=_teamsserver -c unix_socket_permissions=0770 -c log_connections=on -c listen_addresses= -c log_directory=/Library/Server/Wiki/Logs -c log_filename=postgres-%a.log -c log_rotation_age=1440 -c log_truncate_on_rotation=on

This results in the following log lines appearing in /Library/Server/Wiki/Logs/postgre-Sun.log (today is Sunday):

2013-12-15 13:03:33 ESTLOG:  connection received: host=[local]
2013-12-15 13:03:33 ESTFATAL:  the database system is shutting down
'/Library/Server/Wiki/Database.xpg/Cluster.pg/pg_xlog/000000010000001200000009' === '/Library/Server/Wiki/Database.xpg/backup/000000010000001200000009'
'/Library/Server/Wiki/Database.xpg/Cluster.pg/pg_xlog/00000001000000120000000A.00000020.backup' ... '/Library/Server/Wiki/Database.xpg/backup/00000001000000120000000A.00000020.backup'
'/Library/Server/Wiki/Database.xpg/Cluster.pg/pg_xlog/00000001000000120000000A.00000020.backup' --> '/Library/Server/Wiki/Database.xpg/backup/00000001000000120000000A.00000020.backup'
'/Library/Server/Wiki/Database.xpg/Cluster.pg/pg_xlog/00000001000000120000000A' === '/Library/Server/Wiki/Database.xpg/backup/00000001000000120000000A'
'/Library/Server/Wiki/Database.xpg/Cluster.pg/pg_xlog/00000001000000120000000B' === '/Library/Server/Wiki/Database.xpg/backup/00000001000000120000000B'
'/Library/Server/Wiki/Database.xpg/Cluster.pg/pg_xlog/00000001000000120000000C.00000020.backup' ... '/Library/Server/Wiki/Database.xpg/backup/00000001000000120000000C.00000020.backup'
'/Library/Server/Wiki/Database.xpg/Cluster.pg/pg_xlog/00000001000000120000000C.00000020.backup' --> '/Library/Server/Wiki/Database.xpg/backup/00000001000000120000000C.00000020.backup'
'/Library/Server/Wiki/Database.xpg/Cluster.pg/pg_xlog/00000001000000120000000C' === '/Library/Server/Wiki/Database.xpg/backup/00000001000000120000000C'
'/Library/Server/Wiki/Database.xpg/Cluster.pg/pg_xlog/00000001000000120000000D' === '/Library/Server/Wiki/Database.xpg/backup/00000001000000120000000D'
'/Library/Server/Wiki/Database.xpg/Cluster.pg/pg_xlog/00000001000000120000000E.00000020.backup' ... '/Library/Server/Wiki/Database.xpg/backup/00000001000000120000000E.00000020.backup'
'/Library/Server/Wiki/Database.xpg/Cluster.pg/pg_xlog/00000001000000120000000E.00000020.backup' --> '/Library/Server/Wiki/Database.xpg/backup/00000001000000120000000E.00000020.backup'
2013-12-15 13:03:35 ESTLOG:  connection received: host=[local]
2013-12-15 13:03:35 ESTFATAL:  the database system is shutting down
'/Library/Server/Wiki/Database.xpg/Cluster.pg/pg_xlog/00000001000000120000000E' === '/Library/Server/Wiki/Database.xpg/backup/00000001000000120000000E'
'/Library/Server/Wiki/Database.xpg/Cluster.pg/pg_xlog/00000001000000120000000F' === '/Library/Server/Wiki/Database.xpg/backup/00000001000000120000000F'
'/Library/Server/Wiki/Database.xpg/Cluster.pg/pg_xlog/000000010000001200000010.00000020.backup' ... '/Library/Server/Wiki/Database.xpg/backup/000000010000001200000010.00000020.backup'
'/Library/Server/Wiki/Database.xpg/Cluster.pg/pg_xlog/000000010000001200000010.00000020.backup' --> '/Library/Server/Wiki/Database.xpg/backup/000000010000001200000010.00000020.backup'
'/Library/Server/Wiki/Database.xpg/Cluster.pg/pg_xlog/000000010000001200000010' === '/Library/Server/Wiki/Database.xpg/backup/000000010000001200000010'
'/Library/Server/Wiki/Database.xpg/Cluster.pg/pg_xlog/000000010000001200000011' === '/Library/Server/Wiki/Database.xpg/backup/000000010000001200000011'
'/Library/Server/Wiki/Database.xpg/Cluster.pg/pg_xlog/000000010000001200000012.00000020.backup' ... '/Library/Server/Wiki/Database.xpg/backup/000000010000001200000012.00000020.backup'
'/Library/Server/Wiki/Database.xpg/Cluster.pg/pg_xlog/000000010000001200000012.00000020.backup' --> '/Library/Server/Wiki/Database.xpg/backup/000000010000001200000012.00000020.backup'
'/Library/Server/Wiki/Database.xpg/Cluster.pg/pg_xlog/000000010000001200000012' === '/Library/Server/Wiki/Database.xpg/backup/000000010000001200000012'
'/Library/Server/Wiki/Database.xpg/Cluster.pg/pg_xlog/000000010000001200000013' === '/Library/Server/Wiki/Database.xpg/backup/000000010000001200000013'
'/Library/Server/Wiki/Database.xpg/Cluster.pg/pg_xlog/000000010000001200000014.00000020.backup' ... '/Library/Server/Wiki/Database.xpg/backup/000000010000001200000014.00000020.backup'
'/Library/Server/Wiki/Database.xpg/Cluster.pg/pg_xlog/000000010000001200000014.00000020.backup' --> '/Library/Server/Wiki/Database.xpg/backup/000000010000001200000014.00000020.backup'
'/Library/Server/Wiki/Database.xpg/Cluster.pg/pg_xlog/000000010000001200000014' === '/Library/Server/Wiki/Database.xpg/backup/000000010000001200000014'
'/Library/Server/Wiki/Database.xpg/Cluster.pg/pg_xlog/000000010000001200000015' === '/Library/Server/Wiki/Database.xpg/backup/000000010000001200000015'
2013-12-15 13:03:37 ESTLOG:  connection received: host=[local]
2013-12-15 13:03:37 ESTFATAL:  the database system is shutting down

These lines continue on and on, the log has 109962 lines so far.

I've tried connecting to the database, however it doesn't work:

$ sudo psql93 -h /Library/Server/Wiki/PostgresSocket
psql93: FATAL:  the database system is shutting down

Unfortunately I have little experience with postgresql, and don't know what to do from here.I could just kill the process, but it autostarts with the computer (I've tried restarting) so I don't think it will help.

  • Assuming you have a backup, does anything happen when you delete it? – Kevin Chen Dec 15 '13 at 4:25
  • @KevinChen: I don't have a consistent backup (as it is changing too quickly) so I haven't tried deleting it. There is no data there I want though, I was mainly worried about making the problem worse by corrupting the database or similar. It might be worth a shot soon though, I haven't had much luck finding anything else to try. – David Miani Dec 15 '13 at 4:33
  • @KevinChen: I've tried deleting it. While it fixes my space issues atm, the database was just recreated and it is still continually growing in size. I could make a cron job to delete it every hour or so, but I would rather a better solution to this. – David Miani Dec 15 '13 at 6:00
2

I ended up completely uninstalling Apple Server to fix this problem. I used AppCleaner as it automatically gets rids of all the server files for you. A standard "drag to trash" uninstall would probably also work but I wanted to be thorough.

Not a very satisfactory solution to this, but it is better than nothing. If anyone else runs across this issue in the future, good luck with finding a better solution!

2

I had same problem - several wiki backup files a minute. I found an article here (https://discussions.apple.com/thread/4597188?start=45&tstart=0), that solved the problem to me. The third party software GoodSync (GoodSync connect) caused the problem. I had to GoodSync > GodSync > edit gs-server install (without really installing) and delete /Library/LaunchDaemons/theGoodSyncOne.

Almost no more wiki which I don't use backups anymore!

  • That is a very good catch, as I was using GoodSync at the time. This may have been the root cause then! I have since uninstalled GoodSync (I replaced it with FreeFileSync), so I may try reinstalling Apple Server to see if is fixed. Thanks for your answer! – David Miani Feb 22 '14 at 5:07
1

I'm running OSX Mavericks:

This issues is caused because the archiving feature in postgres is turned on - I believe so the wiki can keep revision history of the pages. However, I tried disabling it and this seems to avoid this issue of continuous backups.

The continual backup is caused by the malfunctioning of the apple python script. Here's what worked for me until they fix their script - it allows the wiki to keep being used but stops the continual backups that fill up the disk.

Edit /Library/Server/Wiki/Database.xpg/Cluster.pg/postgresql.conf

and turn archive off:

archive_mode = off              # allows archiving to be done
                                # (change requires restart)

Or you can figure out why the archive command is failing:

archive_command = 'python /Applications/Server.app/Contents/ServerRoot/usr/bin/xpostgres archive %p ../backup/%f'               # command to use to archive a logfile segment
                                # placeholders: %p = path of file to archive

See: http://www.postgresql.org/docs/9.1/static/continuous-archiving.html for documentation on this "feature".

After I made these changes, I stopped and restarted the server, then it seems it stopped adding new files to that directory.

0

Possible workaround: turn the Wiki service on?

  • I turned the Wiki service on.
  • I set it to "only some users".
  • I disabled WebDav.
  • I left it overnight.
  • I turned the service off.

So far no further backup files have been created.

0

I hit upon this thread because I am investigating a related problem: user _teamsserver keeps spawning a shortlived python process that uses a lot of CPU resources. A month ago or so, I "fixed" this by deleting all server files and doing a clean install of the server. Tonight I noticed that watching something on bbci player caused the fan in macmini to become very loud. I checked and yes, the dreaded python process was back.

Having read David's experiences above, I decided to find the folder /Library/Server/Wiki/Database.xpg and delete it entirely. Within seconds my CPU usage dropped to normal levels (from around 10% to about 0.70 %) and my macmini is quiet again. I have no idea what is going on: like David, I am not using the wiki service at all.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .