temporalio / temporal

Temporal service
https://docs.temporal.io
MIT License
11.39k stars 816 forks source link

docker-compose.yml does not start PostgreSQL #2322

Closed Strunevskiy closed 2 years ago

Strunevskiy commented 2 years ago

Expected Behavior

temporal is up and running

Actual Behavior

the error is shown that PostgreSQL is not up

Waiting for PostgreSQL to startup. temporal | + echo 'Waiting for PostgreSQL to startup.' temporal | + sleep 1 temporal | + nc -z postgresql 5432 temporal | nc: bad address 'postgresql' temporal | + echo 'Waiting for PostgreSQL to startup.' temporal | + sleep 1

Steps to Reproduce the Problem

git clone https://github.com/temporalio/docker-compose.git cd docker-compose docker-compose up or docker-compose -f docker-compose-postgres.yml up

Specifications

docker info Server Version: 17.06.0-ce Kernel Version: 3.10.0-1127.el7.x86_64 Operating System: Oracle Linux Server 7.8 OSType: linux Architecture: x86_64 CPUs: 4 Total Memory: 7.522GiB Registry: https://index.docker.io/v1/

Notes: everything works if I run temporal with MySQL.

suparnaj3 commented 2 years ago

@Strunevskiy, I have also come across this issue.

In my case, it was due to an existing temporal-postgresql container in the exited state. When I removed that, it worked perfectly.

Strunevskiy commented 2 years ago

@suparnaj3 thanks. Let me try it.

yiminc commented 2 years ago

@Strunevskiy , could you confirm if your problem is fixed?

Strunevskiy commented 2 years ago

@yiminc the issue is not fixed. Also, I did not notice any container in the exited state as mentioned.

aureeaubert commented 2 years ago

@Strunevskiy I had the same issue but I fixed it by adding the links property in the temporal container definition to allow the containers to communicate with postrgresql,

links:
  - postgresql

Let me know if it fixes your issue

Strunevskiy commented 2 years ago

@aureeaubert thanks, let me try and see.

basharkhatib commented 2 years ago

I had the same issue. @suparnaj3 solution worked for me. Thanks.

apmcodes commented 1 month ago

Was getting the same error, as temporal is trying to connect to default postgresql port 5432, which had a different postgresql running, while temportal-postgresql was configured to run on a non-default port of 5433.

error

temporal | 'Waiting for PostgreSQL to startup.'

docker-compose.yaml

  postgresql:
    container_name: temporal-postgresql
    ports:
      - ${POSTGRES_DEFAULT_PORT}:5432
  ...
  temporal:
    container_name: temporal
    depends_on:
      - postgresql
    environment:
      - DB=postgres12
      - DB_PORT=${POSTGRES_DEFAULT_PORT}

.env

POSTGRES_DEFAULT_PORT=5433