Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created API Keys dissapear after container restart. #84

Open
phisshion opened this issue Feb 4, 2020 · 2 comments
Open

Created API Keys dissapear after container restart. #84

phisshion opened this issue Feb 4, 2020 · 2 comments

Comments

@phisshion
Copy link

Hi I am running the following command to star the container "docker run -d -p 80:80 -v [URL] --restart unless-stopped -v $PWD/cartodb_pgdata:/var/lib/postgresql sverhoeven/cartodb"

The data is persisting after restart but not the API Keys. What is configured wrong here?

@phisshion
Copy link
Author

Bump?

@lsndr
Copy link

lsndr commented Aug 17, 2021

It happens because of 3 reasons:

  1. There is no persistent volume for PostgreSQL
  2. There is no persistent volume for Redis
  3. Lazy-coded startup.sh ¯_(ツ)_/¯

To fix the first and second issues, just add volumes for /var/lib/postgresql and /var/lib/redis dirs. But keep in mind that Redis doesn't make snapshots immediately, so I suggest you to read this: https://redis.io/topics/persistence.

The 3d issue is the most annoying:

30: # Recreate api keys in db and redis, so sql api is authenticated
31: echo 'delete from api_keys' | psql -U postgres -t carto_db_development
32: bundle exec rake carto:api_key:create_default

As you can see, there is code at line 31, that removes all your keys every time cartodb starts. Just remove this line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants