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

Error "Is the server running locally and accepting connection" #76

Open
rohitguptarspl opened this issue Jul 22, 2019 · 6 comments
Open

Comments

@rohitguptarspl
Copy link

rohitguptarspl commented Jul 22, 2019

Hi,
I am just trying to setup response app on Local Laptop. Getting these error logs.

[INFO] Waiting for DB
response    | [INFO] Migrating database
postgres    | 2019-07-22 11:29:09.675 UTC [29] LOG:  incomplete startup packet
response    | Traceback (most recent call last):
response    |   File "/usr/local/lib/python3.7/site-packages/django/db/backends/base/base.py", line 217, in ensure_connection
response    |     self.connect()
response    |   File "/usr/local/lib/python3.7/site-packages/django/db/backends/base/base.py", line 195, in connect
response    |     self.connection = self.get_new_connection(conn_params)
response    |   File "/usr/local/lib/python3.7/site-packages/django/db/backends/postgresql/base.py", line 178, in get_new_connection
response    |     connection = Database.connect(**conn_params)
response    |   File "/usr/local/lib/python3.7/site-packages/psycopg2/__init__.py", line 126, in connect
response    |     conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
response    | psycopg2.OperationalError: could not connect to server: No such file or directory
response    | 	Is the server running locally and accepting
response    | 	connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
@milesbxf
Copy link
Contributor

Hmm, looks like Response can't connect to the Postgres container. Can you post the output of docker-compose logs postgres please?

@rohitguptarspl
Copy link
Author

rohitguptarspl commented Jul 23, 2019

Hi,
Here is the logs :

-> docker-compose logs db
Attaching to postgres
postgres    | 2019-07-23 16:35:16.048 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
postgres    | 2019-07-23 16:35:16.048 UTC [1] LOG:  listening on IPv6 address "::", port 5432
postgres    | 2019-07-23 16:35:16.052 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgres    | 2019-07-23 16:35:16.110 UTC [22] LOG:  database system was shut down at 2019-07-22 16:34:49 UTC
postgres    | 2019-07-23 16:35:16.152 UTC [1] LOG:  database system is ready to accept connections
postgres    | 2019-07-23 16:35:19.701 UTC [29] LOG:  incomplete startup packet

I thing application trying to connect to the Postgres on local Laptop, but Postgres running on container.

@milesbxf
Copy link
Contributor

Sorry for the late response to this - @rohitguptarspl did you get this sorted?

@beevee
Copy link

beevee commented Aug 28, 2019

I'm getting the same error, too.

@beevee
Copy link

beevee commented Aug 28, 2019

I guess, the problem is that current env.example includes production settings file:

DJANGO_SETTINGS_MODULE=demo.settings.prod

...which leaves DATABASES not configured properly.

Switching to dev settings fixes this problem. But creates another: all links to incidents point to localhost instead of randomly generated ngrok url.

@AlexSzlavik
Copy link

Just change the example env to point to demo.settings.dev

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

4 participants