Database configuration in `divio app setup` not working correctly

Open
#243 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
docker, postgresql, python
Domain
cli, databases

Research direction

Reproduce the failure with divio app setup <my-project>, then inspect the Docker container with docker ps and docker logs as described. Trace the setup entry point and database configuration path; done means the local PostgreSQL container starts successfully and the setup command completes without the password error.

Written by the indexing model from the issue text.

Description

When I run divio app setup <my-project> I get this output:

creating new database container                                                                                                                                                                                                         
 ===> Pulling database from <my-project> test environment                                                                                                                                                                           
 ---> Preparing download  [99s]                                                                                                                                                                                                         
 ---> Writing temp file: /home/<user>/<my-project>/.divio/data.tar.gz                                                                                                                                                            
 ---> Downloading database [4s]                                                                                                                                                                                                         
 ---> Starting local database server                                                                                                                                                                                                    
[+] Running 1/1                                                                                                                                                                                                                         
 ⠿ Container <my-project>-db-1  Started                                                                                                                                                                                        0.3s 
      [0s]                                                                                                                                                                                                                              
 ---> Waiting for local database serverCouldn't connect to database container. Database server may not have started. 

Using docker ps and docker logs I get:

Error: Database is uninitialized and superuser password is not specified.                                                                                                                                                               
       You must specify POSTGRES_PASSWORD to a non-empty value for the                                                                                                                                                                  
       superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".                                                                                                                                                         
                                                                                                                                                                                                                                        
       You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all                                                                                                                                                                  
       connections without a password. This is *not* recommended.                                                                                                                                                                       
                                                                                                                                                                                                                                        
       See PostgreSQL documentation about "trust":                                                                                                                                                                                      
       https://www.postgresql.org/docs/current/auth-trust.html 

I'm not sure why the DB is not getting set up correctly here?

Dominant language
Python
Stars
23
Forks
19
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from divio/divio-cli

All issues in divio/divio-cli

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.