Open naschpitz opened 1 year ago
I think you need to remove all containers, images, networks and volumes...Also run a docker system prune
as well to make sure. The databases (ckandb
and datastore
) are now owned by ckandbuser
. Also make sure you use the latest .env.example
(compose variable) file
The screenshot below is how the database processes in the running db container should look like
@kowh-ai I already did that several times, actually it is a brand new VPS.
I had the same problem. The above mentioned solution by kowh-ai worked for me.
I was dealing with this issue, and was able to resolve it by manually executing the 10_create_ckandb.sh
and the 20_create_datastore.sh
scripts in the db container.
To do so you'll need to enter the db container in interactive mode:
docker exec -it db bash
Then cd
into the docker-entrypoint-initdb.d
directory:
cd docker-entrypoint-initdb.d/
ls
10_create_ckandb.sh 20_create_datastore.sh 30_setup_test_databases.sql
Then execute both scripts:
. 10_create_ckandb.sh
. 20_create_datastore.sh
The needed roles and databases will be created. You should then exit the db container and restart both containers. The ckan container will now be able to connect to the db.
The solution provided by @kowh-ai is most likely more correct, but if nothing else works, this worked for me.
@kowh-ai , @iag-ggos and @Perla-Al-Haddad, thanks for you help, it seems like your solution solved the DB issue, but it still presents another couple of execution errors:
This one in what looks like a 'ckan' script:
ckan | Set up ckan.datapusher.api_token in the CKAN config file
ckan | 2023-08-11 00:41:38,895 INFO [ckan.cli] Using configuration file /srv/app/ckan.ini
ckan | 2023-08-11 00:41:38,896 INFO [ckan.config.environment] Loading static files from public
solr | 2023-08-11 00:41:39.491 INFO (qtp479459041-24) [ x:ckan] o.a.s.c.S.Request webapp=/solr path=/select params={q=*:*&rows=1&wt=json} hits=0 status=0 QTime=1
ckan | 2023-08-11 00:41:39,515 INFO [ckan.config.environment] Loading templates from /srv/app/src/ckan/ckan/templates
solr | 2023-08-11 00:41:39.502 INFO (qtp479459041-25) [ x:ckan] o.a.s.c.S.Request webapp=/solr path=/schema params={wt=schema.xml} status=0 QTime=1
ckan | 2023-08-11 00:41:40,454 WARNI [ckanext.reclineview.plugin] The Recline-based views are deprecated andwill be removed in future versions
solr | 2023-08-11 00:41:40.498 INFO (qtp479459041-20) [ x:ckan] o.a.s.c.S.Request webapp=/solr path=/select params={q=*:*&rows=1&wt=json} hits=0 status=0 QTime=1
solr | 2023-08-11 00:41:40.521 INFO (qtp479459041-24) [ x:ckan] o.a.s.c.S.Request webapp=/solr path=/schema params={wt=schema.xml} status=0 QTime=2
ckan | 2023-08-11 00:41:40,534 INFO [ckan.config.environment] Loading templates from /srv/app/src/ckan/ckan/templates
ckan | 2023-08-11 00:41:40,882 WARNI [ckan.config.middleware.flask_app] Extensions are excluded from CSRF protection! We allow extensions to run without CSRF protection but it will be forced future releases. Read the documentation for more information on how to add CSRF protection to your extension.
ckan | Traceback (most recent call last):
ckan | File "/usr/bin/ckan", line 8, in <module>
ckan | sys.exit(ckan())
ckan | File "/usr/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
ckan | return self.main(*args, **kwargs)
ckan | File "/usr/lib/python3.10/site-packages/click/core.py", line 1055, in main
ckan | rv = self.invoke(ctx)
ckan | File "/usr/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
ckan | return _process_result(sub_ctx.command.invoke(sub_ctx))
ckan | File "/usr/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
ckan | return _process_result(sub_ctx.command.invoke(sub_ctx))
ckan | File "/usr/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
ckan | return _process_result(sub_ctx.command.invoke(sub_ctx))
ckan | File "/usr/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
ckan | return ctx.invoke(self.callback, **ctx.params)
ckan | File "/usr/lib/python3.10/site-packages/click/core.py", line 760, in invoke
ckan | return __callback(*args, **kwargs)
ckan | File "/srv/app/src/ckan/ckan/cli/user.py", line 200, in add_token
ckan | token = logic.get_action(u"api_token_create")(
ckan | File "/srv/app/src/ckan/ckan/logic/__init__.py", line 551, in wrapped
ckan | result = _action(context, data_dict, **kw)
ckan | File "/srv/app/src/ckan/ckan/logic/action/create.py", line 1536, in api_token_create
ckan | token = api_token.encode(data)
ckan | File "/srv/app/src/ckan/ckan/lib/api_token.py", line 104, in encode
ckan | _get_secret(encode=True),
ckan | File "/srv/app/src/ckan/ckan/lib/api_token.py", line 40, in _get_secret
ckan | type_, value = secret.split(u":", 1)
ckan | ValueError: not enough values to unpack (expected 2, got 1)
ckan | /srv/app/start_ckan.sh: Ignoring /docker-entrypoint.d/* (not an sh or py file)
And this one in a 'wsgi.py' script:
ckan | 2023-08-11 00:41:48,533 INFO [ckan.config.environment] Loading templates from /srv/app/src/ckan/ckan/templates
ckan | Traceback (most recent call last):
ckan | File "/srv/app/wsgi.py", line 20, in <module>
ckan | application = make_app(config)
ckan | File "/srv/app/src/ckan/ckan/config/middleware/__init__.py", line 27, in make_app
ckan | load_environment(conf)
ckan | File "/srv/app/src/ckan/ckan/config/environment.py", line 69, in load_environment
ckan | p.load_all()
ckan | File "/srv/app/src/ckan/ckan/plugins/core.py", line 224, in load_all
ckan | load(*plugins)
ckan | File "/srv/app/src/ckan/ckan/plugins/core.py", line 255, in load
ckan | plugins_update()
ckan | File "/srv/app/src/ckan/ckan/plugins/core.py", line 212, in plugins_update
ckan | environment.update_config()
ckan | File "/srv/app/src/ckan/ckan/config/environment.py", line 227, in update_config
ckan | plugin.configure(config)
ckan | File "/srv/app/src/ckan/ckanext/datapusher/plugin.py", line 52, in configure
ckan | raise Exception(
ckan | Exception: Config option `ckan.datapusher.api_token` must be set to use the DataPusher.
ckan | unable to load app 0 (mountpoint='') (callable not found or import error)
ckan | *** no app loaded. going in full dynamic mode ***
And finally:
ckan | --- no python application found, check your startup logs for errors ---
Again, I think you need to remove all containers, images, networks and volumes...Also run a docker system prune
. With a fresh docker CKAN 2.10.1 environment it should work.
@kowh-ai, I swear I ran docker system prune -a
on every new attempt.
Evidence:
Fresh build:
Same error when I run docker compose up
:
Adding one missing puzzle piece: it might be necessary to remove volumes as well. The database is created in a docker volume and if you misconfigured it during your first run, it remains. Named volumes don't seem to be removed even with docker system prune --all --volumes
. Check which ckan volumes still linger...
$ docker volume ls
DRIVER VOLUME NAME
local ckan-docker_ckan_storage
local ckan-docker_pg_data
local ckan-docker_solr_data
... and then remove those. This will obviously destroy all the data within, so first make sure there's nothing worth keeping.
$ docker volume rm ckan-docker_ckan_storage ckan-docker_pg_data ckan-docker_solr_data
ckan-docker_ckan_storage
ckan-docker_pg_data
ckan-docker_solr_data
Then start ckan again with a vanilla .env
and see if it works.
After following the instruction in the Readme, I keep getting
password authentication failed for user "ckandbuser"
and"ckandbuser" role does not exist
.In the end, Docker compose aborts it and it never runs with the message
dependency failed to start: container ckan is unhealthy
.