Giter VIP home page Giter VIP logo

Comments (11)

bmarsh9 avatar bmarsh9 commented on June 18, 2024

hmm could you describe the behavior a bit more and share any error logs? The gapps-worker will check if it can query the database models before it starts. If it can't successfully query the model, it will exit (and the container will restart).

from gapps.

ArjenR avatar ArjenR commented on June 18, 2024

On the road at the moment, so I cannot provide you logs. But the gapps-worker would crash with an error about missing database and the progres container would show the error like "Database does not exist". The fact that it showed the username and not the database name is quite a tell tale

from gapps.

bmarsh9 avatar bmarsh9 commented on June 18, 2024

The username and database name are the same for the default set up (db1). The "crash" is really just a restart of the container. A better implementation would be a more robust health check.. but the gapps-worker should successfully start after (at worst) the 2nd restart. If this is not the case, please let me know

from gapps.

ArjenR avatar ArjenR commented on June 18, 2024

Yes, it crashes continuously. And I changed all information for the database to unique values (as a matter of principle.)

from gapps.

bmarsh9 avatar bmarsh9 commented on June 18, 2024

Ok then its likely a authentication issue. If you paste any error logs I can probably help debug

from gapps.

bmarsh9 avatar bmarsh9 commented on June 18, 2024

Also worth noting that currently (this will change soon) the gapps-worker container doesn't actually do anything.

from gapps.

ArjenR avatar ArjenR commented on June 18, 2024

Here is my test.

Clean test environment. Stock docker-compose.yml

$ cat .env 
POSTGRES_USER=pguser
POSTGRES_PASSWORD=pgpassword
POSTGRES_DB=gappsdb

$ export SETUP_DB=yes; docker-compose up

full log attached. Around line 359 the database was created
gapps | [INFO] Database has been initialized.

But the issue is already clear beforehand:
postgres | 2023-03-04 13:25:50.733 UTC [64] FATAL: database "pguser" does not exist
gapps-worker | psycopg2.OperationalError: FATAL: database "pguser" does not exist

testfordbconnectionerror.txt

update: line number was missing

from gapps.

bmarsh9 avatar bmarsh9 commented on June 18, 2024

Are those env variables set on all the containers? If you want to change the default connection settings, you need to change the env variables for each container (there are 3 containers) - specifically these 4 env variables. Easiest way is just updating editing the docker-compose.yml file

SQLALCHEMY_DATABASE_URI
POSTGRES_USER
POSTGRES_PASSWORD
POSTGRES_DB

from gapps.

ArjenR avatar ArjenR commented on June 18, 2024

Hi,

Easiest way to work with environment variables like you have defined them in the docker-compose.yml is to place them in a .env file in the same place as the docker-compose.yml.
The docker-compose will read them and use those. This way you can place the .env in your git ignore and then there is less chance of accidentally publishing them online / committing them in a repository.

It is also out of a security pov why I never go with the default values...

from gapps.

bmarsh9 avatar bmarsh9 commented on June 18, 2024

Im fully aware of what a env file is. This is part of debugging. We aren't talking about a production deployment. This is why I'm recommending to share/update the docker-compose file so I know what specific files you are working with.

from gapps.

bmarsh9 avatar bmarsh9 commented on June 18, 2024

If this is still an issue - please let me know. Closing for now

from gapps.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.