Closed ajs6f closed 10 months ago
I encountered this issue on Windows.
Are you on Windows?
If so, there might be an issue with CRLF.
On OSX (Intel), the datapusher api token is auto created but for windows, I had to add it to the .env file via one that was generated by the one on Mac:
CKAN__DATAPUSHER__API_TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI4eURKNnlScjRCaWdGMEpKSWN0LVdncm9tZTZhajZRd01Vc0VreTZpQ01NIiwiaWF0IjoxNzAxMTIzNzE3fQ.sjOgu7hN9x8bBytB6yDIXpit4ud2ra9IpicPd3grPnM
Not sure why yet, but it allowed me to bring up all the svs.
No, this is RHEL, but thank you and I will check to see whether a manually-generated token helps.
I note that according to the following logs from the db
container, the necessary schema should be in place and there seems to be no reason the query errors should be occurring...
ckan-docker-db-1 |
ckan-docker-db-1 | /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/10_create_ckandb.sh
ckan-docker-db-1 | CREATE ROLE
ckan-docker-db-1 | CREATE DATABASE
ckan-docker-db-1 |
ckan-docker-db-1 | /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/20_create_datastore.sh
ckan-docker-db-1 | CREATE ROLE
ckan-docker-db-1 | CREATE DATABASE
ckan-docker-db-1 |
ckan-docker-db-1 | /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/30_setup_test_databases.sh
ckan-docker-db-1 | CREATE DATABASE
ckan-docker-db-1 | CREATE DATABASE
ckan-docker-db-1 |
Trying to chase this out and following the tip @iperezx just gave me, I find in the logs:
ckan-docker-ckan-dev-1 | /srv/app/start_ckan_development.sh: Running init file /docker-entrypoint.d/01_setup_datapusher.sh
ckan-docker-ckan-dev-1 | sh: image_view: unknown operand
ckan-docker-ckan-dev-1 | Not configuring DataPusher
and in that script I see:
[sorokaa@dt-vmckantest ckan-docker]$ more ckan/docker-entrypoint.d/01_setup_datapusher.sh
#!/bin/bash
if [[ $CKAN__PLUGINS == *"datapusher"* ]]; then
# Datapusher settings have been configured in the .env file
# Set API token if necessary
if [ -z "$CKAN__DATAPUSHER__API_TOKEN" ] ; then
echo "Set up ckan.datapusher.api_token in the CKAN config file"
ckan config-tool $CKAN_INI "ckan.datapusher.api_token=$(ckan -c $CKAN_INI user token add ckan_admin datapusher | tail -n 1 | tr -d '\t')"
fi
else
echo "Not configuring DataPusher"
fi
but
[sorokaa@dt-vmckantest ckan-docker]$ docker compose config | grep PLUGINS
CKAN__PLUGINS: envvars image_view text_view recline_view datastore datapusher
and the Docker log:
ckan-docker-ckan-dev-1 | Loading the following plugins: envvars image_view text_view recline_view datastore datapusher
clearly shows that the appropriate env var contains the appropriate values. It's also not clear to me how image_view
is getting interpreted as an operand by the shell... Has anyone seen anything like this?
I've changed the test in the 01_setup_datapusher.sh
to [[ $CKAN__PLUGINS =~ "datapusher" ]]
and now I get a similar result to that described in https://github.com/ckan/ckan-docker/issues/101. (Along with the db
-related errors and so forth reported above.) It does seem that there is some kind of weakness in the code that sets up the connection between CKAN and the DataPusher?
Getting same issue with Ubuntu 22.04.2 LTS
Now getting it on OSX(Intel).
Hi @iperezx and @GAO8A,
Do you see the same
ckan-docker-ckan-dev-1 | /srv/app/start_ckan_development.sh: Running init file /docker-entrypoint.d/01_setup_datapusher.sh
ckan-docker-ckan-dev-1 | sh: image_view: unknown operand
ckan-docker-ckan-dev-1 | Not configuring DataPusher
section in the Docker logs and can you verify that the CKAN__PLUGINS
env var is set as we would expect?
Yes. Same .env as what I was using before.
It seems like Datapusher is not ready when ckan-dev is running the default entrypoint (https://github.com/ckan/ckan-docker-base/blob/main/ckan-2.10/dev/Dockerfile#L21). If I override the entrypoint in the docker-compose file:
ckan-dev:
build:
context: ckan/
dockerfile: Dockerfile.dev
args:
- TZ=${TZ}
env_file:
- .env
depends_on:
db:
condition: service_healthy
solr:
condition: service_healthy
redis:
condition: service_healthy
ports:
- "0.0.0.0:${CKAN_PORT_HOST}:${CKAN_PORT}"
volumes:
- ckan_storage:/var/lib/ckan
- ./src:/srv/app/src_extensions
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:5000"]
entrypoint: ["tail", "-f", "/dev/null"]
Then attached to the running container:
docker exec -it ckan-docker-ckan-dev-1 bash
Wait until ckan-docker-datapusher-1 outputs in the logs
ckan-docker-datapusher-1 | [pid: 9|app: 0|req: 1/1] 127.0.0.1 () {28 vars in 293 bytes} [Tue Nov 28 22:49:06 2023] GET / => generated 90 bytes in 3 msecs (HTTP/1.1 200) 2 headers in 71 bytes (1 switches on core 0)
Then run the default entrypoint script /srv/app/start_ckan_development.sh
It runs as expected.
Trying to figure out why its an issue with the new images. Waiting on datapusher to be in a healthy state (via docker-compose depends_on) doesnt work.
I can confirm that @iperezx's commit in ckan/ckan-docker-base#38 enables the CKAN container to start for me.
An alternative to not build from ckan-docker-base, one can also change the entrypoint to the following for ckan-dev:
entrypoint: ["bash","/srv/app/start_ckan_development.sh"]
@iperezx Got my dev environment to work as well, Thanks!
Trying to start the development mode with
docker-compose.dev.yml
I get several seemingly-unrelated errors (and no startup). I include the full log run fromdocker compose up
as a gist, but I extract below what seem to be some of the relevant parts. The CKAN container just keeps trying to restart, only to run into the same problems. The backend containers for Redis, Solr, PostgreSQL and the DataPusher come up healthy.I hope there is an obvious mistake I am making?
I see
sh: image_view: unknown operand
reported over and over.This db error occurs over and over:
This DataPusher-related error also occurs several times:
and this error, which seems to be connected with db or maybe DataPusher access?