Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with CKAN ckanext-right_time_context #2

Open
tmontanaro opened this issue Aug 1, 2018 · 12 comments
Open

Problems with CKAN ckanext-right_time_context #2

tmontanaro opened this issue Aug 1, 2018 · 12 comments

Comments

@tmontanaro
Copy link

I'm trying to install the right_time_context plugin in CKAN run within a docker container, but the plugin seems to be not recognized by CKAN.

These are the steps I'm following:

  • cd /home/tempuser/tempfolder
  • git clone https://github.com/conwetlab/ckanext-right_time_context.git
  • sudo su
  • . /var/lib/docker/volumes/docker_ckan_home/_data/venv/bin/activate
  • cd /home/tempuser/tempfolder/ckanext-right_time_context
  • python setup.py install
  • sudo nano /var/lib/docker/volumes/docker_ckan_config/_data/production.ini
    • Add right_time_context to ckan.plugins and to ckan.views.default_views
  • cd /home/tempuser/tempfolder/ckan/contrib/docker
  • Recompile the docker container:
    • sudo docker-compose restart ckan

But if I see the log through sudo docker-compose logs -f ckan this is the error:

ckan          |     raise PluginNotFoundException(plugin_name)
ckan          | ckan.plugins.core.PluginNotFoundException: right_time_context
@fdelavega
Copy link
Contributor

Can you verify that the right_time_context extension has been actually installed within the CKAN virtualenv?

@tmontanaro
Copy link
Author

I don't know how to do it.
May I ask you to write down a few "instructions" to do it?

Thanks in advance

@agaldemas
Copy link

Hi @tmontanaro,
you'll find installation instruction in the documentation at:
https://fiware-ckan-extensions.readthedocs.io/en/latest/installation-administration-guide.html#right-time-context
to activate environnement type:
. /usr/lib/ckan/default/bin/activate

@KGBis
Copy link

KGBis commented Jan 23, 2020

Hi there,
same problem here trying to add this extension into the CKAN's Dockerfile. Some help needed.

I added this line after the "setup ckan" section in its docker file:

RUN mkdir $CKAN_VENV/src/rtc && cd $CKAN_VENV/src/rtc && pip install ckanext-right_time_context

and added the extension name (as per installation instructions) in the plugins section in production.ini which I bind in the docker-compose.yml file: 3.- Add right_time_context to the ckan.plugins setting in your CKAN config file...

The problem is that after executing the docker-compose up --build command it seems the plugin is correctly installed but I get the "ckan.plugins.core.PluginNotFoundException: right_time_context" and the container dies.

I've tried several name combos, but none seems to work. In the setup.py there're a pair of lines:
name='ckanext-right_time_context'

entry_points='''
[ckan.plugins]
right_time_context=ckanext.right_time_context.plugin:NgsiView
''',

Which name should I use?
Thanks in advance

@fdelavega
Copy link
Contributor

Hi,

What CKAN docker are you using, the provided by CKAN itself?

I would recommend to use the FIWARE CKAN Docker image which came with the extension already installed.

In any case the correct name is right_time_context.

For a proper installation you should activate the virtualenv with the following command (o whatever path you have in you instance):

. /usr/lib/ckan/default/bin/activate

Before executing the pip install command

@KGBis
Copy link

KGBis commented Jan 23, 2020 via email

@KGBis
Copy link

KGBis commented Jan 24, 2020

Trying to start up the FIWARE CKAN docker distro, but it refuses to run:

ckan_1 | [prerun] Initializing or upgrading db - start
ckan_1 | Traceback (most recent call last):
ckan_1 | File "/usr/local/bin/paster", line 11, in
ckan_1 | sys.exit(run())
ckan_1 | File "/usr/local/lib/python2.7/site-packages/paste/script/command.py", line 102, in run
ckan_1 | invoke(command, command_name, options, args[1:])
ckan_1 | File "/usr/local/lib/python2.7/site-packages/paste/script/command.py", line 141, in invoke
ckan_1 | exit_code = runner.run(args)
ckan_1 | File "/usr/local/lib/python2.7/site-packages/paste/script/command.py", line 236, in run
ckan_1 | result = self.command()
ckan_1 | File "/srv/app/src/ckan/ckan/lib/cli.py", line 217, in command
ckan_1 | self._load_config(cmd!='upgrade')
ckan_1 | File "/srv/app/src/ckan/ckan/lib/cli.py", line 161, in _load_config
ckan_1 | load_environment(conf.global_conf, conf.local_conf)
ckan_1 | File "/srv/app/src/ckan/ckan/config/environment.py", line 97, in load_environment
ckan_1 | p.load_all()
ckan_1 | File "/srv/app/src/ckan/ckan/plugins/core.py", line 139, in load_all
ckan_1 | load(*plugins)
ckan_1 | File "/srv/app/src/ckan/ckan/plugins/core.py", line 153, in load
ckan_1 | service = _get_service(plugin)
ckan_1 | File "/srv/app/src/ckan/ckan/plugins/core.py", line 255, in _get_service
ckan_1 | return plugin.load()(name=plugin_name)
ckan_1 | File "/usr/local/lib/python2.7/site-packages/pkg_resources/init.py", line 2361, in load
ckan_1 | return self.resolve()
ckan_1 | File "/usr/local/lib/python2.7/site-packages/pkg_resources/init.py", line 2367, in resolve
ckan_1 | module = import(self.module_name, fromlist=['name'], level=0)
ckan_1 | File "/srv/app/src/ckanext-privatedatasets/ckanext/privatedatasets/plugin.py", line 25, in
ckan_1 | from ckan.lib.plugins import DefaultPermissionLabels
ckan_1 | ImportError: cannot import name DefaultPermissionLabels
ckan_1 |
ckan_1 | Traceback (most recent call last):
ckan_1 | File "prerun.py", line 65, in
ckan_1 | init_db()
ckan_1 | File "prerun.py", line 26, in init_db
ckan_1 | raise e
ckan_1 | subprocess.CalledProcessError: Command '['paster', '--plugin=ckan', 'db', 'init', '-c', 'production.ini']' returned non-zero exit status 1

Any tip for it? I'm using the distro as-it. I pre-checked all configuration files, dockerfiles and the compose but I didn't see anything strange.

Thanks in advance

@fdelavega
Copy link
Contributor

Is this happening with latest tag?

@KGBis
Copy link

KGBis commented Jan 27, 2020 via email

@fdelavega
Copy link
Contributor

Hi,

You are using a deprecated one I think, The one with FIWARE Extensions is:

https://hub.docker.com/r/fiware/ckan-extended

@fdelavega
Copy link
Contributor

@KGBis
Copy link

KGBis commented Jan 28, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants