Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket 5433 Exists But 5432 Demanded By pg_http #3

Closed
jabowery opened this issue May 22, 2015 · 2 comments
Closed

Socket 5433 Exists But 5432 Demanded By pg_http #3

jabowery opened this issue May 22, 2015 · 2 comments

Comments

@jabowery
Copy link

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"?
HTTP/1.0 500 Internal Server Error
Server: pg_http
Content-Type: text/plain

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"?

jabowery@jabowery-H61M-S2-B3:~/dev/aquameta/core/004-aquameta_endpoint/servers/background_worker$ sudo ls -al /var/run/postgresql
total 8
drwxrwsr-x 2 postgres postgres 100 May 21 21:42 .
drwxr-xr-x 32 root root 1020 May 20 14:54 ..
-rw-r--r-- 1 postgres postgres 6 May 21 21:42 9.4-main.pid
srwxrwxrwx 1 postgres postgres 0 May 21 21:42 .s.PGSQL.5433
-rw------- 1 postgres postgres 71 May 21 21:42 .s.PGSQL.5433.lock

jabowery@jabowery-H61M-S2-B3:~/dev/aquameta/core/004-aquameta_endpoint/servers/background_worker$ git rev-parse HEAD
f6b6488

@erichanson
Copy link
Member

Looks like you're running PostgreSQL on port 5433. The PostgreSQL default port is 5432 so maybe you're running two versions of PostgreSQL at the same time?

That's fine, but then you have to change the background worker's connection settings to point to port 5433 instead of 5432 and recompile the background worker.

On this line of pg_http.c:

https://github.com/aquametalabs/aquameta/blob/master/core/004-aquameta_endpoint/servers/background_worker/pg_http.c#L93

Change it to:

conn = PQconnectdb("dbname=aquameta port=5433");

as described here:

http://www.postgresql.org/docs/8.1/static/libpq.html#LIBPQ-CONNECT

@erichanson
Copy link
Member

I updated the README:
5a65927

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants