Giter VIP home page Giter VIP logo

docker-ckan's Introduction

Docker Compose setup for CKAN [Not Maintained]

⚠️ Not maintained ⚠️
These images are deprecated and are no longer maintained. Please use the official CKAN Docker images instead:
https://github.com/ckan/ckan-docker
For more information see: #129

Overview

This is a set of Docker images and configuration files to run a CKAN site.

CKAN version Docker tag production Docker tag development Notes
2.8 openknowledge/ckan-base:2.8, openknowledge/ckan-base:2.8.12 openknowledge/ckan-dev:2.8, openknowledge/ckan-dev:2.8.12
2.9 openknowledge/ckan-base:2.9, openknowledge/ckan-base:2.9.9 openknowledge/ckan-dev:2.9, openknowledge/ckan-dev:2.9.9 If you need Python 2 images use the 2.9-py2 tags (not recommended)
2.10b openknowledge/ckan-base:2.10, openknowledge/ckan-base:2.10.1 openknowledge/ckan-dev:2.10, openknowledge/ckan-dev:2.10.1 CKAN 2.10 is currently in beta
master openknowledge/ckan-base:master openknowledge/ckan-dev:master The master images are updated daily so they might be slightly out of date

It includes the following images, all based on Alpine Linux:

  • CKAN: modified from keitaro/ckan (see CKAN Images) for more details). File uploads are stored in a named volume.
  • DataPusher: modified from keitaro/datapusher
  • PostgreSQL: Official PostgreSQL image. Database files are stored in a named volume.
  • Solr: CKAN's pre-configured Solr image. Index data is stored in a named volume.
  • Redis: standard Redis image

The site is configured via env vars (the base CKAN image loads ckanext-envvars), that you can set in the .env file.

Quick start

Copy the included .env.example and rename it to .env to modify it depending on your own needs.

Using the default values on the .env.example file will get you a working CKAN instance. There is a sysadmin user created by default with the values defined in CKAN_SYSADMIN_NAME and CKAN_SYSADMIN_PASSWORD(ckan_admin and test1234 by default). I shouldn't be telling you this but obviously don't run any public CKAN instance with the default settings. Make sure to set up proper passwords and secret keys in your .env file.

To build the images:

docker-compose build

To start the containers:

docker-compose up

Development mode

To develop local extensions use the docker-compose.dev.yml file:

To build the images:

docker-compose -f docker-compose.dev.yml build

To start the containers:

docker-compose -f docker-compose.dev.yml up

See CKAN Images for more details of what happens when using development mode.

Create an extension

You can use the paster template in much the same way as a source install, only executing the command inside the CKAN container and setting the mounted src/ folder as output:

docker-compose -f docker-compose.dev.yml exec ckan-dev /bin/bash -c "paster --plugin=ckan create -t ckanext ckanext-myext -o /srv/app/src_extensions"

From CKAN 2.9 onwards, the paster command used for common CKAN administration tasks has been replaced with the ckan command. You can create an extension as the previous version by executing the command inside the CKAN container and setting the mounted src/ folder as output:

docker-compose -f docker-compose.dev.yml exec ckan-dev /bin/bash -c "ckan generate extension --output-dir /srv/app/src_extensions"

The new extension will be created in the src/ folder. You might need to change the owner of its folder to have the appropiate permissions.

Running the debugger (pdb / ipdb)

To run a container and be able to add a breakpoint with pdb or ipdb, run the ckan-dev container with the --service-ports option:

docker-compose -f docker-compose.dev.yml run --service-ports ckan-dev

This will start a new container, displaying the standard output in your terminal. If you add a breakpoint in a source file in the src folder (import pdb; pdb.set_trace()) you will be able to inspect it in this terminal next time the code is executed.

CKAN images

    +-------------------------+                +----------+
    |                         |                |          |
    | openknowledge/ckan-base +---------------->   ckan   | (production)
    |                         |                |          |
    +-----------+-------------+                +----------+
                |
                |
    +-----------v------------+                 +----------+
    |                        |                 |          |
    | openknowledge/ckan-dev +----------------->   ckan   | (development)
    |                        |                 |          |
    +------------------------+                 +----------+


The Docker images used to build your CKAN project are located in the ckan/ folder. There are two Docker files:

  • Dockerfile: this is based on openknowledge/ckan-base (with the Dockerfile on the /ckan-base/<version> folder), an image with CKAN with all its dependencies, properly configured and running on uWSGI (production setup)

  • Dockerfile.dev: this is based on openknowledge/ckan-dev (with the Dockerfile on the /ckan-dev/<version> folder), wich extends openknowledge/ckan-base to include:

    • Any extension cloned on the src folder will be installed in the CKAN container when booting up Docker Compose (docker-compose up). This includes installing any requirements listed in a requirements.txt (or pip-requirements.txt) file and running python setup.py develop.
    • The CKAN image used will development requirements needed to run the tests .
    • CKAN will be started running on the paster development server, with the --reload option to watch changes in the extension files.
    • Make sure to add the local plugins to the CKAN__PLUGINS env var in the .env file.

From these two base images you can build your own customized image tailored to your project, installing any extensions and extra requirements needed.

Extending the base images

To perform extra initialization steps you can add scripts to your custom images and copy them to the /docker-entrypoint.d folder (The folder should be created for you when you build the image). Any *.sh and *.py file in that folder will be executed just after the main initialization script (prerun.py) is executed and just before the web server and supervisor processes are started.

For instance, consider the following custom image:

ckan
├── docker-entrypoint.d
│   └── setup_validation.sh
├── Dockerfile
└── Dockerfile.dev

We want to install an extension like ckanext-validation that needs to create database tables on startup time. We create a setup_validation.sh script in a docker-entrypoint.d folder with the necessary commands:

#!/bin/bash

# Create DB tables if not there
paster --plugin=ckanext-validation validation init-db -c $CKAN_INI

And then in our Dockerfile we install the extension and copy the initialization scripts:

FROM openknowledge/ckan-dev:2.9

RUN pip install -e git+https://github.com/frictionlessdata/ckanext-validation.git#egg=ckanext-validation && \
    pip install -r https://raw.githubusercontent.com/frictionlessdata/ckanext-validation/master/requirements.txt

