ckan / ckan-docker

Scripts and images to run CKAN using Docker Compose
104 stars 195 forks source link

Unable to log in with ckan_admin in base mode #167

Closed wrinklenose closed 2 months ago

wrinklenose commented 2 months ago

ckan-docker-ckan-1 | [prerun] Initializing or upgrading db - start ckan-docker-ckan-1 | Command '['ckan', '-c', '/srv/app/ckan.ini', 'db', 'init']' returned non-zero exit status 1. ckan-docker-ckan-1 | b"2024-08-26 09:45:12,188 INFO [ckan.cli] Using configuration file /srv/app/ckan.ini\n2024-08-26 09:45:12,188 INFO [ckan.config.environment] Loading static files from public\n2024-08-26 09:45:12,806 INFO [ckan.config.environment] Loading templates from /srv/app/src/ckan/ckan/templates\n2024-08-26 09:45:13,032 WARNI [ckan.config.middleware.flask_app] Extensions are excluded from CSRF protection! We allow extensions to run without CS RF protection but it will be forced future releases. Read the documentation for more information on how to add CSRF protection to your extension.\n2024-08-26 09:45:14,943 INFO [ckan.model] CKAN database version upgraded: base -> 4a5e3465beb6 (head)\nPlugin 'datapusher' cannot be loaded.\nAborted!\n" ckan-docker-ckan-1 | Traceback (most recent call last): ckan-docker-ckan-1 | File "/srv/app/prerun.py", line 214, in ckan-docker-ckan-1 | init_db() ckan-docker-ckan-1 | File "/srv/app/prerun.py", line 112, in init_db ckan-docker-ckan-1 | raise e ckan-docker-ckan-1 | File "/srv/app/prerun.py", line 102, in init_db ckan-docker-ckan-1 | subprocess.check_output(db_command, stderr=subprocess.STDOUT) ckan-docker-ckan-1 | File "/usr/local/lib/python3.10/subprocess.py", line 421, in check_output ckan-docker-ckan-1 | return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, ckan-docker-ckan-1 | File "/usr/local/lib/python3.10/subprocess.py", line 526, in run ckan-docker-ckan-1 | raise CalledProcessError(retcode, process.args, ckan-docker-ckan-1 | subprocess.CalledProcessError: Command '['ckan', '-c', '/srv/app/ckan.ini', 'db', 'init']' returned non-zero exit status 1. ckan-docker-ckan-1 | /srv/app/start_ckan.sh: Running init file /docker-entrypoint.d/01_setup_datapusher.sh ckan-docker-ckan-1 | /docker-entrypoint.d/01_setup_datapusher.sh: line 2: $'\r': command not found ckan-docker-ckan-1 | /docker-entrypoint.d/01_setup_datapusher.sh: line 13: syntax error: unexpected end of file ckan-docker-ckan-1 | /srv/app/start_ckan.sh: Ignoring /docker-entrypoint.d/README.md (not an sh or py file) ckan-docker-ckan-1 | open("./http_plugin.so"): No such file or directory [core/utils.c line 3709] ckan-docker-ckan-1 | !!! UNABLE to load uWSGI plugin: ./http_plugin.so: cannot open shared object file: No such file or directory !!! ckan-docker-ckan-1 | open("./python_plugin.so"): No such file or directory [core/utils.c line 3709] ckan-docker-ckan-1 | !!! UNABLE to load uWSGI plugin: ./python_plugin.so: cannot open shared object file: No such file or directory !!! ckan-docker-ckan-1 | Starting uWSGI 2.0.26 (64bit) on [Mon Aug 26 09:45:15 2024] ckan-docker-ckan-1 | compiled with version: 12.2.0 on 22 August 2024 12:27:29 ckan-docker-ckan-1 | os: Linux-5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 ckan-docker-ckan-1 | nodename: b87c6b9c449d ckan-docker-ckan-1 | machine: x86_64 ckan-docker-ckan-1 | clock source: unix ckan-docker-ckan-1 | detected number of CPU cores: 8 ckan-docker-ckan-1 | current working directory: /srv/app ckan-docker-ckan-1 | detected binary path: /usr/local/bin/uwsgi ckan-docker-ckan-1 | !!! no internal routing support, rebuild with pcre support !!! ckan-docker-ckan-1 | uWSGI running as root, you can use --uid/--gid/--chroot options ckan-docker-ckan-1 | setgid() to 92 ckan-docker-ckan-1 | setuid() to 92 ckan-docker-ckan-1 | your memory page size is 4096 bytes ckan-docker-ckan-1 | WARNING: you have enabled harakiri without post buffering. Slow upload could be rejected on post-unbuffered webservers ckan-docker-ckan-1 | detected max file descriptor number: 1048576 ckan-docker-ckan-1 | lock engine: pthread robust mutexes ckan-docker-ckan-1 | thunder lock: disabled (you can enable it with --thunder-lock) ckan-docker-ckan-1 | uWSGI http bound on [::]:5000 fd 3 ckan-docker-ckan-1 | uwsgi socket 0 bound to UNIX address /tmp/uwsgi.sock fd 6 ckan-docker-ckan-1 | Python version: 3.10.14 (main, Aug 13 2024, 01:17:25) [GCC 12.2.0] ckan-docker-ckan-1 | Python main interpreter initialized at 0x557beec34460 ckan-docker-ckan-1 | python threads support enabled ckan-docker-ckan-1 | your server socket listen backlog is limited to 100 connections ckan-docker-ckan-1 | your mercy for graceful operations on workers is 60 seconds ckan-docker-ckan-1 | mapped 304776 bytes (297 KB) for 2 cores ckan-docker-ckan-1 | Operational MODE: preforking ckan-docker-ckan-1 | uWSGI is running in multiple interpreter mode ckan-docker-ckan-1 | spawned uWSGI master process (pid: 32) ckan-docker-ckan-1 | spawned uWSGI worker 1 (pid: 33, cores: 1) ckan-docker-ckan-1 | spawned uWSGI worker 2 (pid: 34, cores: 1) ckan-docker-ckan-1 | spawned uWSGI http 1 (pid: 35) ckan-docker-ckan-1 | 2024-08-26 09:45:15,591 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message. ckan-docker-ckan-1 | 2024-08-26 09:45:15,592 WARN No file matches via include "/etc/supervisord.d/*.conf"

Workaround was to create a sysadmin user manually via

docker exec -it ckan-docker-ckan-1 ckan -c ckan.ini user add admin email=admin@localhost && docker exec -it ckan-docker-ckan-1 ckan -c ckan.ini sysadmin add admin && docker exec -it ckan-docker-ckan-1 mkdir /var/lib/ckan/storage/uploads/group

grimbough commented 2 months ago

This caught me out too. Thanks for the helpful workaround to get a test version running locally.

amercader commented 2 months ago

The issue should now be fixed in the upstream image. So to get it locally, pull and re-build the images:

docker pull ckan/ckan-base:2.11.0
docker compose build ckan

If using the dev images:

docker pull ckan/ckan-dev:2.11.0
docker compose -f docker-compose.dev.yml build ckan-dev

You'll need to stop/remove the current ckan / ckan-dev containers to use the new ones with the latest image.

wrinklenose commented 2 months ago

I can confirm, that the basic setup works now again. Therefore I close this issue as resolved.

I've got some datapusher issues - but I think they have different origins... maybe caused by the WSL-environment...