Wednesday, March 27, 2013

Operational Error coming during starting of OpenERP Server

Hi all,

Yesterday, when I tried to start my openerp-server, I got an traceback as below:

Operational Error: Could not connect to server: No such file or directory
Is the server running locally and accepting
Connections on Unix domain socket "/var/run/postgresql/ .s.PGSQL.5432"?

Error says that There was no postgresql service running on my machine.
So I opened my terminal and fire this command:
ps aux | grep post
but I did not find any result.

After that, I fired this command to start postgresql service:
sudo /etc/init.d/postgresql start

After firing this command, I found this error:
* The PostgreSQL server failed to start. Please check the log output.

After that, I went to the /var/log/postgresql/..LOG_FILES, I did not find anything over there.
It seems that it was an bad permission issue. I needed to create a new group that includes only postgres users with all necessary rights like this:

sudo groupadd dbtest
sudo usermod -a -G dbtest postgres
sudo chgrp -R dbtest /var/log
sudo chmod -R 770 /var/log

After this, I again started postgres service by firing the same command:
sudo /etc/init.d/postgresql start

And, finally I was able to see the log that was coming during that.
It was as below:
FATAL: data directory "/var/lib/postgresql/9.1/main" has group or world access
DETAIL: Permissions should be u=rwx (0700).

It was a wrong permission issue and I fired this command to solve that:
sudo chmod -R 700 /var/lib/postgresql/9.1/main/

After this, it works fine. I was able to start and stop postgres service as normal. As this issue been solved, I was able to start OpenERP Server successfully.

To solve this, I spent much time on this and that's why, I am posting this in my blog, so one does not need to try and spend much time for this if google shows my blog link to him/her regarding searching of this issue :-)

Hope this will help you.
See you later.

Priyesh Solanki