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

Missing module during ckan initialization #48

Open
miqbal23 opened this issue Mar 10, 2021 · 2 comments
Open

Missing module during ckan initialization #48

miqbal23 opened this issue Mar 10, 2021 · 2 comments

Comments

@miqbal23
Copy link

Hello,
I'm currently trying to deploy CKAN container with your extension (using keitaro's docker-ckan). I have followed the instruction and the build works fine, but the ckan container exited because of missing module

ckan          | /srv/app/start_ckan.sh: Ignoring /srv/app/docker-entrypoint.d/* (not an sh or py file)
ckan          |
ckan          | [prerun] Start check_db_connection...
ckan          | [prerun] Start check_solr_connection...
ckan          | [prerun] Unable to connect to solr...try again in a while.
ckan          | [prerun] Start check_solr_connection...
ckan          | [prerun] Unable to connect to solr...try again in a while.
ckan          | [prerun] Start check_solr_connection...
ckan          | [prerun] Start init_db...
ckan          | [prerun] Initializing or upgrading db - start using ckan db init
ckan          | 2021-03-10 11:04:43,925 INFO  [ckan.cli] Using configuration file /srv/app/production.ini
ckan          | 2021-03-10 11:04:43,925 INFO  [ckan.config.environment] Loading static files from public
ckan          | 2021-03-10 11:04:44,133 INFO  [ckan.config.environment] Loading templates from /srv/app/src/ckan/ckan/templates
ckan          | Traceback (most recent call last):
ckan          |   File "/usr/bin/ckan", line 33, in <module>
ckan          |     sys.exit(load_entry_point('ckan', 'console_scripts', 'ckan')())
ckan          |   File "/usr/lib/python3.8/site-packages/click/core.py", line 722, in __call__
ckan          |     return self.main(*args, **kwargs)
ckan          |   File "/usr/lib/python3.8/site-packages/click/core.py", line 696, in main
ckan          |     with self.make_context(prog_name, args, **extra) as ctx:
ckan          |   File "/usr/lib/python3.8/site-packages/click/core.py", line 621, in make_context
ckan          |     self.parse_args(ctx, args)
ckan          |   File "/usr/lib/python3.8/site-packages/click/core.py", line 1018, in parse_args
ckan          |     rest = Command.parse_args(self, ctx, args)
ckan          |   File "/usr/lib/python3.8/site-packages/click/core.py", line 880, in parse_args
ckan          |     value, args = param.handle_parse_result(ctx, opts, args)
ckan          |   File "/usr/lib/python3.8/site-packages/click/core.py", line 1403, in handle_parse_result
ckan          |     value = invoke_param_callback(
ckan          |   File "/usr/lib/python3.8/site-packages/click/core.py", line 78, in invoke_param_callback
ckan          |     return callback(ctx, param, value)
ckan          |   File "/srv/app/src/ckan/ckan/cli/cli.py", line 102, in _init_ckan_config
ckan          |     ctx.obj = CkanCommand(value)
ckan          |   File "/srv/app/src/ckan/ckan/cli/cli.py", line 52, in __init__
ckan          |     self.app = make_app(self.config)
ckan          |   File "/srv/app/src/ckan/ckan/config/middleware/__init__.py", line 56, in make_app
ckan          |     load_environment(conf)
ckan          |   File "/srv/app/src/ckan/ckan/config/environment.py", line 123, in load_environment
ckan          |     p.load_all()
ckan          |   File "/srv/app/src/ckan/ckan/plugins/core.py", line 140, in load_all
ckan          |     load(*plugins)
ckan          |   File "/srv/app/src/ckan/ckan/plugins/core.py", line 154, in load
ckan          |     service = _get_service(plugin)
ckan          |   File "/srv/app/src/ckan/ckan/plugins/core.py", line 256, in _get_service
ckan          |     return plugin.load()(name=plugin_name)
ckan          |   File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2450, in load
ckan          |     return self.resolve()
ckan          |   File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2456, in resolve
ckan          |     module = __import__(self.module_name, fromlist=['__name__'], level=0)
ckan          |   File "/usr/lib/python3.8/site-packages/ckanext/cloudstorage/plugin.py", line 6, in <module>
ckan          |     from ckanext.cloudstorage import storage
ckan          |   File "/usr/lib/python3.8/site-packages/ckanext/cloudstorage/storage.py", line 6, in <module>
ckan          |     import urlparse
ckan          | ModuleNotFoundError: No module named 'urlparse'
ckan          |
ckan          | Traceback (most recent call last):
ckan          |   File "prerun.py", line 180, in <module>
ckan          |     init_db()
ckan          |   File "prerun.py", line 85, in init_db
ckan          |     raise e
ckan          |   File "prerun.py", line 73, in init_db
ckan          |     subprocess.check_output(db_command, stderr=subprocess.STDOUT)
ckan          |   File "/usr/lib/python3.8/subprocess.py", line 411, in check_output
ckan          |     return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
ckan          |   File "/usr/lib/python3.8/subprocess.py", line 512, in run
ckan          |     raise CalledProcessError(retcode, process.args,
ckan          | subprocess.CalledProcessError: Command '['ckan', '-c', '/srv/app/production.ini', 'db', 'init']' returned non-zero exit status 1.
ckan          | [CKAN prerun] FAILED. Exiting...

Is there any solution to this?

@TkTech
Copy link
Owner

TkTech commented Mar 10, 2021

ckanext-cloudstorage is currently Py2 only, while you're trying to use it with Python 3.8. Try out this PR: #42 for Py3.8 support.

@miqbal23
Copy link
Author

I tried applied the PR, but now I got missing ckanapi library

ckan          | Traceback (most recent call last):
ckan          |   File "/usr/bin/ckan", line 33, in <module>
ckan          |     sys.exit(load_entry_point('ckan', 'console_scripts', 'ckan')())
ckan          |   File "/usr/lib/python3.8/site-packages/click/core.py", line 722, in __call__
ckan          |     return self.main(*args, **kwargs)
ckan          |   File "/usr/lib/python3.8/site-packages/click/core.py", line 696, in main
ckan          |     with self.make_context(prog_name, args, **extra) as ctx:
ckan          |   File "/usr/lib/python3.8/site-packages/click/core.py", line 621, in make_context
ckan          |     self.parse_args(ctx, args)
ckan          |   File "/usr/lib/python3.8/site-packages/click/core.py", line 1018, in parse_args
ckan          |     rest = Command.parse_args(self, ctx, args)
ckan          |   File "/usr/lib/python3.8/site-packages/click/core.py", line 880, in parse_args
ckan          |     value, args = param.handle_parse_result(ctx, opts, args)
ckan          |   File "/usr/lib/python3.8/site-packages/click/core.py", line 1403, in handle_parse_result
ckan          |     value = invoke_param_callback(
ckan          |   File "/usr/lib/python3.8/site-packages/click/core.py", line 78, in invoke_param_callback
ckan          |     return callback(ctx, param, value)
ckan          |   File "/srv/app/src/ckan/ckan/cli/cli.py", line 102, in _init_ckan_config
ckan          |     ctx.obj = CkanCommand(value)
ckan          |   File "/srv/app/src/ckan/ckan/cli/cli.py", line 52, in __init__
ckan          |     self.app = make_app(self.config)
ckan          |   File "/srv/app/src/ckan/ckan/config/middleware/__init__.py", line 56, in make_app
ckan          |     load_environment(conf)
ckan          |   File "/srv/app/src/ckan/ckan/config/environment.py", line 123, in load_environment
ckan          |     p.load_all()
ckan          |   File "/srv/app/src/ckan/ckan/plugins/core.py", line 140, in load_all
ckan          |     load(*plugins)
ckan          |   File "/srv/app/src/ckan/ckan/plugins/core.py", line 154, in load
ckan          |     service = _get_service(plugin)
ckan          |   File "/srv/app/src/ckan/ckan/plugins/core.py", line 256, in _get_service
ckan          |     return plugin.load()(name=plugin_name)
ckan          |   File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2450, in load
ckan          |     return self.resolve()
ckan          |   File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2456, in resolve
ckan          |     module = __import__(self.module_name, fromlist=['__name__'], level=0)
ckan          |   File "/usr/lib/python3.8/site-packages/ckanext/cloudstorage/plugin/__init__.py", line 13, in <module>
ckan          |     from ckanext.cloudstorage.plugin.flask_plugin import MixinPlugin
ckan          |   File "/usr/lib/python3.8/site-packages/ckanext/cloudstorage/plugin/flask_plugin.py", line 5, in <module>
ckan          |     from ckanext.cloudstorage.views import get_blueprints
ckan          |   File "/usr/lib/python3.8/site-packages/ckanext/cloudstorage/views.py", line 4, in <module>
ckan          |     import ckanext.cloudstorage.utils as utils
ckan          |   File "/usr/lib/python3.8/site-packages/ckanext/cloudstorage/utils.py", line 13, in <module>
ckan          |     from ckanapi import LocalCKAN
ckan          | ModuleNotFoundError: No module named 'ckanapi'

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

2 participants