The installation instructions on https://docs.ckan.org/en/2.9/maintaining/installing/install-from-source.html are fine, except:
- I don't install Solr locally on the same machine, so I don't need to install Solr, Jetty or Java. Installing the required packages is therefore done like this:
$ sudo apt-get install python3-dev postgresql libpq-dev python3-pip python3-venv git-core redis-server
- Since Solr does not run on localhost, we need to access it via its IP address. This is reflected in the
solr_url
setting in CKAN config (/etc/ckan/default/ckan.ini
). IP varies, obviously:
solr_url = http://192.168.65.1:8983/solr/ckan
- In my case, CKAN is running on a multipass Ubuntu, while Solr was running on a Docker image that was reachable on the host system on localhost:8983. To figure out the IP to reach the host system's localhost from the multipass guest (here with the name
ckan
), do (see https://discourse.ubuntu.com/t/getting-macbook-ip-address-from-multipass-docker/29687):
$ multipass exec ckan -- ip route
default via 192.168.65.1 dev enp0s1 proto dhcp src 192.168.65.13 metric 100
192.168.65.0/24 dev enp0s1 proto kernel scope link src 192.168.65.13
192.168.65.1 dev enp0s1 proto dhcp scope link src 192.168.65.13 metric 100
192.168.65.1
is the IP you're looking for
CKAN has a dependency on zope.interface
in its requirements.txt
. Installing this fails in combination with the version of setuptools and pip that are installed if following the official instructions. See ckan/ckan#6427.
The error is:
...
Collecting zope.interface==4.3.2 (from -r requirements.txt (line 59))
Downloading zope.interface-4.3.2.tar.gz (143 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 143.1/143.1 kB 969.8 kB/s eta 0:00:00
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-ybbkri6l/zope-interface_9365df6e74b54f41ba5d1daedc09a31d/setup.py", line 26, in <module>
from setuptools import setup, Extension, Feature
ImportError: cannot import name 'Feature' from 'setuptools' (/usr/lib/ckan/default/lib/python3.8/site-packages/setuptools/__init__.py)
[end of output]
The solution for me was to pin setuptools to version 45 (not sure if that has any bearing on the problem) and pip to version 22.0.4:
$ pip install setuptools==45
$ pip install pip==22.0.4
Following the instructions for a deployment via Nginx (rather than just uswgi on port 5000), I get a webassets-related permissions error:
PermissionError: [Errno 13] Permission denied: '/tmp/webassets/.webassets-cache/14026a1632531c2b1445ac9963f41c0b'
This is because the user running Nginx is www-data
, but /tmp/webassets
was owned by another user (ubuntu
in my case).
So, the following resolves this issue:
$ sudo chown -R www-data /tmp/webassets/