Problem:
The client encountered issues with the data-explorer view functionality in their CKAN environment. While resources could be downloaded manually, the data-explorer view was unable to load. During the initial investigation, it was found that while the “datastore” plugin was enabled in the ckan.ini
file, the ckan.datastore.write_url
and ckan.datastore.read_url
were not configured. The client was unsure whether they needed to set up a separate datastore database for PostgreSQL.
Process:
Step 1 – Initial Investigation
- The client provided the details of their CKAN setup, including the encountered error and logs. The issue seemed to stem from a missing or incomplete datastore configuration.
- The client confirmed that PostgreSQL was running on a container named
db
, with environment variables provided for connecting to the datastore:
CKAN_DATASTORE_WRITE_URL=postgresql://ckan:ckan_hossted@db/datastore CKAN_DATASTORE_READ_URL=postgresql://datastore_ro:h_datastore@db/datastore
- The expert asked for further details about the
ckan.ini
configuration and noted that, since the connection strings were defined in the environment variables, the.ini
file might not be the main issue.
Step 2 – Diagnostics and Analysis
- The expert reviewed the logs and discovered the error related to the missing configuration of
ckan.datastore.write_url
andckan.datastore.read_url
in the CKAN configuration file. This incomplete setup prevented the data-explorer view from functioning. - The client was asked to verify whether a separate datastore database existed and, if not, was advised to set it up for proper data handling in CKAN.
Step 3 – Implementing Solutions
Datastore Database Configuration:
- The expert advised the client to set up a separate datastore database in PostgreSQL for CKAN, ensuring that it had the correct permissions for both read and write operations.
- The client was instructed to update the
ckan.ini
configuration file with the appropriatewrite_url
andread_url
settings and restart CKAN for the changes to take effect. - The client performed the update and restarted CKAN using the appropriate command (
supervisorctl restart ckan
), but the issue persisted. At this point, the problem was further traced to an incomplete DataProxy configuration in theckan.ini
file.
Testing Connectivity:
- The expert suggested testing the connectivity via
curl
commands, which confirmed that the resource could be accessed via direct URLs. This pointed to an issue with CKAN’s internal settings rather than external database connectivity.
Solution:
After completing the configuration of the missing ckan.datastore.write_url
and ckan.datastore.read_url
settings in the CKAN configuration file and ensuring correct PostgreSQL permissions, the data-explorer view began functioning as expected. The client was able to access and transform data using the view.
Conclusion:
The issue was resolved by properly configuring the datastore URLs in CKAN’s settings and ensuring PostgreSQL access permissions were correctly established. This case emphasizes the importance of correct configuration management and understanding the role of environment variables in containerized applications such as CKAN.