Skip to content

Problem installing extensions in dev mode #254

Open

Description

@Tegomena

Hello,

I successfully setup a docker compose based dev environment. Now, I want to add some extensions to instance, but was not successfull, maybe I missed something.

I "git cloned" the extensions into the src folder (for example, the "scheming" extension). Then, I run bin/install_src and it ended up successfully:

Successfully built ckanext-scheming
Installing collected packages: ckanext-scheming
Successfully installed ckanext-scheming-3.1.0

Now, in the .env file, I changed/added (the file ckan_dataset.json lies beside the scheming extension):

CKAN__PLUGINS="image_view text_view datatables_view datastore datapusher envvars scheming_datasets"
scheming.dataset_schemas = ckanext.scheming:ckan_dataset.json

After restarting the whole docker compose stack (or using the commands in bin), the scheming is not active. Taking a look at the logs of the Docker container, I can see that it seems to use /srv/app/ckan.ini (an empty default?) as config and not the stuff from the .env file:

[prerun] Setting the following plugins in /srv/app/ckan.ini:
image_view text_view datatables_view datastore datapusher envvars

Thanks for any help!

Activity

  1. rzmk commented on Aug 3, 2026

    @rzmk

    I'm also having similar issues such as the /srv/app/ckan.ini file not being populated with the .env values.

  2. Tegomena commented on Aug 4, 2026

    @Tegomena
    Author

    I'm not sure if this is the problem, but inside the container, the script /srv/app/install_src.sh ends with the following lines, maybe pointing to the wrong file:

     # Point `use` in test.ini to location of `test-core.ini`
            if [ -f $i/test.ini ];
            then
                echo "Updating \`test.ini\` reference to \`test-core.ini\` for plugin $i"
                ckan config-tool $i/test.ini "use = config:../../src/ckan/test-core.ini"
            fi
    
  3. Tegomena commented on Aug 4, 2026

    @Tegomena
    Author

    I'm a step forward: it seems so that the docker containers have to be stopped before executing the install_src command. Now I have inside the container in /srv/app/ckan.ini the scheming extension enabled:

    ckan.plugins = image_view text_view datatables_view datastore datapusher envvars scheming_datasets
    

    Next question comes up: to configure the scheming extension, I added to the .env file:

    scheming.dataset_schemas = ckanext.scheming:ckan_dataset.json
    

    pointing to the metadata schema in "ckan_dataset.json" inside the scheming folder. But this variable is not given through to /srv/app/ckan.ini , so that the definition in ckan_dataset.json is not activated.

    How can I pass this kind of parameter from .env to the cakn.ini file?

  4. rzmk commented on Aug 4, 2026

    @rzmk

    Since the CKAN container uses ckanext-envvars, you'll need to define .env with the format mentioned in the ckanext-envvars README: https://github.com/ckan/ckanext-envvars

    However I still don't have the .env file values added to the ckan.ini file rather they exist in the container's environment variables (e.g. running the env command in the CKAN container). Perhaps that's expected behavior and CKAN should pick up the environment variables and override the values.

  5. Tegomena commented on Aug 5, 2026

    @Tegomena
    Author

    @rzmk thanks a lot, I was not aware of that syntax. And as I went through the docs, maybe this will help you (as it was also an issue for me):

    To ensure all config settings are overridden by env var values, envvars must be the last plugin entry in the ckan.plugins list (see 'Installation' below).

  6. rzmk commented on Aug 5, 2026

    @rzmk

    Thanks I made that change, not sure if it was fixed before or after making the change but the environment variables are being used. Also if you're new to developing CKAN extensions there's this work-in-progress guide that @smotornyuk has been writing that has parts which have been useful to me: https://extension-modernization.readthedocs.io/en/latest/


    @smotornyuk As an aside if ckan/ckan-docker is ideal for CKAN extension development then maybe in the modernization docs there could be a new tutorial or in the existing tutorial here there could be a follow-along tutorial on how to set up a development environment using ckan/ckan-docker and an example of how to develop a CKAN extension with this setup?

    The guided tutorial could be very helpful for new CKAN extension developers with common flows (e.g. how to set up the dev environment, how to install an extension in your development environment, set up the .env file, etc.) and then point to the other pages in the docs which already exist for specific scenarios like adding tests and so on. Perhaps this could be added as an issue to the website's GitHub issues.

    "Tutorials are lessons that take the reader by the hand through a series of steps to complete a project of some kind. They are what your project needs in order to show a beginner that they can achieve something with it."

  7. smotornyuk commented on Aug 6, 2026

    @smotornyuk
    Member

    Great idea. I'm aiming to merge the majority of pages from modernization docs into official CKAN documentation eventually. For now, it's more like a polygon for new idea verification and more frequently updated guidance - while CKAN docs are updated only with new patch releases, the modernization guide is not bound to the release cycle and can be updated as often as needed.

    I'll try to work on docker-based lesson, but of course I'm not insisting on being dictator here and writing pages by myself - all PRs and ideas are welcome :) BTW, here's the repo

    Probably it also worth introducing some kind of badge to mark new and recently modified pages, so that people who are already checking these docs are aware of updates.

  8. Tegomena commented on Aug 6, 2026

    @Tegomena
    Author

    Thanks, it would be great to have a complete documentation on development in a Docker based environment. I "inherited" some extensions we are using internally and tried to setup a Docker based dev platform. I had to google a lot and needed some help from here, but most stuff works now (still not 100% working, but I'm getting closer ;-) )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions