DocMoto
Server
DocMoto cannot find Postgres
The DocMoto server uses Postgres to store its data.
When OSX is upgraded it can happen that DocMoto can no longer find Postgres.
You can test for this by looking at the DocMotoServer logs as decribed here.
When DocMoto cannot connect to Postgres you will see lots of server logs because one is created every minute as the DocMoto server attempts to start but fails.
If you open one of these log files and find repeated entries of a line similar to
2020-10-15T01:12:31Z: DTrace: DEBUG: psql_store/PostgreSQLConnection.cpp: Postgresql not ready, trying again
This indicates there is an issue with Postgres.
The most common reason for this is the removal of a link telling DocMoto the current version of Postgres.
Identifying your Postgres Folder
- Open terminal and login as the super user by typing sudo -s
- Type
ps -ef | grep postmast
if Postgres is running you should see a line similar to
502 119 1 0 Fri08am ?? 0:00.71 /Library/PostgreSQL/12/bin/postmaster -D/Library/PostgreSQL/12/data
This identifies the location of Postgres, in this case it is /Library/PostgresSQL/12.
NB. If this command does not return anything then Postgres is not running, in which case you will need to try another line of investigation. - Navigate to your PostgreSQL folder using
cd /Library/PostgresSQL
(for the above) and list the directory contents by typing
ls -l.
You should see an entry Current if this is not present you need to create a link.
Creating a Current link
- Navigate to your PostgreSQL folder using
cd /Library/PostgresSQL
(for the above example). - In the above example the current version of postgres in use is 12. We need to create a link to the folder /Library/PostgresSQL/12 to do this simply enter
ln -s /Library/PostgreSQL/12 Current - To check the link has worked type ls -l and you should see an entry Current -> /Library/PostgreSQL/12
Once you have created the link you can try restarting the DocMoto server in System Preferences and see if you can now connect.
If you still cannot connect you need to re-examine to DocMotoServer logs and look for additional clues.