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

Invalid integer error #33

Open
alycejenni opened this issue Mar 5, 2024 · 0 comments
Open

Invalid integer error #33

alycejenni opened this issue Mar 5, 2024 · 0 comments
Assignees

Comments

@alycejenni
Copy link
Member

alycejenni commented Mar 5, 2024

2024-01-25 05:06:23,710 ERROR [ckan.config.middleware.flask_app] None - {'record_id': ['Invalid integer']}
Traceback (most recent call last):
  File "/usr/lib/ckan/default/lib/python3.8/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/ckan/default/lib/python3.8/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/lib/ckan/default/lib/python3.8/site-packages/ckanext/iiif/routes/iiif.py", line 9, in resource
    result = toolkit.get_action('build_iiif_resource')({}, {'identifier': identifier})
  File "/usr/lib/ckan/default/src/ckan/ckan/logic/__init__.py", line 504, in wrapped
    result = _action(context, data_dict, **kw)
  File "/usr/lib/ckan/default/lib/python3.8/site-packages/ckantools/decorators/actions.py", line 150, in action_function
    return function(**params)
  File "/usr/lib/ckan/default/lib/python3.8/site-packages/ckanext/iiif/logic/actions.py", line 45, in build_iiif_resource
    result = builder.match_and_build(identifier)
  File "/usr/lib/ckan/default/lib/python3.8/site-packages/ckanext/iiif/builders/manifest.py", line 53, in match_and_build
    result = toolkit.get_action('record_show')(
  File "/usr/lib/ckan/default/src/ckan/ckan/logic/__init__.py", line 504, in wrapped
    result = _action(context, data_dict, **kw)
  File "/usr/lib/ckan/default/lib/python3.8/site-packages/ckanext/nhm/logic/action.py", line 33, in record_show
    raise toolkit.ValidationError(errors)
ckan.logic.ValidationError: None - {'record_id': ['Invalid integer']}

URL after the error is something like:

2024-01-25 06:45:26,909 INFO  [ckan.config.middleware.flask_app]  500 /iiif/resource/05ff2255-c38a-40c9-b657-4ccb55ab2feb/record/3507423/canvas/2/0/0 render time 0.077 seconds

This is a regex error where the /canvas/ etc is being captured as part of the record id:

regex = re.compile('resource/(?P<resource_id>.+?)/record/(?P<record_id>.+)$')

@alycejenni alycejenni self-assigned this Mar 5, 2024
@alycejenni alycejenni changed the title Triage: Invalid integer error Invalid integer error Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant