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
Cannot initialize database in docker container. #4839
Comments
@dmcfarland930 if you are using docker compose, then there is no need to run paster on the container itself. There are several docker volumes created where data is persisted as part of the docker-compose.yml, those are for the database, SOLR indexes, and CKAN filestore: pg_data, solr_data and ckan_storage respectively. Startup docker-compose and then stop all containers, run a backup on the docker volumes and then start things up again. |
Is this specific to docker? These commands should work the same with a source install. Can you share any more errors or logs from the database? |
@mbocevski Removing the contents of the pg data volume and running docker compose has reinitialized the database. @wardi I'm not sure if it's specific to docker. I should note I have two CKAN instances, one built from the docker install found in the docs, and another docker instance that I have uniquely made so that I can run CKAN with apache. My plan is to create a dump of the fresh database and keep it as a backup to ingest into my second postgres container when needed. Here's a relationship error found, likely caused by having a wiped database when using the db clean command: |
Iv'e had the same problem (psycopg2.ProgrammingError relation "group" does not exist) with a source install of CKAN 2.8.4 on Ubuntu 18.04 (bionic) only...20.04 (focal) and 16.04 (xenial) were OK...Luckily I could run a "paster db init -c /path/to/production.ini" to resolve |
I'm in need of a fresh database schema for CKAN 2.82, I'd also like to have the clean schema as a backup to use as a clean slate for testing. However, when I follow the instructions to clean and init the database, it seems as thought the new schema isn't created as I was expecting.
CKAN Version if known (or site URL)
2.82
Please describe the expected behaviour
The database is not re-initializing despite seeing the "Initialising DB: SUCCESS" message.
Please describe the actual behaviour
SQL Alchemy errors occur due to no relations existing in the cleaned database.
What steps can be taken to reproduce the issue?
Start Docker containers.
Enter docker container using "docker exec -ti [container name or id] bash"
Start virtual environment inside container.
In the virtual environment run "paster db clean -c [path to production.ini]"
Run "paster db init -c [path to production.ini]"
Experience server errors when exploring your ckan instance.
The text was updated successfully, but these errors were encountered: