plane icon indicating copy to clipboard operation
plane copied to clipboard

[bug]: DATABASE_URL path error on latest makeplane/plane-backend docker hub

Open dkotama opened this issue 2 years ago • 5 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current behavior

I follow the tutorial on https://docs.plane.so/self-hosting

setting up the .env file on root and run,

docker compose -f docker-compose-hub.yml up

the container api keep returning error :

OperationalError: connection failed: FATAL:  database "plane_prod:[pass]@[ip]:22846/plane_prod}" does not exist

Surprised by this checked my connection using DB client, and ok, this is my .env file

# Database Settings
PGUSER="postgres"
PGPASSWORD=[pass]
PGHOST=[host]
PGDATABASE="plane_prod"
DATABASE_URL=postgresql://${PGUSER}:${PGPASSWORD}@${PGHOST}/${PGDATABASE}

I tried to build it manually using :

services:
  api:
    container_name: api
    build:
      context: ./apiserver
      dockerfile: Dockerfile.api
      args:
        DOCKER_BUILDKIT: 1
    restart: always
    command: ./bin/takeoff
    env_file:
      - .env

No error

Conclusion Seems there was error on the latest official images

Steps to reproduce

  1. clone repo
  2. set the postgres env to be remote env
  3. run the docker compose -f docker-compose-hub.yml up to get the official images

Browser

Google Chrome

Version

Self-hosted

dkotama avatar Nov 20 '23 12:11 dkotama

Hi @dkotama this error is caused due to the database not available in the postgres container can you check the variable POSTGRES_DB for the plane-db service in docker-compose-hub.yml.

pablohashescobar avatar Nov 20 '23 18:11 pablohashescobar

Hi @dkotama this error is caused due to the database not available in the postgres container can you check the variable POSTGRES_DB for the plane-db service in docker-compose-hub.yml.

Since im using my external db for this, I think the plane db setting will not be used, correct ?

also, im using the unchanged plane-db setting from the master branch image

dkotama avatar Nov 21 '23 01:11 dkotama

Hi all, I can confirm this is certainly an issue...

beatworker | [2023-12-05 05:34:24,431: WARNING/MainProcess] connection failed: FATAL: database "plane:plane@plane-db/plane}" does not exist

Of interest is that the error from each container shows the same error, and specifically, it shows that closing brace in after the database name.

I don't know where to dig around trying to determine where it comes from, however, changing environments to use static values wherever I could manage it didn't seem to help in the slightest.

Starting plane-db on it's own obviously works so I can only assume it must be running but due to the incorrect name, all of the other containers are failing to see that particular database.

This is using a brand new installation, following the instructions from the website located at.. https://docs.plane.so/self-hosting

Hopefully this helps somebody work out the issue.

hrabbit avatar Dec 05 '23 05:12 hrabbit

Running docker compose docker-compose-hub.yml config would show you: DATABASE_URL: postgresql://plane:plane@plane-db/plane:plane@plane-db/plane}

Same goes for the REDIS_URL it shows: REDIS_URL: redis://plane-redis:6379/:6379/}

I am not sure where the issue might come from, maybe parsing, but you can remove the default values of those two keys from the docker-compose-hub.yml file as a temporary fix.

riaddaima avatar Dec 09 '23 06:12 riaddaima

Hi, can you check this issue in the latest release. Let us know if the issue still persists. Refer here for upgrading https://docs.plane.so/self-hosting/docker-compose

pablohashescobar avatar Dec 15 '23 05:12 pablohashescobar

image I think I have the same issue when I try to run Plane on my test computer with centos. I followed the instruction to use the setup.sh to install and start the program, then I got the database does not exist error.

wangmengmike avatar Jan 04 '24 01:01 wangmengmike

Since im using my external db for this, I think the plane db setting will not be used, correct ?

image Here's the log in db container

wangmengmike avatar Jan 04 '24 01:01 wangmengmike

@wangmengmike As @smcpeck mentioned in his comment on #1019, setting the DATABASE_URL environment variable in the docker-compose.yml file to the following (removing the check/override of the default) did the trick to get rid of the error.

 DATABASE_URL=postgresql://plane:plane@plane-db/plane

markcameron avatar Jan 19 '24 10:01 markcameron

This issue has already been fixed. Please upgrade to the latest version.

srinivaspendem avatar May 17 '24 07:05 srinivaspendem