EnviDat / ckanext-restricted

CKAN extension for restricting access to resources
GNU Affero General Public License v3.0
7 stars 26 forks source link

Error in running ckan -c /etc/ckan/default/ckan.ini run in extension #27

Closed JOCKEEY closed 2 years ago

JOCKEEY commented 2 years ago

Hi, I've already installed ckanext-scheming, ckanext-repeating and ckanext-composite. Since I've installed the required extension I attemp to install ckanext-restricted after running ckan -c /etc/ckan/default/ckan.ini run this error occured

(default) root@ccgeo:/usr/lib/ckan/default/src/ckanext-restricted# ckan -c /etc/ckan/default/ckan.ini run
2021-11-18 08:42:25,310 INFO  [ckan.cli] Using configuration file /etc/ckan/default/ckan.ini
2021-11-18 08:42:25,310 INFO  [ckan.config.environment] Loading static files from public
2021-11-18 08:42:25,337 INFO  [ckan.config.environment] Loading templates from /usr/lib/ckan/default/src/ckan/ckan/templates
Traceback (most recent call last):
  File "/usr/lib/ckan/default/bin/ckan", line 11, in <module>
    load_entry_point('ckan', 'console_scripts', 'ckan')()
  File "/usr/lib/ckan/default/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/ckan/default/lib/python3.8/site-packages/click/core.py", line 781, in main
    with self.make_context(prog_name, args, **extra) as ctx:
  File "/usr/lib/ckan/default/lib/python3.8/site-packages/click/core.py", line 700, in make_context
    self.parse_args(ctx, args)
  File "/usr/lib/ckan/default/lib/python3.8/site-packages/click/core.py", line 1212, in parse_args
    rest = Command.parse_args(self, ctx, args)
  File "/usr/lib/ckan/default/lib/python3.8/site-packages/click/core.py", line 1048, in parse_args
    value, args = param.handle_parse_result(ctx, opts, args)
  File "/usr/lib/ckan/default/lib/python3.8/site-packages/click/core.py", line 1630, in handle_parse_result
    value = invoke_param_callback(self.callback, ctx, self, value)
  File "/usr/lib/ckan/default/lib/python3.8/site-packages/click/core.py", line 123, in invoke_param_callback
    return callback(ctx, param, value)
  File "/usr/lib/ckan/default/src/ckan/ckan/cli/cli.py", line 102, in _init_ckan_config
    ctx.obj = CkanCommand(value)
  File "/usr/lib/ckan/default/src/ckan/ckan/cli/cli.py", line 52, in __init__
    self.app = make_app(self.config)
  File "/usr/lib/ckan/default/src/ckan/ckan/config/middleware/__init__.py", line 56, in make_app
    load_environment(conf)
  File "/usr/lib/ckan/default/src/ckan/ckan/config/environment.py", line 123, in load_environment
    p.load_all()
  File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 165, in load_all
    load(*plugins)
  File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 179, in load
    service = _get_service(plugin)
  File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 281, in _get_service
    return plugin.load()(name=plugin_name)
  File "/usr/lib/ckan/default/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2443, in load
    return self.resolve()
  File "/usr/lib/ckan/default/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2449, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/ckan/default/lib/python3.8/site-packages/ckanext/restricted/plugin.py", line 15, in <module>
    from pylons import config
  File "/usr/lib/ckan/default/lib/python3.8/site-packages/pylons/__init__.py", line 8, in <module>
    from pylons.controllers.util import Request
  File "/usr/lib/ckan/default/lib/python3.8/site-packages/pylons/controllers/__init__.py", line 2, in <module>
    from pylons.controllers.core import WSGIController
  File "/usr/lib/ckan/default/lib/python3.8/site-packages/pylons/controllers/core.py", line 108
    except HTTPException, httpe:
                        ^
SyntaxError: invalid syntax

Did I miss something ?

espona commented 2 years ago

Hi, from our side we only continued maintaining this branch: https://github.com/EnviDat/ckanext-restricted/tree/optimized looks like you are using an older one.

JOCKEEY commented 2 years ago

Hello @espona Thanks for the quick response. I've change my ckanext-restrict from the link you've given but error still occur.
The 3 extension I've mentioned above are only requirement to use for this extension or there is more ?

espona commented 2 years ago

The error is on the pylons library, that shouldn't happen if you are using CKAN 2.9+ I guess. We are discontinuing support for our CKAN repositories since we are moving to a new in-house developed backend. Please check if there is any active fork of this repo so you can get more support.

JOCKEEY commented 2 years ago

I'm using CKAN v2.9.4, Well thankyou @espona .

JOCKEEY commented 2 years ago

uninstall pylons 1.0.3 change to pylons==1.0