Database Issue with Mountain Lion

Hello,

I upgraded to Mountain Lion due to a crash with my previous machine, and I’m having issue with my former installations in Developer.
Here’s the unique error reported :

“org.postgresql.util.PSQLException: Connexion refusée. Vérifiez que le nom de machine et le port sont corrects et que postmaster accepte les connexions TCP/IP.”

Connexion refused, either machine name or ports are incorrect or postmaster doesn’t accept TCP/IP connexions. Any clue ?

Ports are ok, they are available, the machine name didn’t changed, so what can I do to fix it ?

Thanks

Ugo

Hi Ugo,

It means that PostgreSQL is not listening on TCP (only on UNIX sockets) which it does out-of-the-box for security reasons.
You can change this in the postgresql.conf
See http://www.postgresql.org/docs/9.2/stat … N-SETTINGS for more info.

Hope this helps.

Thank you Robert,
I uncommented the ‘listen_adresses’ but it doesn’t seem to change anything.
here’s the “connexion settings” part of the .conf file I have

Thanks again

Ugo

- Connection Settings -

listen_addresses = ‘localhost’ # what IP address(es) to listen on;

comma-separated list of addresses;

defaults to ‘localhost’, ‘*’ = all

(change requires restart)

port = 5434 # (change requires restart)
max_connections = 20 # (change requires restart)

Note: Increasing max_connections costs ~400 bytes of shared memory per

connection slot, plus lock space (see max_locks_per_transaction).

#superuser_reserved_connections = 3 # (change requires restart)
#unix_socket_directory = ‘’ # (change requires restart)
#unix_socket_group = ‘’ # (change requires restart)
#unix_socket_permissions = 0777 # begin with 0 to use octal notation

(change requires restart)

#bonjour = off # advertise server via Bonjour

(change requires restart)

#bonjour_name = ‘’ # defaults to the computer name

(change requires restart)

Hi Ugo,

Did you restart PostgreSQL after the change ?
Also what does your connection string (in Servoy) look like?

Hi,

Yes, I restarted Developer and even restarted my computer.
here are the current connexion string in servoy properties :

server.0.URL=jdbc:postgresql://localhost:5434/servoy_repository
server.0.catalog=
server.0.driver=org.postgresql.Driver
server.0.password=encrypted:XAFg2JKIdj0=
server.0.schema=
server.0.serverName=repository_server
server.0.userName=DBA

The postgres.log however state a FATAL with role “admin” doesn’t exist and thus a FATAL: data directory “/Applications/Servoy6/application_server/database” has wrong ownership

I’m wondering what exactly are the roles set and what parameter is expected as ownership for this directory

Thanks for your help

Hi Ugo,

you should be the owner of the folder /Applications/Servoy6/application_server/database and its contents. You can check this in Terminal by typing the following command:
ls -l /Applications/Servoy6/application_server

Then you should get something like this:

drwx------ 18 cl admin 612 27 Feb 20:26 database

This means, that this folder ‘database’ belongs to me (‘cl’) and to the group ‘admin’. If you have moved your Servoy6 folder to your new installed machine then you perhaps do not see your user name but rather you see a number or a wrong user name. So you have to fix this by adjusting the ownership:
chown -R [your_user_name] /Applications/Servoy6/application_server/database
e.g. :
chown -R cl /Applications/Servoy6/application_server/database

Hope this helps.

Christoph

Hi Christoph,

That’s what I get :
drwxr-xr-x+ 18 ugo wheel 612 11 avr 01:00 database

ugo is the owner of the whole Servoy6 folder as it should, but then ‘admin’ doesn’t exist in my user groups

Thanks

Hi Ugo,

You said you crashed. How did you reinstall Servoy/PostgreSQL ?
From a backup? Or you reinstalled it and imported the databases again ?

Hi,

Getting the datas back from my old HD was not possible, and the Time Machine recover from a Snow Leopard OS didn’t lead to a satisfactory situation.
I uninstallled Servoy and re-installed it yesterday, this is a fresh install of a 6.0.9 version downloaded yesterday.
At the moment, I haven’t recovered my previous workspaces and databases, I’m starting it up with the new installation.

Ugo

Hi Ugo,

Can you copy/paste the error messages from the postgres.log ?

Sure,

Here it is

FATAL: data directory “/Applications/Servoy6/application_server/database” has group or world access
DETAIL: Permissions should be u=rwx (0700)."

Previously, the message was :
FATAL: data directory “/Applications/Servoy6/application_server/database” has wrong ownership

Thanks

Hi,

you could correct the ownership with the terminal:
e.g.:
chmod -R o-rwx /Applications/Servoy6/application_server/database

Hi Ugo,

This is PostgreSQL being very secure and enforcing it.
Only the owner is allowed access to the data directory.
You can execute the following in the terminal to fix this:

chmod -R 700 /Applications/Servoy6/application_server/database

And if it still complains about ownerships then there might be some files/directories in the data directory that have the wrong owner. The following command should fix that.

chown -R ugo:wheel /Applications/Servoy6/application_server/database

Hope this helps.

Thank you both of you, I will post the results

Ugo

Bingo !

chmod -R 700 /Applications/Servoy6/application_server/database

solved this issue, thank you BOTH very much for your time

Ugo