COPY docker-entrypoint.d/* /docker-entrypoint.d/

Applying patches

When building your project specific CKAN images (the ones defined in the ckan/ folder), you can apply patches to CKAN core or any of the built extensions. To do so create a folder inside ckan/patches with the name of the package to patch (ie ckan or ckanext-??). Inside you can place patch files that will be applied when building the images. The patches will be applied in alphabetical order, so you can prefix them sequentially if necessary.

For instance, check the following example image folder:

ckan
├── patches
│   ├── ckan
│   │   ├── 01_datasets_per_page.patch
│   │   ├── 02_groups_per_page.patch
│   │   ├── 03_or_filters.patch
│   └── ckanext-harvest
│       └── 01_resubmit_objects.patch
├── Dockerfile
└── Dockerfile.dev

Known Issues

  • Running the tests: Running the tests for CKAN or an extension inside the container will delete your current database. We need to patch CKAN core in our image to work around that.

License

This material is open and licensed under the GNU Affero General Public License (AGPL) v3.0 whose full text may be found at:

http://www.fsf.org/licensing/licenses/agpl-3.0.html

docker-ckan's People

Contributors

aivuk avatar amercader avatar avdata99 avatar chris48s avatar gerbyzation avatar jcracknell avatar jtorreggiani avatar luccasmmg avatar pazepaze avatar pdelboca avatar roll avatar starsinmypockets avatar tristndev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-ckan's Issues

Datapusher does not upload csv automatically

Datapusher does not upload csv automatically anymore after recent update to the datapusher Dockerfile.

I found this new behavior on my ckan 2.8 setup after pulling your changes to the Dockerfile. I was using 96f46d4 before.

To reproduce, first make some changes in order to actually be able to run ckan 2.8 with docker-compose here. I pushed those to https://github.com/pazepaze/docker-ckan/tree/2.8-working-setup (Sidenote: it should probably be documented somewhere how to run the other ckan versions supported in this repo)
Then run normally with

docker-compose build && docker-compose up -d

Create a dataset and upload the following simple csv file:

foo,bar
1,2
3,4

The datapusher will not be triggered automatically. If you go to the resource > Manage > Datastore though, where you can see the Upload log in the ckan UI, something strange happens: If you hammer F5 in the browser a few times to update that page, the datapusher can finally be convinced to upload the file.

Not sure whether this is a datapusher issue or an issue with the datapusher dockerfile here. All I can say is that it worked with the datapusher Dockerfile from commit 96f46d4 (before the changes in October 2020).

Installing cryptography fails as it requires rust tools

When ckan extension has PyOpenSSL as an requirement, the installation fails as compiling cryptography requires rust tools now. This happens for example in ckanext-harvest where latest master doesn't pass CI anymore.

Should rust tools be installed in the image or should the extension depending on cryptography install them themselves?

Apparently fixed already in #65, but the images in docker hub haven't been updated.

eval(response_from_solr)?

Noticing an interesting error on startup:

[prerun] Initializing datastore db - end
b''
Traceback (most recent call last):
  File "/srv/app/prerun.py", line 203, in <module>
    check_solr_connection()
  File "/srv/app/prerun.py", line 85, in check_solr_connection
    eval(connection.read())
  File "<string>", line 8, in <module>
NameError: name 'true' is not defined

Which leads to

eval(connection.read())
a line that traces back to the first commit on the repo. I'm not sure what could be gained by evaluating a solr response as a python expression here.

Create a simple a new page

Hi I'm new in Ckan, and I need to create a new page, where the page it's gonna be 127.0.0.1:5000/apipage, I've copied the template folder apipage as about page, but when I put on the web this page shows 404, I need help, so its a static page for the project

Error when creating a new organization

When trying to create a new org on a fresh install the response is a 500 Error,
OSError: [Errno 13] Permission denied: '/var/lib/ckan/storage/uploads

Seems like the issue is caused by /var/lib/ckan/storage being owned by root. Opening a terminal in the container and changing owner to ckan fixed it.

DB connection crashes

When going to /dataset or performing a search the CKAN service crashes with LOG: unexpected EOF on client connection with an open transaction.

ckan          | [prerun] Sysadmin user exists, skipping creation
ckan          | Starting subprocess with file monitor
solr          | 1930189 INFO  (qtp1989972246-17) [   x:ckan] o.a.s.c.S.Request [ckan]  webapp=/solr path=/select params={q=*:*&rows=1&wt=json} hits=0 status=0 QTime=0
solr          | 1930197 INFO  (qtp1989972246-21) [   x:ckan] o.a.s.c.S.Request [ckan]  webapp=/solr path=/admin/file params={file=schema.xml} status=0 QTime=0
solr          | 1930548 INFO  (qtp1989972246-19) [   x:ckan] o.a.s.c.S.Request [ckan]  webapp=/solr path=/select params={q=*:*&rows=1&wt=json} hits=0 status=0 QTime=0
solr          | 1930554 INFO  (qtp1989972246-18) [   x:ckan] o.a.s.c.S.Request [ckan]  webapp=/solr path=/admin/file params={file=schema.xml} status=0 QTime=0
ckan          | Starting server in PID 27.
ckan          | 2018-01-22 15:04:49,113 INFO  [ckan.lib.base]  /api/3/action/status_show render time 0.018 seconds
ckan          | 2018-01-22 15:04:59,189 INFO  [ckan.lib.base]  /api/3/action/status_show render time 0.005 seconds
solr          | 1942913 INFO  (qtp1989972246-12) [   x:ckan] o.a.s.c.S.Request [ckan]  webapp=/solr path=/select params={facet.limit=50&q=*:*&facet.field=organization&facet.field=groups&facet.field=tags&facet.field=res_format&facet.field=license_id&fl=id+validated_data_dict&start=0&sort=views_recent+desc&fq=%2Bcapacity:public+capacity:"public"&fq=%2Bsite_id:"default"&fq=%2Bstate:active&fq=%2Bpermission_labels:("public")&facet.mincount=1&rows=5&facet=true&wt=json} hits=0 status=0 QTime=1
ckan          | 2018-01-22 15:05:00,452 INFO  [ckan.lib.base]  / render time 0.810 seconds
ckan          | 2018-01-22 15:05:05,411 INFO  [ckan.lib.base]  /organization render time 0.183 seconds
ckan          | 2018-01-22 15:05:07,481 INFO  [ckan.lib.base]  /group render time 0.051 seconds
ckan          | 2018-01-22 15:05:08,114 INFO  [ckan.lib.base]  /about render time 0.027 seconds
solr          | 1952083 INFO  (qtp1989972246-17) [   x:ckan] o.a.s.c.S.Request [ckan]  webapp=/solr path=/select params={facet.limit=50&q=*:*&facet.field=organization&facet.field=groups&facet.field=tags&facet.field=res_format&facet.field=license_id&fl=id+validated_data_dict&start=0&sort=score+desc,+metadata_modified+desc&fq=%2Bdataset_type:dataset&fq=%2Bsite_id:"default"&fq=%2Bstate:active&fq=%2Bpermission_labels:("public")&facet.mincount=1&rows=21&facet=true&wt=json} hits=0 status=0 QTime=1
db            | LOG:  unexpected EOF on client connection with an open transaction
ckan exited with code 0

docker-compose error: key cannot contain a space

$ docker-compose build
key cannot contain a space
$ docker-compose --version
Docker Compose version v2.1.1

This looks like a change in docker/docker-compose. Env variables in .env should be quoted if they contain a space.

Datastore problem with ckan2.7

Overview

With this line in Dockerfile we solve the psycopg2 bug related to postgresql-client@10:

    # Workaround to solve https://github.com/psycopg/psycopg2/issues/594 in Alpine 3.7
	sed -i -e "s/psycopg2==2.4.5/psycopg2==2.7.3.2/g" requirements.txt && \

But at the same time it seems there are breaking changes between these versions of psycopg. For example a query like this:

http://ckan-dev:5000/api/3/action/datastore_search_sql?sql=SELECT%20DISTINCT%20%22Sex%22%20FROM%20%22723c1bca-c4da-4a84-b99b-7140e242921f%22

will fail because of the fact that the latter psycopg returns already parsed dict instead of JSON:

ckan/ckanext/datastore/helpers.py

        query_plan = json.loads(result['QUERY PLAN'])
        plan = query_plan[0]['Plan']

I was able to solve it patching CKAN:

diff --git a/ckanext/datastore/helpers.py b/ckanext/datastore/helpers.py
index b616f0f94..ec1428d1d 100644
--- a/ckanext/datastore/helpers.py
+++ b/ckanext/datastore/helpers.py
@@ -105,8 +105,8 @@ def get_table_names_from_sql(context, sql):
     table_names = []

     try:
-        query_plan = json.loads(result['QUERY PLAN'])
-        plan = query_plan[0]['Plan']
+        # TODO: add comment and issue
+        plan = result['QUERY PLAN'][0]['Plan']

         table_names.extend(_get_table_names_from_plan(plan))

But it's only for this exact problem - not sure are there other breaking changes in psycopg2

Script prerun.py crashes on initialization of ckan container

Specifically, the following three lines of code are problematic.

Exception: expected a bytes-like object, str found - second parameter is empty string

perms_sql = re.sub(b'\\\\connect "(.*)"', "", perms_sql)

No such command exists in the CLI as referred in

command = ["ckan", "-c", ckan_ini, "user", name]
should be:
command = ["ckan", "-c", ckan_ini, "user", "show", name]

subprocess.check_output returns a byte object

out = subprocess.check_output(command)

... after which this line crashes with the same exception as above:

if "User:None" not in re.sub(r"\s", "", out):

Standard User not working / new Created User not working

Hello,

in my .env file i have that configured:

CKAN_SYSADMIN_NAME=ckan_admin
CKAN_SYSADMIN_PASSWORD=adminadmin
[email protected]

That credentials are not working. So i get in the container bash and tried to create manually a new user.
Following Command: ckan -c ckan.ini sysadmin add myusername [email protected]
So CKAN creates a new user with my password.

When i try to login with both User i get this message:

image

There are no several Errors in the Logs.

Best regards!

ckan did not start

Thanks for doing this. A easy dev setup like this is really needed.

I did
docker-compose build
and
docker-compose up

But the ckan container did not start.

This is the container log:

SRC_EXTENSIONS_DIR=/srv/app/src_extensions
CKAN__PLUGINS=image_view text_view recline_view datastore datapusher envvars repo_info
CKAN_SMTP_USER=user
HOSTNAME=60068fda2634
DEVELOPMENT_MODE=true
CKAN_SMTP_STARTTLS=True
CKAN_REDIS_URL=redis://redis:6379/1
CKAN_DATAPUSHER_URL=http://datapusher:8800
CKAN_SITE_ID=default
CKAN_SQLALCHEMY_URL=postgresql://ckan:ckan@db/ckan
CKAN_SMTP_SERVER=smtp.corporateict.domain:25
GIT_URL=https://github.com/ckan/ckan.git
CKAN__HARVEST__MQ__REDIS_DB=1
CKAN_SYSADMIN_PASSWORD=test
APP_DIR=/srv/app
SRC_DIR=/srv/app/src
PWD=/srv/app
HOME=/root
CKAN_INI=/srv/app/production.ini
CKAN__HARVEST__MQ__HOSTNAME=redis
CKAN_SITE_URL=http://ckan:5000
CKAN__HARVEST__MQ__PORT=6379
CKAN_STORAGE_PATH=/var/lib/ckan
CKAN_SOLR_URL=http://solr:8983/solr/ckan
no_proxy=*.local, 169.254/16
CKAN_DATASTORE_WRITE_URL=postgresql://ckan:ckan@db/datastore
CKAN__HARVEST__MQ__TYPE=redis
CKAN_SYSADMIN_NAME=ckan_admin
CKAN_DATASTORE_READ_URL=postgresql://datastore_ro:datastore@db/datastore
CKAN__STORAGE_PATH=/var/lib/ckan
POSTGRES_PASSWORD=ckan
DATASTORE_READONLY_PASSWORD=datastore
CKAN_SMTP_PASSWORD=pass
SHLVL=1
GIT_BRANCH=ckan-2.7.2
CKAN_SMTP_MAIL_FROM=ckan@localhost
PIP_SRC=/srv/app/src
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
CKAN_PORT=5000
[email protected]
_=/bin/printenv
Starting CKAN in development mode
Looking for local extensions to install...
Extension dir contents:
total 8
drwxr-xr-x    3 root     root            96 Jan 26 09:35 .
drwxr-xr-x    1 ckan     root          4096 Jan 26 10:06 ..
-rw-r--r--    1 root     root           378 Jan 26 08:31 README.md
Loading the following plugins: image_view text_view recline_view datastore datapusher envvars repo_info
Edited option ckan.plugins = "image_view text_view recline_view datastore datapusher envvars"->"image_view text_view recline_view datastore datapusher envvars repo_info" (section "app:main")
could not connect to server: Connection refused
Is the server running on host "db" (172.20.0.2) and accepting
TCP/IP connections on port 5432?
2018-01-26T10:08:00.869168900Z 
[prerun] Unable to connect to the database, waiting...
[prerun] Initializing or upgrading db - start
Traceback (most recent call last):
  File "/usr/bin/paster", line 11, in <module>
    load_entry_point('PasteScript==2.0.2', 'console_scripts', 'paster')()
  File "/usr/lib/python2.7/site-packages/paste/script/command.py", line 102, in run
    invoke(command, command_name, options, args[1:])
  File "/usr/lib/python2.7/site-packages/paste/script/command.py", line 141, in invoke
    exit_code = runner.run(args)
  File "/usr/lib/python2.7/site-packages/paste/script/command.py", line 236, in run
    result = self.command()
  File "/srv/app/src/ckan/ckan/lib/cli.py", line 333, in command
    self._load_config(cmd!='upgrade')
  File "/srv/app/src/ckan/ckan/lib/cli.py", line 306, in _load_config
    self.site_user = load_config(self.options.config, load_site_user)
  File "/srv/app/src/ckan/ckan/lib/cli.py", line 221, in load_config
    load_environment(conf.global_conf, conf.local_conf)
  File "/srv/app/src/ckan/ckan/config/environment.py", line 99, in load_environment
    p.load_all()
  File "/srv/app/src/ckan/ckan/plugins/core.py", line 139, in load_all
    load(*plugins)
  File "/srv/app/src/ckan/ckan/plugins/core.py", line 153, in load
    service = _get_service(plugin)
  File "/srv/app/src/ckan/ckan/plugins/core.py", line 256, in _get_service
    raise PluginNotFoundException(plugin_name)
ckan.plugins.core.PluginNotFoundException: repo_info
2018-01-26T10:08:00.869947700Z 
Traceback (most recent call last):
  File "prerun.py", line 185, in <module>
    init_db()
  File "prerun.py", line 89, in init_db
    raise e
subprocess.CalledProcessError: Command '['paster', '--plugin=ckan', 'db', 'init', '-c', '/srv/app/production.ini']' returned non-zero exit status 1
Starting subprocess with file monitor
Traceback (most recent call last):
  File "/usr/bin/paster", line 11, in <module>
    load_entry_point('PasteScript==2.0.2', 'console_scripts', 'paster')()
  File "/usr/lib/python2.7/site-packages/paste/script/command.py", line 102, in run
    invoke(command, command_name, options, args[1:])
  File "/usr/lib/python2.7/site-packages/paste/script/command.py", line 141, in invoke
    exit_code = runner.run(args)
  File "/usr/lib/python2.7/site-packages/paste/script/command.py", line 236, in run
    result = self.command()
  File "/usr/lib/python2.7/site-packages/paste/script/serve.py", line 284, in command
    relative_to=base, global_conf=vars)
  File "/usr/lib/python2.7/site-packages/paste/script/serve.py", line 329, in loadapp
    **kw)
  File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
    return loadobj(APP, uri, name=name, **kw)
  File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
    return context.create()
  File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 710, in create
    return self.object_type.invoke(self)
  File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 146, in invoke
    return fix_call(context.object, context.global_conf, **context.local_conf)
  File "/usr/lib/python2.7/site-packages/paste/deploy/util.py", line 55, in fix_call
    val = callable(*args, **kw)
  File "/srv/app/src/ckan/ckan/config/middleware/__init__.py", line 46, in make_app
    load_environment(conf, app_conf)
  File "/srv/app/src/ckan/ckan/config/environment.py", line 99, in load_environment
    p.load_all()
  File "/srv/app/src/ckan/ckan/plugins/core.py", line 139, in load_all
    load(*plugins)
  File "/srv/app/src/ckan/ckan/plugins/core.py", line 153, in load
    service = _get_service(plugin)
  File "/srv/app/src/ckan/ckan/plugins/core.py", line 256, in _get_service
    raise PluginNotFoundException(plugin_name)
ckan.plugins.core.PluginNotFoundException: repo_info

Datapusher build error cryptography

`Building wheel for cryptography (PEP 517): started
Building wheel for cryptography (PEP 517): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 /usr/lib/python3.8/site-packages/pep517/_in_process.py build_wheel /tmp/tmp5qukwhlv
cwd: /tmp/pip-install-iem4_u5x/cryptography
Complete output (145 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/cryptography
copying src/cryptography/utils.py -> build/lib.linux-x86_64-3.8/cryptography
copying src/cryptography/exceptions.py -> build/lib.linux-x86_64-3.8/cryptography
copying src/cryptography/fernet.py -> build/lib.linux-x86_64-3.8/cryptography
copying src/cryptography/about.py -> build/lib.linux-x86_64-3.8/cryptography
copying src/cryptography/init.py -> build/lib.linux-x86_64-3.8/cryptography
creating build/lib.linux-x86_64-3.8/cryptography/hazmat
copying src/cryptography/hazmat/_types.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat
copying src/cryptography/hazmat/_der.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat
copying src/cryptography/hazmat/_oid.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat
copying src/cryptography/hazmat/init.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat
creating build/lib.linux-x86_64-3.8/cryptography/x509
copying src/cryptography/x509/certificate_transparency.py -> build/lib.linux-x86_64-3.8/cryptography/x509
copying src/cryptography/x509/ocsp.py -> build/lib.linux-x86_64-3.8/cryptography/x509
copying src/cryptography/x509/name.py -> build/lib.linux-x86_64-3.8/cryptography/x509
copying src/cryptography/x509/oid.py -> build/lib.linux-x86_64-3.8/cryptography/x509
copying src/cryptography/x509/base.py -> build/lib.linux-x86_64-3.8/cryptography/x509
copying src/cryptography/x509/general_name.py -> build/lib.linux-x86_64-3.8/cryptography/x509
copying src/cryptography/x509/extensions.py -> build/lib.linux-x86_64-3.8/cryptography/x509
copying src/cryptography/x509/init.py -> build/lib.linux-x86_64-3.8/cryptography/x509
creating build/lib.linux-x86_64-3.8/cryptography/hazmat/backends
copying src/cryptography/hazmat/backends/interfaces.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/backends
copying src/cryptography/hazmat/backends/init.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/backends
creating build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives
copying src/cryptography/hazmat/primitives/padding.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives
copying src/cryptography/hazmat/primitives/keywrap.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives
copying src/cryptography/hazmat/primitives/cmac.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives
copying src/cryptography/hazmat/primitives/poly1305.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives
copying src/cryptography/hazmat/primitives/constant_time.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives
copying src/cryptography/hazmat/primitives/_cipheralgorithm.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives
copying src/cryptography/hazmat/primitives/_asymmetric.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives
copying src/cryptography/hazmat/primitives/hashes.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives
copying src/cryptography/hazmat/primitives/_serialization.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives
copying src/cryptography/hazmat/primitives/init.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives
copying src/cryptography/hazmat/primitives/hmac.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives
creating build/lib.linux-x86_64-3.8/cryptography/hazmat/bindings
copying src/cryptography/hazmat/bindings/init.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/bindings
creating build/lib.linux-x86_64-3.8/cryptography/hazmat/backends/openssl
copying src/cryptography/hazmat/backends/openssl/x509.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/backends/openssl
copying src/cryptography/hazmat/backends/openssl/utils.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/backends/openssl
copying src/cryptography/hazmat/backends/openssl/ocsp.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/backends/openssl
copying src/cryptography/hazmat/backends/openssl/cmac.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/backends/openssl
copying src/cryptography/hazmat/backends/openssl/decode_asn1.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/backends/openssl
copying src/cryptography/hazmat/backends/openssl/poly1305.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/backends/openssl
copying src/cryptography/hazmat/backends/openssl/rsa.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/backends/openssl
copying src/cryptography/hazmat/backends/openssl/aead.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/backends/openssl
copying src/cryptography/hazmat/backends/openssl/ciphers.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/backends/openssl
copying src/cryptography/hazmat/backends/openssl/x448.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/backends/openssl
copying src/cryptography/hazmat/backends/openssl/ed25519.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/backends/openssl
copying src/cryptography/hazmat/backends/openssl/dh.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/backends/openssl
copying src/cryptography/hazmat/backends/openssl/ec.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/backends/openssl
copying src/cryptography/hazmat/backends/openssl/encode_asn1.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/backends/openssl
copying src/cryptography/hazmat/backends/openssl/ed448.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/backends/openssl
copying src/cryptography/hazmat/backends/openssl/dsa.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/backends/openssl
copying src/cryptography/hazmat/backends/openssl/hashes.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/backends/openssl
copying src/cryptography/hazmat/backends/openssl/backend.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/backends/openssl
copying src/cryptography/hazmat/backends/openssl/init.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/backends/openssl
copying src/cryptography/hazmat/backends/openssl/x25519.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/backends/openssl
copying src/cryptography/hazmat/backends/openssl/hmac.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/backends/openssl
creating build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/ciphers
copying src/cryptography/hazmat/primitives/ciphers/modes.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/ciphers
copying src/cryptography/hazmat/primitives/ciphers/aead.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/ciphers
copying src/cryptography/hazmat/primitives/ciphers/base.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/ciphers
copying src/cryptography/hazmat/primitives/ciphers/init.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/ciphers
copying src/cryptography/hazmat/primitives/ciphers/algorithms.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/ciphers
creating build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/asymmetric
copying src/cryptography/hazmat/primitives/asymmetric/utils.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/asymmetric
copying src/cryptography/hazmat/primitives/asymmetric/padding.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/asymmetric
copying src/cryptography/hazmat/primitives/asymmetric/rsa.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/asymmetric
copying src/cryptography/hazmat/primitives/asymmetric/x448.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/asymmetric
copying src/cryptography/hazmat/primitives/asymmetric/ed25519.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/asymmetric
copying src/cryptography/hazmat/primitives/asymmetric/dh.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/asymmetric
copying src/cryptography/hazmat/primitives/asymmetric/ec.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/asymmetric
copying src/cryptography/hazmat/primitives/asymmetric/ed448.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/asymmetric
copying src/cryptography/hazmat/primitives/asymmetric/dsa.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/asymmetric
copying src/cryptography/hazmat/primitives/asymmetric/init.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/asymmetric
copying src/cryptography/hazmat/primitives/asymmetric/x25519.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/asymmetric
creating build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/serialization
copying src/cryptography/hazmat/primitives/serialization/pkcs12.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/serialization
copying src/cryptography/hazmat/primitives/serialization/ssh.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/serialization
copying src/cryptography/hazmat/primitives/serialization/pkcs7.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/serialization
copying src/cryptography/hazmat/primitives/serialization/base.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/serialization
copying src/cryptography/hazmat/primitives/serialization/init.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/serialization
creating build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/twofactor
copying src/cryptography/hazmat/primitives/twofactor/totp.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/twofactor
copying src/cryptography/hazmat/primitives/twofactor/utils.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/twofactor
copying src/cryptography/hazmat/primitives/twofactor/hotp.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/twofactor
copying src/cryptography/hazmat/primitives/twofactor/init.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/twofactor
creating build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/kdf
copying src/cryptography/hazmat/primitives/kdf/pbkdf2.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/kdf
copying src/cryptography/hazmat/primitives/kdf/scrypt.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/kdf
copying src/cryptography/hazmat/primitives/kdf/x963kdf.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/kdf
copying src/cryptography/hazmat/primitives/kdf/kbkdf.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/kdf
copying src/cryptography/hazmat/primitives/kdf/concatkdf.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/kdf
copying src/cryptography/hazmat/primitives/kdf/init.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/kdf
copying src/cryptography/hazmat/primitives/kdf/hkdf.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/primitives/kdf
creating build/lib.linux-x86_64-3.8/cryptography/hazmat/bindings/openssl
copying src/cryptography/hazmat/bindings/openssl/binding.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/bindings/openssl
copying src/cryptography/hazmat/bindings/openssl/_conditional.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/bindings/openssl
copying src/cryptography/hazmat/bindings/openssl/init.py -> build/lib.linux-x86_64-3.8/cryptography/hazmat/bindings/openssl
running egg_info
writing src/cryptography.egg-info/PKG-INFO
writing dependency_links to src/cryptography.egg-info/dependency_links.txt
writing requirements to src/cryptography.egg-info/requires.txt
writing top-level names to src/cryptography.egg-info/top_level.txt
reading manifest file 'src/cryptography.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'docs/_build'
warning: no previously-included files found matching 'vectors'
warning: no previously-included files matching '' found under directory 'vectors'
warning: no previously-included files matching '
' found under directory '.github'
warning: no previously-included files found matching 'release.py'
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching 'codecov.yml'
warning: no previously-included files found matching '.readthedocs.yml'
warning: no previously-included files found matching 'dev-requirements.txt'
warning: no previously-included files found matching 'tox.ini'
warning: no previously-included files found matching 'mypy.ini'
warning: no previously-included files matching '' found under directory '.zuul.d'
warning: no previously-included files matching '
' found under directory '.zuul.playbooks'
writing manifest file 'src/cryptography.egg-info/SOURCES.txt'
running build_ext
generating cffi module 'build/temp.linux-x86_64-3.8/_padding.c'
creating build/temp.linux-x86_64-3.8
generating cffi module 'build/temp.linux-x86_64-3.8/_openssl.c'
running build_rust

  =============================DEBUG ASSISTANCE=============================
  If you are seeing a compilation error please try the following steps to
  successfully install cryptography:
  1) Upgrade to the latest pip and try again. This will fix errors for most
     users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
  2) Read https://cryptography.io/en/latest/installation.html for specific
     instructions for your platform.
  3) Check our frequently asked questions for more information:
     https://cryptography.io/en/latest/faq.html
  4) Ensure you have a recent Rust toolchain installed.
  =============================DEBUG ASSISTANCE=============================

error: Can not find Rust compiler

ERROR: Failed building wheel for cryptography
Building wheel for cffi (setup.py): started
Building wheel for cffi (setup.py): finished with status 'done'
Created wheel for cffi: filename=cffi-1.14.4-cp38-cp38-linux_x86_64.whl size=444690 sha256=1e8fc8b0f9698406e92f2dfb68a6dc15edc3d64dc89d0e698cc90b59d4eb34b7
Stored in directory: /tmp/pip-ephem-wheel-cache-_np9s1q5/wheels/74/c4/b2/301f50054a0b5635fc25567992701a66ccb924f38a85e1133c
Building wheel for MarkupSafe (setup.py): started
Building wheel for MarkupSafe (setup.py): finished with status 'done'
Created wheel for MarkupSafe: filename=MarkupSafe-1.1.1-cp38-cp38-linux_x86_64.whl size=32145 sha256=f9467441734fe803e949528860e6c862201f35fa1712443a303f4bfa2203c004
Stored in directory: /tmp/pip-ephem-wheel-cache-_np9s1q5/wheels/0c/61/d6/4db4f4c28254856e82305fdb1f752ed7f8482e54c384d8cb0e
Successfully built ckanserviceprovider messytables SQLAlchemy lxml json-table-schema cffi MarkupSafe
Failed to build cryptography
ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly
ERROR: Service 'datapusher' failed to build : The command '/bin/sh -c mkdir ${APP_DIR}/src && cd ${APP_DIR}/src && git clone -b ${GIT_BRANCH} --depth=1 --single-branch ${GIT_URL} && cd datapusher && python3 setup.py install && pip3 install --no-cache-dir -r requirements.txt' returned a non-zero code: 1`

Missing requirements for testing

I've been trying to run tests on an extension and found there are some things missing to be able to run tests.

  1. install ckan's dev-requirements.txt
    This could be done (conditionally) in the Dockerfile, but that would mean there would be a different image build for dev and prod. Alternatively this could take place in start_ckan_development.sh but then every time a new instance is recreated we need to download dependencies.
  2. update test-core.ini with database, redis and solr settings.
    Update in start_ckan_development.sh with the paster config-tool? Also does solr need a second core for testing?
  3. CKAN is not located in a sibling directory relative to the manually installed extensions, the use setting needs to be updated in test.ini.
  4. install dev/testing dependencies for specific plugin.
    In start_ckan_development.sh it's checking for requirements files, we can add a check for dev-requirements.txt to pick dev dependencies up as wel.

Will look at putting a PR together for 2-4 unless you have other suggestions on how to tackle these.

Plain install with copied .env.example fail

Hi and thanks for the effort in making a simple install

I just renamed the .env.example to .env and then docker-compose build and docker-compose up

All stuff compiles and the containers start. CKAN seems to start on http://localhost:5000/ But displays "Server Error An internal server error occurred"

Lots of error messages on the log so I do not know which are relevant.

There is a continuous list of errors like this:

db | ERROR: relation "system_info" does not exist at character 215
db | STATEMENT: SELECT system_info.id AS system_info_id, system_info.key AS system_info_key, system_info.value AS system_info_value, system_info.state AS system_info_state, system_info.revision_id AS system_info_revision_id
db | FROM system_info
db | WHERE system_info.key = 'ckan.config_update'
db | LIMIT 1

And If i click on something on the CKAN web page the log is like this:

db | ERROR: relation "system_info" does not exist at character 215
db | STATEMENT: SELECT system_info.id AS system_info_id, system_info.key AS system_info_key, system_info.value AS system_info_value, system_info.state AS system_info_state, system_info.revision_id AS system_info_revision_id
db | FROM system_info
db | WHERE system_info.key = 'ckan.config_update'
db | LIMIT 1
db | ERROR: relation "group" does not exist at character 65
db | STATEMENT: SELECT "group".id AS group_id, "group".name AS group_name
db | FROM "group"
db | WHERE "group".state = 'active' AND "group".is_organization = true AND "group".type = 'organization' ORDER BY "group".title ASC
ckan | Error - <class 'sqlalchemy.exc.ProgrammingError'>: (ProgrammingError) relation "group" does not exist
ckan | LINE 2: FROM "group"
ckan | ^
ckan | 'SELECT "group".id AS group_id, "group".name AS group_name \nFROM "group" \nWHERE "group".state = %(state_1)s AND "group".is_organization = true AND "group".type = %(type_1)s ORDER BY "group".title ASC' {'state_1': 'active', 'type_1': 'organization'}
ckan | URL: http://localhost:5000/organization
ckan | File '/usr/lib/python2.7/site-packages/weberror/errormiddleware.py', line 171 in call
ckan | app_iter = self.application(environ, sr_checker)
ckan | File '/usr/lib/python2.7/site-packages/webob/dec.py', line 147 in call
ckan | resp = self.call_func(req, *args, **self.kwargs)
ckan | File '/usr/lib/python2.7/site-packages/webob/dec.py', line 208 in call_func
ckan | return self.func(req, *args, **kwargs)
ckan | File '/usr/lib/python2.7/site-packages/fanstatic/publisher.py', line 234 in call
ckan | return request.get_response(self.app)
ckan | File '/usr/lib/python2.7/site-packages/webob/request.py', line 1053 in get_response
ckan | application, catch_exc_info=False)
ckan | File '/usr/lib/python2.7/site-packages/webob/request.py', line 1022 in call_application
ckan | app_iter = application(self.environ, start_response)
ckan | File '/usr/lib/python2.7/site-packages/webob/dec.py', line 147 in call
ckan | resp = self.call_func(req, args, **self.kwargs)
ckan | File '/usr/lib/python2.7/site-packages/webob/dec.py', line 208 in call_func
ckan | return self.func(req, args, **kwargs)
ckan | File '/usr/lib/python2.7/site-packages/fanstatic/injector.py', line 54 in call
ckan | response = request.get_response(self.app)
ckan | File '/usr/lib/python2.7/site-packages/webob/request.py', line 1053 in get_response
ckan | application, catch_exc_info=False)
ckan | File '/usr/lib/python2.7/site-packages/webob/request.py', line 1022 in call_application
ckan | app_iter = application(self.environ, start_response)
ckan | File '/srv/app/src/ckan/ckan/config/middleware/pylons_app.py', line 250 in inner
ckan | result = application(environ, start_response)
ckan | File '/usr/lib/python2.7/site-packages/beaker/middleware.py', line 73 in call
ckan | return self.app(environ, start_response)
ckan | File '/usr/lib/python2.7/site-packages/beaker/middleware.py', line 156 in call
ckan | return self.wrap_app(environ, session_start_response)
ckan | File '/usr/lib/python2.7/site-packages/routes/middleware.py', line 131 in call
ckan | response = self.app(environ, start_response)
ckan | File '/srv/app/src/ckan/ckan/config/middleware/common_middleware.py', line 80 in call
ckan | return self.app(environ, start_response)
ckan | File '/usr/lib/python2.7/site-packages/pylons/wsgiapp.py', line 125 in call
ckan | response = self.dispatch(controller, environ, start_response)
ckan | File '/usr/lib/python2.7/site-packages/pylons/wsgiapp.py', line 324 in dispatch
ckan | return controller(environ, start_response)
ckan | File '/srv/app/src/ckan/ckan/lib/base.py', line 212 in call
ckan | res = WSGIController.call(self, environ, start_response)
ckan | File '/usr/lib/python2.7/site-packages/pylons/controllers/core.py', line 221 in call
ckan | response = self._dispatch_call()
ckan | File '/usr/lib/python2.7/site-packages/pylons/controllers/core.py', line 172 in _dispatch_call
ckan | response = self._inspect_call(func)
ckan | File '/usr/lib/python2.7/site-packages/pylons/controllers/core.py', line 107 in _inspect_call
ckan | result = self._perform_call(func, args)
ckan | File '/usr/lib/python2.7/site-packages/pylons/controllers/core.py', line 60 in _perform_call
ckan | return func(**args)
ckan | File '/srv/app/src/ckan/ckan/controllers/group.py', line 181 in index
ckan | context, data_dict_global_results)
ckan | File '/srv/app/src/ckan/ckan/logic/init.py', line 457 in wrapped
ckan | result = _action(context, data_dict, **kw)
ckan | File '/srv/app/src/ckan/ckan/logic/action/get.py', line 530 in organization_list
ckan | return _group_or_org_list(context, data_dict, is_org=True)
ckan | File '/srv/app/src/ckan/ckan/logic/action/get.py', line 411 in _group_or_org_list
ckan | groups = query.all()
ckan | File '/usr/lib/python2.7/site-packages/sqlalchemy/orm/query.py', line 2293 in all
ckan | return list(self)
ckan | File '/usr/lib/python2.7/site-packages/sqlalchemy/orm/query.py', line 2405 in iter
ckan | return self._execute_and_instances(context)
ckan | File '/usr/lib/python2.7/site-packages/sqlalchemy/orm/query.py', line 2420 in _execute_and_instances
ckan | result = conn.execute(querycontext.statement, self._params)
ckan | File '/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py', line 727 in execute
ckan | return meth(self, multiparams, params)
ckan | File '/usr/lib/python2.7/site-packages/sqlalchemy/sql/elements.py', line 322 in _execute_on_connection
ckan | return connection._execute_clauseelement(self, multiparams, params)
ckan | File '/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py', line 824 in _execute_clauseelement
ckan | compiled_sql, distilled_params
ckan | File '/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py', line 954 in _execute_context
ckan | context)
ckan | File '/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py', line 1116 in _handle_dbapi_exception
ckan | exc_info
ckan | File '/usr/lib/python2.7/site-packages/sqlalchemy/util/compat.py', line 189 in raise_from_cause
ckan | reraise(type(exception), exception, tb=exc_tb)
ckan | File '/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py', line 947 in _execute_context
ckan | context)
ckan | File '/usr/lib/python2.7/site-packages/sqlalchemy/engine/default.py', line 435 in do_execute
ckan | cursor.execute(statement, parameters)
ckan | ProgrammingError: (ProgrammingError) relation "group" does not exist
ckan | LINE 2: FROM "group"
ckan | ^
ckan | 'SELECT "group".id AS group_id, "group".name AS group_name \nFROM "group" \nWHERE "group".state = %(state_1)s AND "group".is_organization = true AND "group".type = %(type_1)s ORDER BY "group".title ASC' {'state_1': 'active', 'type_1': 'organization'}
ckan |
ckan |
ckan | CGI Variables
ckan | -------------
ckan | CKAN_CURRENT_URL: '/organization'
ckan | CKAN_LANG: 'en'
ckan | CKAN_LANG_IS_DEFAULT: True
ckan | HTTP_ACCEPT: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,
/
;q=0.8'
ckan | HTTP_ACCEPT_ENCODING: 'gzip, deflate, br'
ckan | HTTP_ACCEPT_LANGUAGE: 'en-US,en;q=0.9,nb-NO;q=0.8,nb;q=0.7'
ckan | HTTP_CONNECTION: 'keep-alive'
ckan | HTTP_HOST: 'localhost:5000'
ckan | HTTP_REFERER: 'http://localhost:5000/'
ckan | HTTP_UPGRADE_INSECURE_REQUESTS: '1'
ckan | HTTP_USER_AGENT: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36'
ckan | PATH_INFO: '/organization'
ckan | REMOTE_ADDR: '172.19.0.1'
ckan | REMOTE_PORT: '8904'
ckan | REQUEST_METHOD: 'GET'
ckan | REQUEST_URI: '/organization'
ckan | SERVER_NAME: 'e5ba25926904'
ckan | SERVER_PORT: '5000'
ckan | SERVER_PROTOCOL: 'HTTP/1.1'
ckan | UWSGI_ROUTER: 'http'
ckan |
ckan |
ckan | WSGI Variables
ckan | --------------
ckan | application: <fanstatic.publisher.Delegator object at 0x7fde3fd0fb10>
ckan | beaker.cache: <beaker.cache.CacheManager object at 0x7fde3fd0fa50>
ckan | beaker.get_session: <bound method SessionMiddleware._get_session of <beaker.middleware.SessionMiddleware object at 0x7fde3fd0f9d0>>
ckan | beaker.session: {'_accessed_time': 1519987786.062407, '_creation_time': 1519987786.062407}
ckan | ckan.app: 'pylons_app'
ckan | fanstatic.needed: <fanstatic.core.NeededResources object at 0x7fde3eca3390>
ckan | paste.cookies: (<SimpleCookie: >, '')
ckan | paste.registry: <paste.registry.Registry object at 0x7fde4081c5d0>
ckan | paste.throw_errors: True
db | ERROR: relation "system_info" does not exist at character 215
db | STATEMENT: SELECT system_info.id AS system_info_id, system_info.key AS system_info_key, system_info.value AS system_info_value, system_info.state AS system_info_state, system_info.revision_id AS system_info_revision_id
db | FROM system_info
db | WHERE system_info.key = 'ckan.config_update'
db | LIMIT 1
ckan | pylons.action_method: <bound method OrganizationController.index of <ckan.controllers.organization.OrganizationController object at 0x7fde3ecae390>>
ckan | pylons.controller: <ckan.controllers.organization.OrganizationController object at 0x7fde3ecae390>
ckan | pylons.environ_config: {'session': 'beaker.session', 'cache': 'beaker.cache'}
ckan | pylons.pylons: <pylons.util.PylonsContext object at 0x7fde3ecae4d0>
ckan | pylons.routes_dict: {'action': u'index', 'controller': u'organization'}
ckan | repoze.who.api: <repoze.who.api.API object at 0x7fde4140f850>
ckan | repoze.who.logger: <logging.Logger object at 0x7fde3fd0fc10>
ckan | repoze.who.plugins: {'ckan.lib.authenticator:UsernamePasswordAuthenticator': <ckan.lib.authenticator.UsernamePasswordAuthenticator object at 0x7fde3fd2ddd0>, 'friendlyform': <FriendlyFormPlugin 140592530248848>, 'auth_tkt': <CkanAuthTktCookiePlugin 140592530240720>}
ckan | routes.route: <routes.route.Route object at 0x7fde3ff86790>
ckan | routes.url: <routes.util.URLGenerator object at 0x7fde3ecae050>
ckan | uwsgi.core: 1999
ckan | uwsgi.node: 'e5ba25926904'
ckan | uwsgi.version: '2.0.15'
ckan | webob._parsed_query_vars: (GET([]), '')
ckan | webob.adhoc_attrs: {'response': <Response at 0x7fde3ecae810 200 OK>, 'language': 'en-us'}
ckan | wsgi process: 'Multiprocess'
ckan | wsgi.file_wrapper:
ckan | wsgiorg.routing_args: (<routes.util.URLGenerator object at 0x7fde3ecae050>, {'action': u'index', 'controller': u'organization'})
ckan | x-wsgiorg.fdevent.readable:
ckan | x-wsgiorg.fdevent.timeout: None
ckan | x-wsgiorg.fdevent.writable:
ckan | ------------------------------------------------------------

Network configuration

Out of the box datapusher and ckan don't work properly due to networking issues.

  1. in .env.example CKAN_SITE_URL is set to http://ckan:5000, but from the host machine ckan won't resolve.
  2. Datapusher raises the error that processing is sucessful, but unable to post to result_url. With the default settings this would be to an endpoint on ckan:5000, of which it can't resolve the host.

The easy remedy for the first point is to set CKAN_SITE_URL to http://localhost:5000 (#16), but this probably won't play with a solution for point 2.

Datapusher needs to be able to post a request to CKAN, so it needs to be able to resolve whatever the host is set to in CKAN_SITE_URL to something that points to either the host machine localhost (where the port is bound to the CKAN docker container) or to the container straight away.

At the moment I solved this by adding a hosts entry in the datapusher container, mapping ckan to the ip docker.for.mac.localhost resolves to, and an entry on my host machine mapping ckan to localhost. Adding a link in docker-compose doesn't work as it creates a circular dependency and would require for development to either change the service name or the host name.

Ideally there would be a fixed IP that would always resolve to the host machine, regardless if it's resolved at the host or in a container/VM, but I am unaware of such a thing.

Alternatively it would be great to work out a recommended approach to configure this so it's easy to get datapusher working locally.

IDE integrated remote debugging options (vscode)

I really don't like when projects impose the development environment so my following issue is not so much inline with my philosophy but... It taken 1 day of work to obtain something better than pdb that I'd love to share and have it integrated (as an option) into this project

This patch will add remote (to docker) debug facilities and an already configured project environment to be able to debug python (and Jinja2) interactively directly from the Visual Studio IDE.

All you need is the Docker plugin installed into the IDE (it's provided by the community and very easy to use).

The remote debug leverages over debugpy and the docker plugin looks also open source.

I created my branch 2.8-vscode to discuss changes before the pr.
The patch is a bit more complex than necessary because the starting project does not have a 2.8 branch ready to use (can I we have it?).

https://github.com/okfn/docker-ckan/compare/master...ccancellieri:2.8-vscode?expand=1

If you like that we can discuss how to integrate into the master as well (yes it works also for 2.9.3 but my plugins still not)

I think a switch variable into .env can be used to enable/disable it, on my branch is enabled by default,

Actually it looks amazing I'm also able to debug jinja2 templates for free

Improve start_ckan_development to run docker-entrypoint.d also from extensions

Hi,
I'm using this project mainly to debug through docker my extensions.
One of my extensions (terriajs) requires to run some paster scripts (I'm on 2.8) to configure the ini file adding plugin specific plugin configurations.

I've seen the patch approach and the current way you manage plugins and I would prefer to transparently add scripts to the setup of my plugin in the same clean way you are doing with src_extensions plugin folder: if it's present then configure the plugin.

This will help to modularize not having to set specific variables to env and then pass them to the scripts etc.

So I produced this small patch which will use the same approach you are using for the main configuration where you run all the python and scripts file found into /docker-entrypoint.d

Recursively this can be applied to any plugin found into the folder src_extensions.

The result is that if you add that folder (or maybe something with different name not docker related?) the start_ckan_development script will load also them as it is doing for the root only.

In this way each plugin is also able to auto configure it'self not having to specify special variables or changing this project scripts anymore.

Can be related to:
#15

Note I'm over 2.8 so I'm providing a first draft of this fix only for that but I can port to other versions as well.

after rebuild => SOLR schema version not supported: 2.8. Supported versions are [2.7]

Hi
I did a "docker-compose build --no-cache". It seems that there has been a change in the SOLR schema. This is my output:
ckan | Loading paste environment: config:/srv/app/production.ini
ckan | 2018-04-01 16:36:57,442 CRIT Supervisor running as root (no user in config file)
ckan | 2018-04-01 16:36:57,443 WARN For [program:ckan-worker], redirect_stderr=true but stderr_logfile has also been set to a filename, the filename has been ignored
ckan | 2018-04-01 16:36:57,444 INFO Included extra file "/etc/supervisord.d/worker.conf" during parsing
ckan | Unlinking stale socket /tmp/supervisor.sock
ckan | 2018-04-01 16:36:57,852 INFO RPC interface 'supervisor' initialized
ckan | 2018-04-01 16:36:57,853 CRIT Server 'unix_http_server' running without any HTTP authentication checking
ckan | 2018-04-01 16:36:57,855 INFO supervisord started with pid 24
ckan | 2018-04-01 16:36:58,859 INFO spawned: 'ckan-worker' with pid 31
ckan | 2018-04-01 16:36:59,861 INFO success: ckan-worker entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
solr | 28181 INFO (qtp1989972246-18) [ x:ckan] o.a.s.c.S.Request [ckan] webapp=/solr path=/select params={q=:&rows=1&wt=json} hits=0 status=0 QTime=0
solr | 28183 INFO (qtp1989972246-18) [ x:ckan] o.a.s.c.S.Request [ckan] webapp=/solr path=/select params={q=:&rows=1&wt=json} hits=0 status=0 QTime=0
solr | 28340 INFO (qtp1989972246-17) [ x:ckan] o.a.s.c.S.Request [ckan] webapp=/solr path=/admin/file params={file=schema.xml} status=0 QTime=70
solr | 28341 INFO (qtp1989972246-12) [ x:ckan] o.a.s.c.S.Request [ckan] webapp=/solr path=/admin/file params={file=schema.xml} status=0 QTime=73
ckan | Traceback (most recent call last):
ckan | File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
ckan | Traceback (most recent call last):
ckan | File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
ckan | return loadobj(APP, uri, name=name, **kw)
ckan | File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
ckan | return context.create()
ckan | File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 710, in create
ckan | return self.object_type.invoke(self)
ckan | File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 146, in invoke
ckan | return fix_call(context.object, context.global_conf, **context.local_conf)
ckan | File "/usr/lib/python2.7/site-packages/paste/deploy/util.py", line 55, in fix_call
ckan | return loadobj(APP, uri, name=name, **kw)
ckan | File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
ckan | return context.create()
ckan | File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 710, in create
ckan | return self.object_type.invoke(self)
ckan | File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 146, in invoke
ckan | return fix_call(context.object, context.global_conf, **context.local_conf)
ckan | File "/usr/lib/python2.7/site-packages/paste/deploy/util.py", line 55, in fix_call
ckan | val = callable(*args, **kw)
ckan | File "/srv/app/src/ckan/ckan/config/middleware/init.py", line 46, in make_app
ckan | val = callable(*args, **kw)
ckan | File "/srv/app/src/ckan/ckan/config/middleware/init.py", line 46, in make_app
ckan | load_environment(conf, app_conf)
ckan | File "/srv/app/src/ckan/ckan/config/environment.py", line 99, in load_environment
ckan | load_environment(conf, app_conf)
ckan | File "/srv/app/src/ckan/ckan/config/environment.py", line 99, in load_environment
ckan | p.load_all()
ckan | File "/srv/app/src/ckan/ckan/plugins/core.py", line 129, in load_all
ckan | p.load_all()
ckan | File "/srv/app/src/ckan/ckan/plugins/core.py", line 129, in load_all
ckan | unload_all()
ckan | File "/srv/app/src/ckan/ckan/plugins/core.py", line 182, in unload_all
ckan | unload_all()
ckan | File "/srv/app/src/ckan/ckan/plugins/core.py", line 182, in unload_all
ckan | unload(*reversed(_PLUGINS))
ckan | File "/srv/app/src/ckan/ckan/plugins/core.py", line 210, in unload
ckan | unload(*reversed(_PLUGINS))
ckan | File "/srv/app/src/ckan/ckan/plugins/core.py", line 210, in unload
ckan | plugins_update()
ckan | File "/srv/app/src/ckan/ckan/plugins/core.py", line 121, in plugins_update
ckan | plugins_update()
ckan | File "/srv/app/src/ckan/ckan/plugins/core.py", line 121, in plugins_update
ckan | environment.update_config()
ckan | File "/srv/app/src/ckan/ckan/config/environment.py", line 207, in update_config
ckan | environment.update_config()
ckan | File "/srv/app/src/ckan/ckan/config/environment.py", line 207, in update_config
ckan | search.check_solr_schema_version()
ckan | File "/srv/app/src/ckan/ckan/lib/search/init.py", line 306, in check_solr_schema_version
ckan | search.check_solr_schema_version()
ckan | File "/srv/app/src/ckan/ckan/lib/search/init.py", line 306, in check_solr_schema_version
ckan | % (version, ', '.join(SUPPORTED_SCHEMA_VERSIONS)))
ckan | ckan.lib.search.common.SearchError: SOLR schema version not supported: 2.8. Supported versions are [2.7]
ckan | % (version, ', '.join(SUPPORTED_SCHEMA_VERSIONS)))
ckan | ckan.lib.search.common.SearchError: SOLR schema version not supported: 2.8. Supported versions are [2.7]
ckan | OOPS ! failed loading app in worker 1 (pid 26) :( trying again...
ckan | DAMN ! worker 1 (pid: 26) died :( trying respawn ...

Support custom setup scripts in the base images

A really common scenario when building custom images for your project is that you'll need to initialize things in the database for an extension, or basically perform a task that needs to be done at run time, not build time.

Right now if you needed to this you would need to override the entry script in CMD to use a custom one in the ckan image. This means a lot of duplication, as you need to basically copy start_ckan.sh and start_ckan_development.sh to add a call to your custom script (eg prerun_validation.py to initialize some extension tables in the database). A better approach would be to support custom scripts in an entrypoint folder, similarly to what the postgres image offers (see How to extend this image). We could execute any *.sh or *.py file present in the folder, sorted by name like the Postgres image does.

can I help?

This looks good, thanks for working on this! I have been doing some work on some ideas for a better docker setup myself, but it's been a bit of a wrestle and this looks better.

Could you indicate where you could use contributions? I don't know all the ins and outs of CKAN but happy to see if I can help with this.

Datapusher not working on my local enviroment

My environment is localhost with nothing changed except only these two settings in my hosts file on windows to try and find out if it worked but sadly enough both solutions do not work:

127.0.0.1 ckan
127.0.0.1 datapusher

After uploading a dataset i get this:

ckan-dev_1    | 2021-06-10 17:12:11,273 DEBUG [ckanext.datapusher.plugin] Submitting resource 1caafc34-ef92-4797-aaf2-d18693f9cfc4 to DataPusher
solr          | 2277933 INFO  (qtp1989972246-20) [   x:ckan] o.a.s.c.S.Request [ckan]  webapp=/solr path=/select params={q=name:"695790ff-759d-4f73-8eb4-4552c526b64f"+OR+id:"695790ff-759d-4f73-8eb4-4552c526b64f"&fq=site_id:"default"&rows=1&wt=json} hits=1 status=0 QTime=2
datapusher    | [pid: 11|app: 0|req: 1/1] 192.168.96.6 () {36 vars in 435 bytes} [Thu Jun 10 17:12:11 2021] POST /job => generated 700 bytes in 101 msecs (HTTP/1.1 200) 2 headers in 72 bytes (1 switches on core 0)
solr          | 2278253 INFO  (qtp1989972246-13) [   x:ckan] o.a.s.u.DirectUpdateHandler2 start commit{,optimize=false,openSearcher=true,waitSearcher=true,expungeDeletes=false,softCommit=false,prepareCommit=false}
solr          | 2278253 INFO  (qtp1989972246-13) [   x:ckan] o.a.s.u.SolrIndexWriter Calling setCommitData with IW:org.apache.solr.update.SolrIndexWriter@7aa047f1    
solr          | 2278601 INFO  (qtp1989972246-13) [   x:ckan] o.a.s.c.SolrDeletionPolicy SolrDeletionPolicy.onCommit: commits: num=2
solr          |         commit{dir=NRTCachingDirectory(MMapDirectory@/opt/solr/server/solr/ckan/data/index lockFactory=org.apache.lucene.store.NativeFSLockFactory@336e3983; maxCacheMB=48.0 maxMergeSizeMB=4.0),segFN=segments_11,generation=37}
solr          |         commit{dir=NRTCachingDirectory(MMapDirectory@/opt/solr/server/solr/ckan/data/index lockFactory=org.apache.lucene.store.NativeFSLockFactory@336e3983; maxCacheMB=48.0 maxMergeSizeMB=4.0),segFN=segments_12,generation=38}
solr          | 2278601 INFO  (qtp1989972246-13) [   x:ckan] o.a.s.c.SolrDeletionPolicy newest commit generation = 38
solr          | 2278608 INFO  (qtp1989972246-13) [   x:ckan] o.a.s.s.SolrIndexSearcher Opening [Searcher@6f016b84[ckan] main]
solr          | 2278609 INFO  (searcherExecutor-7-thread-1-processing-x:ckan) [   x:ckan] o.a.s.c.QuerySenderListener QuerySenderListener sending requests to Searcher@6f016b84[ckan] main{ExitableDirectoryReader(UninvertingDirectoryReader(Uninverting(_q(6.2.1):C10/1:delGen=1) Uninverting(_s(6.2.1):C1) Uninverting(_t(6.2.1):C1) Uninverting(_u(6.2.1):C1) Uninverting(_v(6.2.1):C1) Uninverting(_y(6.2.1):C1) Uninverting(_11(6.2.1):C1)))}
solr          | 2278611 INFO  (searcherExecutor-7-thread-1-processing-x:ckan) [   x:ckan] o.a.s.c.QuerySenderListener QuerySenderListener done.
solr          | 2278611 INFO  (qtp1989972246-13) [   x:ckan] o.a.s.u.DirectUpdateHandler2 end_commit_flush
solr          | 2278611 INFO  (searcherExecutor-7-thread-1-processing-x:ckan) [   x:ckan] o.a.s.c.SolrCore [ckan] Registered new searcher Searcher@6f016b84[ckan] main{ExitableDirectoryReader(UninvertingDirectoryReader(Uninverting(_q(6.2.1):C10/1:delGen=1) Uninverting(_s(6.2.1):C1) Uninverting(_t(6.2.1):C1) Uninverting(_u(6.2.1):C1) Uninverting(_v(6.2.1):C1) Uninverting(_y(6.2.1):C1) Uninverting(_11(6.2.1):C1)))}
solr          | 2278623 INFO  (qtp1989972246-13) [   x:ckan] o.a.s.u.p.LogUpdateProcessorFactory [ckan]  webapp=/solr path=/update params={commit=true}{add=[ad8d186f2cbca8adf1c72ec67e71deb1 (1702200744687435776)],commit=} 0 398
ckan-dev_1    | 2021-06-10 17:12:12,107 INFO  [ckan.config.middleware.flask_app]  /dataset/done/resource/new render time 1.420 seconds
solr          | 2278830 INFO  (qtp1989972246-20) [   x:ckan] o.a.s.c.S.Request [ckan]  webapp=/solr path=/select params={q=name:"done"+OR+id:"done"&fq=site_id:"default"&rows=1&wt=json} hits=1 status=0 QTime=4
solr          | 2279326 INFO  (qtp1989972246-13) [   x:ckan] o.a.s.c.S.Request [ckan]  webapp=/solr path=/select params={q=*:*&facet.limit=50&df=text&fl=id+validated_data_dict&fq=%2Bowner_org:"6d6295db-36ff-40ba-a795-76ddd8106bc4"&fq=%2Bsite_id:"default"&fq=%2Bstate:active&sort=score+desc,+metadata_modified+desc&facet.mincount=1&rows=0&facet=false&wt=json} hits=11 status=0 QTime=3
solr          | 2279349 INFO  (qtp1989972246-20) [   x:ckan] o.a.s.c.S.Request [ckan]  webapp=/solr path=/select params={q=*:*&facet.limit=-1&facet.field=groups&facet.field=owner_org&fl=groups&fq=%2Bsite_id:"default"&fq=%2Bstate:active&facet.mincount=1&rows=2&facet=true&wt=json} hits=11 status=0 QTime=4
solr          | 2279824 INFO  (qtp1989972246-13) [   x:ckan] o.a.s.c.S.Request [ckan]  webapp=/solr path=/select params={q=*:*&facet.limit=50&df=text&fl=id+validated_data_dict&fq=%2Bowner_org:"6d6295db-36ff-40ba-a795-76ddd8106bc4"&fq=%2Bsite_id:"default"&fq=%2Bstate:active&sort=score+desc,+metadata_modified+desc&facet.mincount=1&rows=0&facet=false&wt=json} hits=11 status=0 QTime=1
solr          | 2279845 INFO  (qtp1989972246-20) [   x:ckan] o.a.s.c.S.Request [ckan]  webapp=/solr path=/select params={q=*:*&facet.limit=-1&facet.field=groups&facet.field=owner_org&fl=groups&fq=%2Bsite_id:"default"&fq=%2Bstate:active&facet.mincount=1&rows=2&facet=true&wt=json} hits=11 status=0 QTime=1
ckan-dev_1    | 2021-06-10 17:12:13,468 INFO  [ckan.config.middleware.flask_app]  /dataset/done render time 1.321 seconds

when i go to manage the resource and then datastore it says:
Error: Process completed but unable to post to result_url

When i click the upload to datastore it says
Error: Process completed but unable to post to result_url

And below that it display pending: 9 minutes

Aswell as when i try to preview the resource it keeps saying not available.

Adding other extension parameters to .env file / templates for extensions

Hi
I’d like to use docker-ckan to create a setup that can run as a docker container on Azure / Google cloud. To avoid saving files to containers and docker host VM I would like to use the https://github.com/TkTech/ckanext-cloudstorage

The ckanext-cloudstorage has some parameters that must go in the production.ini file:
ckanext.cloudstorage.driver = AZURE_BLOBS
ckanext.cloudstorage.container_name = demo
ckanext.cloudstorage.driver_options = {"key": "", "secret": ""}

I like the way you use .env to set parameters for production.ini and would like to put the ckanext-cloudstorage parameters in .env file as well.

I’m thinking about the following solution and would like to know what you think.

In the .env file
CKANEXT__CLOUDSTORAGE__DRIVER = AZURE_BLOBS
CKANEXT__CLOUDSTORAGE__CONTAINER_NAME = <your ...>
CKANEXT__CLOUDSTORAGE__DRIVER_OPTIONS_PUBLIC_KEY =
CKANEXT__CLOUDSTORAGE__DRIVER_OPTIONS_SECRET_KEY =

I see that in the development setup there is a start_ckan_development.sh that execute files in the "/docker-entrypoint.d" dir.

If there was a similar setup for the production setup. Then we could create several template files in "/docker-entrypoint.d" dir.
In my case a file named ckanext-cloudstorage.template
The ckanext-cloudstorage.template looking like this:

RUN paster --plugin=ckan config-tool ${CKAN_INI} "ckanext.cloudstorage.driver = ${CKANEXT__CLOUDSTORAGE__DRIVER}" && \ paster --plugin=ckan config-tool ${CKAN_INI} "ckanext.cloudstorage.container_name = ${CKANEXT__CLOUDSTORAGE__CONTAINER_NAME}" && \ paster --plugin=ckan config-tool ${CKAN_INI} "ckanext.cloudstorage.container_name = ${CKANEXT__CLOUDSTORAGE__CONTAINER_NAME}" && \ paster --plugin=ckan config-tool ${CKAN_INI} "ckanext.cloudstorage.driver_options = {"key": "${CKANEXT__CLOUDSTORAGE__DRIVER_OPTIONS_PUBLIC_KEY}", "secret": "${CKANEXT__CLOUDSTORAGE__DRIVER_OPTIONS_SECRET_KEY}" } "

So when I would like to install ckanext-cloudstorage I go to the "/docker-entrypoint.d" dir and copy the ckanext-cloudstorage.template to ckanext-cloudstorage.sh

The ckanext-cloudstorage.sh executes on sartup. Sets the parameters i the production.ini. Reloads ckan and I have a working extension.

What do you think about the idea and how do you see it can be done?

Regards
Terje

Paster not found

docker-compose -f docker-compose.dev.yml exec ckan-dev /bin/bash -c "paster --plugin=ckan create -t ckanext ckanext-myext -o /srv/app/src_extensions"

/bin/bash: paster: command not found

Requests fail when cumulative header size exceeds 4096 bytes

This occurs when container is started with uwsgi (not paster/dev mode).

To reproduce, start container and send request with long headers:

curl --request GET 'http://ckan:5000' --header 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO'

Result:

curl: (52) Empty reply from server
ckan log output: invalid request block size: 4515 (max 4096)...skip [uwsgi-http key: ckan:5000 client_addr: 172.20.0.1 client_port: 18121] hr_instance_read(): Connection reset by peer [plugins/http/http.c line 647]

I will attach a PR for this.

Stop using container_name:

The services are explicitly named using container_name:.

This is critical e.g. when deploying multiple CKAN stack on a single Docker system.

Proposal:

Either container names should be set by .env environment variables

datapusher:
    container_name: ${DATAPUSHER_CONTAINER_NAME}

or - even simpler -

we take the service names (instead of container_name:) and configure services which need to access a different service:

ckan:
    ...

datapusher:
    environment:
      - CKAN_SERVICE_NAME=ckan

Datapusher missing --enable-threads?

Hi,

thanks for this great docker composition of cKAN.

When running the stack and trying to upload/preview a csv file I do see a warning in datapusher logs that it is missing --enable--threads on uWSGI startup

"uwsgi --plugins=http,python --http=0.0.0.0:8800 --socket=/tmp/uwsgi.sock --ini=`echo ${APP_DIR}`/datapusher-uwsgi.ini --wsgi-file=`echo ${APP_DIR}`/datapusher.wsgi"]

After adding the option:

`uwsgi --plugins=http,python --http=0.0.0.0:8800 --socket=/tmp/uwsgi.sock --enable-threads --ini=`echo ${APP_DIR}`/datapusher-uwsgi.ini --wsgi-file=`echo ${APP_DIR}`/datapusher.wsgi"]`

The preview of CSV files in a datatable preview works nicely.

Thought I leave this information for others or devs in case the current is not intendent.

uWSGI harakiri uploading large files

Good morning, I am running ckan with docker and exposing it under nginx. I have problems in uploading files that take more than 60sec to be uploaded.

Following the nginx settings:

       client_max_body_size    2000M;
       uwsgi_read_timeout 360s;
       uwsgi_send_timeout 360s;
       proxy_read_timeout 360s;
       proxy_send_timeout 360s;
       include     uwsgi_params;
       proxy_set_header Host $http_host;
       proxy_set_header X-Real-IP $remote_addr;

The logs when uwsgi starts:

ckan_1   | detected max file descriptor number: 1048576
ckan_1   | lock engine: pthread robust mutexes
ckan_1   | thunder lock: disabled (you can enable it with --thunder-lock)
ckan_1   | uWSGI http bound on 0.0.0.0:5000 fd 3
ckan_1   | uwsgi socket 0 bound to UNIX address /tmp/uwsgi.sock fd 6
ckan_1   | Python version: 3.8.10 (default, May  6 2021, 00:05:59)  [GCC 10.2.1 20201203]
ckan_1   | Python main interpreter initialized at 0x7f6f8f35d060
ckan_1   | python threads support enabled
ckan_1   | your server socket listen backlog is limited to 100 connections
**ckan_1   | your mercy for graceful operations on workers is 60 seconds**

Even setting the variable UWSGI_HARAKIRI=5000 the connection is killed after 60seconds.
I am using the ckan image 2.9 from docker hub.

Are some settings missing?

Automate Docker Builds when pushing

When we push to the repo an action should kick in that builds the Docker image and pushes it to the Docker Hub registry.

These actions looks like what we need: https://github.com/marketplace/actions/build-and-push-docker-images

Building on every single commit seems a bit wasteful as not all changes affect the actual images or all images across all versions but it's a good starting point.

What's important is to build the right images, with the right Dockerfiles and right Docker tags (2.7, 2.8, 2.9 and 2.9-py2 both on ckan-base and ckan-dev)

How to add values to ckan.ini for plugin configuration

I am trying to install the SAMl2auth plugin and have to set up some configuration settings but after trying to add variables to .env and changing the ckan docker.dev file nothing happens. i already tried adding a folder docker-entrypoint.d->setup_validation.sh but also in ckan.ini the variable is not shown.

i cannot seem to add ckanext__saml2auth__user_email = email in the ckan.ini for the SAML2auth plugin it will give me an error the variable is not set.

"docker-compose up" fails on fresh build

I am trying to switch from CKAN source installation to Docker installation, but using the default .env file I am unable to get past this error on startup:

db            | initdb: error: directory "/var/lib/postgresql/data" exists but is not empty
db            | If you want to create a new database system, either remove or empty
db            | the directory "/var/lib/postgresql/data" or run initdb
db            | with an argument other than "/var/lib/postgresql/data".

I am relatively new to Docker, and I am having difficulty seeing how to get past this issue. I did make sure to remove all images and volumes first, and I tried building with the command docker-compose build --no-cache. I used Docker version 3.3.2 that had just been restored to factory settings.

Is it related to the datapusher or datastore plugins trying to create a second database? Because ultimately I'm interested in getting a running instance of CKAN with spatial harvesting working. I won't need the datapusher or datastore plugins installed.

Podman based deployment

Hi,

I will adopt this deployment to podman, which means I will reuse the images and wire them in a podman pod together.

Would you be interested in a pull request?

Debugging 2.9 with debugpy does not work with reloader

I added to the development container startup script ckan-dev/2.9/setup/start_ckan_development.sh, the following line for debugging:

sudo -u ckan -EH python3 -m debugpy --listen 0.0.0.0:5678 /usr/bin/ckan -c $CKAN_INI run -H 0.0.0.0

But this produces this error:

/usr/bin/python3: No module named ckan.__main__; 'ckan' is a package and cannot be directly executed

Disabling the reloader with -r helps.

build fails without ckan/patches directory

Hello! I just cloned the repository for the first time. Following the setup instructions, running docker-compose build failed on step 3/4 with the following error.

Step 3/4 : COPY patches ${APP_DIR}/patches
ERROR: Service 'ckan' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder230327039/patches: no such file or directory

Easy enough to fix by just adding an empty ckan/patches directory. It would be useful to either include an empty directory with a .gitkeep file or clarify in the README that a patches directory is required to build the project.

Automate image publishing

At the moment the ckan-dev version on dockerhub doesn't include the latest changes (for example installing dev-requirements.txt). Could you publish the latest version?

We could setup a CI to automate the process of updating the image after changes.
Only downside is that (as far as I know) docker compose wouldn't pull the image again if the image tag exists locally, or to make it do so like in kubernetes with imagePullPolicy.

If we want to solve this we could run docker-compose through a script that passes all the arguments to the executable and if it's docker-compose up calls docker pull first. I'm not yet convinced though.

Am I right to assume that once this becomes stable enough this could/will become part of CKAN? Would be great to get official images.

Test settings overridden by env vars

When starting in development the paster tool sets the database url in test-core.ini to the urls provided in the test environment variables.

In my test-core.ini the sqlalchemy.url is set to postgres://ckan:ckan@db/ckan_test, but when checking the value in a test reads postgresql://ckan:ckan@db/ckan. This must come from the CKAN_SQLALCHEMY_URL which CKAN interprets itself as it's only provided in the .env file.

Besides modernising CKAN's config, I can only think of two solutions at the moment

  1. Ditch ckanext-envvars but keep the ENV vars with the same naming scheme (making sure they don't get picked up by CKAN itself) and write them to the config file with the config-tool.
  2. Write something that changes the ENV vars before and after tests
    a. as a wrapper script around the test command
    b. in setup/teardown methods (wouldn't work for CKAN core?)

Both seem sub-optimal to me, any thoughts?

Upload large file

Hi I upload large file more than 500MB got error:
SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request /dataset/vxcvxcvxc/resource/new (ip 192.168.77.50) !!!
Thu Mar 3 04:51:59 2022 - uwsgi_response_writev_headers_and_body_do(): Broken pipe [core/writer.c line 306] during POST /dataset/vxcvxcvxc/resource/new (192.168.77.50)

License?

I want to borrow some resources from this repo, but there's no open source license defined. Most of CKAN uses AGPL-3.0, that seems appropriate here.

start ckan script configurable/editable

User Story

As a Docker-CKAN user, I need to be able to utilize a different way to serve the application without copying and pasting code

Details

The current start.sh scripts include much more activity and commands than simply turning on the server. It would be nice to split out lines 1-17, and run these files in sequence. Then a downstream user like catalog.data.gov can implement a start script much easier than copying and replacing code.

To be clear, this should be done for ckan, ckan-base, and ckan-dev, although currently we use ckan-dev as our deployment is test only.

CKAN - Could not load view: DataProxy returned an error

Hi,

I would like to see CSV visualization on CKAN, but only appear the next following message error: Could not load view: DataProxy returned an error.

I replicated this steps:

  • Clone (https://github.com/okfn/docker-ckan) into a directory of my choice:
  • Copy the included .env.example and rename it to .env to modify:
    - I used the default values on the .env.example file will get you a working CKAN instance.
    - I changed CKAN_SITE_URL=http://ckan:5000 by CKAN_SITE_URL=http://localhost:5000
  • Then I Built the images and started the containers

After that, when I log in as ckan-admin in http://localhost:5000/, if I add a organization and create a CVS dataset and I preview it don't appear nothing, only the message error.

Could you help me?

Thanks,
David

Datapusher failing to build.

It looks like the keitaro/base:0.4 image has been removed from the dockerhub so, because of that datapusher build is failing.

Building datapusher
Step 1/11 : FROM keitaro/base:0.4
ERROR: Service 'datapusher' failed to build: pull access denied for keitaro/base, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

[ckan 2.8][py 2.7] Install ckanext-spatial and make ckanext-harvest working

Hi I'm adding something I've had to fix to be able to install ckanext-plugin into docker-ckan.

  1. proj and pyproj can't be correctly installed (alpine 3.12) and this prevent the plugin to correctly run.
  2. The configured postgres db is not supporting postgis (requires docker db service changes)
  1. has been solved downgrading some dependencies and ignoring:
    https://github.com/ckan/ckanext-spatial/blob/master/requirements-py2.txt

The main problem is that for some reason it's impossible to have a proj correctly installed on the machine, I tried several approaches up to build it from sources... (don't try to suggest easy solutions like apk add proj-util it simply won't solve)

The command which proj will always return none

Downgrading pyproj it's not complaining anymore about native bindings (probably it won't work at runtime but at least we can go ahead...)

Also shapely is not properly working in the suggested version so I downgraded it also.

I managed to install using the following:


cd ${APP_DIR}/src_extensions/ckanext-spatial/

 # shapely and pyproj are not supported 
    # Shapely>=1.2.13 \
    # pyproj==2.2.2 \

# python setup.py develop &&\
pip install -e "git+https://github.com/ckan/ckanext-spatial.git#egg=ckanext-spatial" &&\
apk add geos &&\
pip install \
    ckantoolkit \
    GeoAlchemy>=0.6 \
    GeoAlchemy2==0.5.0 \
    shapely==1.3.0 \
    pyproj==1.9.3 \
    OWSLib==0.18.0 \
    lxml>=2.3 \
    argparse \
    pyparsing>=2.1.10 \
    requests>=1.1.0 \
    six &&\
    
paster --plugin=ckan config-tool ${APP_DIR}/production.ini \
    "ckan.spatial.validator.profiles=iso19193eden" &&\
paster --plugin=ckan config-tool ${APP_DIR}/production.ini \
    "ckan.spatial.srid=4326" &&\
paster --plugin=ckan config-tool ${APP_DIR}/production.ini \
    "ckanext.spatial.search_backend=solr" &&\
paster --plugin=ckanext-spatial spatial initdb 4326 --config=$APP_DIR/production.ini

This can be called spatial.sh and placed under docker-entrypoint.d/

  1. The db Docker file may use postgis:
# FROM postgres:11-alpine
FROM mdillon/postgis:11

Create the following file docker-entrypoint-initdb.d/30_postgis_permissions.sql:

CREATE EXTENSION POSTGIS;
ALTER VIEW geometry_columns OWNER TO ckan;
ALTER TABLE spatial_ref_sys OWNER TO ckan;

If for some reason the initialization of the db is not properly performed login on the db machine and run the above commands manually then rebuild the ckan-dev once again so the spatial initdb can do its job.

Solr Connection Issue : Max Retries and Connection Fails

Steps to Reproduce:

  1. clone this repository
  2. .env file
  3. docker-compose up

Expected Behavior:
CKAN to be up and running with all basic functionalities.

Issue:
SolrError: Failed to connect to server at 'http://localhost:8983/solr/ckan/select/?q=%2A%3A%2A&rows=1&wt=json', are you sure that URL is correct? Checking it in a browser might help: HTTPConnectionPool(host='localhost', port=8983): Max retries exceeded with url: /solr/ckan/select/?q=%2A%3A%2A&rows=1&wt=json (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f9758688d10>: Failed to establish a new connection: [Errno 111] Connection refused',))
2020-03-09 11:05:45,533 WARNI [ckan.lib.search] Problems were found while connecting to the SOLR server

Unable to create organization due to this and further a dataset etc.

Kindly suggest what is to be done.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.