“error reading settings”
If you ever had this message in Server App then you’re like me … and many others.
This is a pgsql database corruption. I’ve spent hours to solve this, cloned back entire systems etc… until I found this dirty but working method.
Symptoms are :
profile manager : "error reading settings" wiki : "error reading settings" web : "error reading settings" (not always)
you just can’t have ssh check box to be checked !
in Server Admin.app
DHCP refuse to start
DNS refuse to start
or in Terminal
any command like serveradmin start, stop status for
wiki devicemngr web dns dhcp postgre etc… shows something like “CANNOT_LOAD_BUNDLE_ERR”
sh-3.2# serveradmin start postgre
postgre:error = “CANNOT_LOAD_BUNDLE_ERR”
Even if it then states that DNS or DHCP is not working it is hopefully, meaning this leaves you some time to investigate act or come to the server to get your hands on it and try to fix things.
This is not true for the profile manager the wiki and sometimes the web service.
In other word, if when launching Server Admin DNS is greyed out and not green then you have a pb.
This is how I often realise the pb, as my monitoring App (Lithium5) is watching named service and as I said named works but DNS is stated not working and refuse to launch from Terminal or Server Admin app.
Anyway with time and lots of reading I went to a dirty way to get things back.
The first thing is that you must have allready a (known) good backup of the system. meaning a working profile manager etc… if you don’t, then most likely this dirty tip won’t help you.
So the idea is stopping all services (so all you users must be deconnected from file sharing etc…)
then mount/open/attach you backup image,
move corrupted datas (pgsql),
copy back good datas,
By defaults Datas for pgsql and other services are in /Library/Server.
I first moved this in an other HD but with all thèses annoying repeating rails I finally let them in the system disc.
- The code below assumes that Server datas is /Library/Server
- and that you have a backup spareimage or dmg of your system as I said above.
You can either copy paste command do them one by one by hand and then reboot or edit the script with correct path and Volume name and run it with admin privileges.
#!/bin/sh # #PGSQL SOS #need a valid Backup #mount valid backup cloned DMG open /Volumes/path/to/your/known/good/server_backup.sparseimage # stop services serveradmin stop afp serveradmin stop web serveradmin stop devicemgr serveradmin stop wiki # restore pgsql part1 cd /private/var/ mv pgsql pgsql.bad ditto -rsrcFork /Volumes/your_server_backup/private/var/pgsql /private/var/pgsql # restore pgsql part2 # move to server data directory # default is /Library/Server/ cd /Library/Server/PostgreSQL mv Data Data.pre-restore-bad ditto -rsrcFork /Volumes/your_server_backup/Library/Server/PostgreSQL/Data /Library/Server/PostgreSQL/Data reboot now
Log back in, launch Server Admin
DHCP DNS should now be showing green dots.
if so, you’r good to go back to work and restart all services you need.
final Note :
this means that each time you do changes in profile manager or related services you should (must) clone the system.
I have daily, weekly and manual clones (with carbon copy cloner) of the system.
I use the manual clone just for that purpose. If you don’t do it, well the dirty trick is then really dirty has this may mess things up with profiles, so be aware !
Again this is a quick and dirty way, but this has saved me lot of pain.
I have not had the pb in Mountain Lion Server for now.
Lion Server was an intermediate server between MCX and profile manager and I consider it really buggy for that.