solgenomics / breedbase_dockerfile

The Dockerfiles for breeDBase
MIT License
8 stars 8 forks source link

breedbase_db | 2023-05-17 14:26:24.380 UTC [65] FATAL: database "breedbase" does not exist #44

Closed ChenDepp closed 1 year ago

ChenDepp commented 1 year ago

hi @lukasmueller when i running the command "docker-compose -f docker-compose.yml -f production.yml up" reprot the error as below "breedbase_db | 2023-05-17 14:26:24.380 UTC [65] FATAL: database "breedbase" does not exist".

 i am deploy the web command as below:
    git clone https://github.com/solgenomics/breedbase_dockerfile
      cd breedbase_dockerfile
    touch .env
 then add 
  PGDATABASE=breedbase
    PGHOST=breedbase_db
  PGPASSWORD=postgres
   PGUSER=postgres  
 to .env 

 source .env 
 then when i running docker-compose -f docker-compose.yml -f production.yml up 
    it report error " database "breedbase" does not exist"."

can you tell me how to solve it? thanks

lukasmueller commented 1 year ago

can you send a complete log of what is happening? Is the breedbase_db docker being correctly created? Are all the other files the default?

lukasmueller commented 1 year ago

if everything else fails, connect to the docker: docker exec -it breedbase_web bash

enter the database: psql -h breedbase_db -U postgres

in the database, add the web_usr user and create the database: create role web_usr with password 'postgres'; alter role web_usr with login; create database breedbase; \q

then, load the database with the db dump: cat t/data/fixture/empty_fixture.sql | psql -h breedbase_db -U postgres breedbase

run the dbpatches: cd db; perl run_all_patches.pl -u postgres -p postgres -h breedbase_db -d breedbase -e admin -s 80

exit

Now it should work