Похожие чаты

This is my configues: https://gist.github.com/farzinh/b50312ca0523fb37ec846251a7671cb3 and here is docker-compose logs that shows

error:

....
django/db/backends/postgresql/base.py", line 187, in get_new_connection
connection = Database.connect(**conn_params)
File "/usr/local/lib/python3.9/site-packages/psycopg2/__init__.py", line 127, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: could not connect to server: Host is unreachable
Is the server running on host "db" (192.168.96.2) and accepting
TCP/IP connections on port 5432?

I checked every and each solution that I could found, but none of them works and I still have this error

7 ответов

8 просмотров

you're not exposing the postgres port

Farzin- Автор вопроса
Sathya Bhat
you're not exposing the postgres port

I had: ports: - "5432:5432" but it did't worked

Farzin- Автор вопроса
Sathya Bhat
you're not exposing the postgres port

I just exposed ports like this: ports: - "5432:5432" still same problem

Farzin
I just exposed ports like this: ports: - "5432:...

what returns on sudo service postgresql status sudo lsof -nP | grep LISTEN ? ——— have you run ? docker-compose up -d db docker-compose up -d web ——— Be aware, sometimes it's requires to set HOST as 127.0.0.1 in settings.py instead of "db": DATABASES = { 'default': { (...) 'HOST': '127.0.0.1', (...) } }

Farzin
I had: ports: - "5432:5432" but it did't worke...

docker-compose.yml version: '3.8' services: db: image: postgres:12.0-alpine ports: - "5432" environment: - POSTGRES_DB=something - POSTGRES_USER=user - POSTGRES_PASSWORD=pass web: build: . command: python manage.py runserver 0.0.0.0:8000 volumes: - .:/code ports: - "8000:8000" depends_on: - db

Farzin- Автор вопроса
arthur wayne
what returns on sudo service postgresql status sud...

sudo service postgresql status Redirecting to /bin/systemctl status postgresql.service Unit postgresql.service could not be found. ———- sudo lsof -nP | grep LISTEN docker-pr 654554 root 4u IPv6 7621032 0t0 TCP *:5432 (LISTEN) docker-pr 654554 654555 docker-pr root 4u IPv6 7621032 0t0 TCP *:5432 (LISTEN) docker-pr 654554 654556 docker-pr root 4u IPv6 7621032 0t0 TCP *:5432 (LISTEN) docker-pr 654554 654557 docker-pr root 4u IPv6 7621032 0t0 TCP *:5432 (LISTEN) docker-pr 654554 654558 docker-pr root 4u IPv6 7621032 0t0 TCP *:5432 (LISTEN) ———- docker-compose up -d db db run without any problem ———- docker-compose up -d api it runs and then stop ———- I've changed "db" to 127.0.0.1, and same error shows up again

Farzin- Автор вопроса
arthur wayne
docker-compose.yml version: '3.8' services: db...

I've changed docker compose to this, same error again

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта