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

TypeError occurs when creating a harvest_source. #491

Open
dassolkim opened this issue Mar 10, 2022 · 1 comment
Open

TypeError occurs when creating a harvest_source. #491

dassolkim opened this issue Mar 10, 2022 · 1 comment

Comments

@dassolkim
Copy link

I am using ckan versions 2.9.5.
I tried to create a harvest_source in the UI (localhost:5000/harvest), but the error below occurred.

2022-03-10 15:32:01,615 ERROR [ckan.config.middleware.flask_app] str cannot be used as validator because it is not a user-defined function
Traceback (most recent call last):
  File "/home/dskim/ckan/lib/default/src/ckan/ckan/lib/navl/dictization_functions.py", line 246, in convert
    nargs = converter.__code__.co_argcount
AttributeError: type object 'str' has no attribute '__code__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/ckan/default/lib/python3.8/site-packages/flask/app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/ckan/default/lib/python3.8/site-packages/flask/app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/usr/lib/ckan/default/lib/python3.8/site-packages/flask/views.py", line 84, in view
    return current_app.ensure_sync(self.dispatch_request)(*args, **kwargs)
  File "/usr/lib/ckan/default/lib/python3.8/site-packages/flask/views.py", line 158, in dispatch_request
    return current_app.ensure_sync(meth)(*args, **kwargs)
  File "/home/dskim/ckan/lib/default/src/ckan/ckan/config/middleware/../../views/dataset.py", line 615, in post
    pkg_dict = get_action(u'package_create')(context, data_dict)
  File "/home/dskim/ckan/lib/default/src/ckan/ckan/logic/__init__.py", line 523, in wrapped
    result = _action(context, data_dict, **kw)
  File "/home/dskim/ckan/lib/default/src/ckan/ckan/logic/action/create.py", line 180, in package_create
    data, errors = lib_plugins.plugin_validate(
  File "/home/dskim/ckan/lib/default/src/ckan/ckan/lib/plugins.py", line 328, in plugin_validate
    return validate(data_dict, schema, context)
  File "/home/dskim/ckan/lib/default/src/ckan/ckan/lib/navl/dictization_functions.py", line 307, in validate
    flat_data, errors = _validate(flattened, schema, validators_context)
  File "/home/dskim/ckan/lib/default/src/ckan/ckan/lib/navl/dictization_functions.py", line 360, in _validate
    convert(converter, key, converted_data, errors, context)
  File "/home/dskim/ckan/lib/default/src/ckan/ckan/lib/navl/dictization_functions.py", line 250, in convert
    raise TypeError(
TypeError: str cannot be used as validator because it is not a user-defined function

image

@dassolkim dassolkim changed the title TypeError error occurs when creating a harvest_source. TypeError occurs when creating a harvest_source. Mar 10, 2022
@SeffatChowdhury
Copy link

I can report the same behavior with CKAN v2.9 running on docker

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