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

Assertion error: Previewer with same name already registered #183

Open
ntarocco opened this issue Aug 14, 2023 · 0 comments
Open

Assertion error: Previewer with same name already registered #183

ntarocco opened this issue Aug 14, 2023 · 0 comments

Comments

@ntarocco
Copy link
Contributor

This a bug that was never fixed, the code is somehow trying to register again a previewer.

How to reproduce: not very clear path. Try the following:

  1. make sure you have stopped all servers, and then start again
  2. visit one record details page
  3. try to visit many

Issue on Sentry (if you can access, otherwise ask): https://inveniordm-sentry.web.cern.ch/sentry/demo-inveniordm/issues/481

Full stack trace:

AssertionError: Previewer with same name already registered
  File "flask/app.py", line 2528, in wsgi_app
    response = self.full_dispatch_request()
  File "flask/app.py", line 1825, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "flask/app.py", line 1823, in full_dispatch_request
    rv = self.dispatch_request()
  File "flask/app.py", line 1799, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "invenio_app_rdm/records_ui/views/decorators.py", line 82, in view
    return f(**kwargs)
  File "invenio_app_rdm/records_ui/views/decorators.py", line 126, in view
    return f(**kwargs)
  File "invenio_app_rdm/records_ui/views/decorators.py", line 207, in view
    return f(**kwargs)
  File "invenio_app_rdm/records_ui/views/records.py", line 138, in record_detail
    return render_template(
  File "flask/templating.py", line 147, in render_template
    return _render(app, template, context)
  File "flask/templating.py", line 130, in _render
    rv = template.render(context)
  File "jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/usr/local/lib/python3.9/site-packages/invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/detail.html", line 335, in top-level template code
    {%- block javascript %}
  File "/usr/local/lib/python3.9/site-packages/invenio_theme/templates/semantic-ui/invenio_theme/page.html", line 72, in top-level template code
    {%- block body %}
  File "/usr/local/lib/python3.9/site-packages/invenio_theme/templates/semantic-ui/invenio_theme/page.html", line 83, in block 'body'
    {%- block body_inner %}
  File "/usr/local/lib/python3.9/site-packages/invenio_theme/templates/semantic-ui/invenio_theme/page.html", line 91, in block 'body_inner'
    {%- block page_body %}
  File "/usr/local/lib/python3.9/site-packages/invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/detail.html", line 126, in block 'page_body'
    {%- block record_body -%}
  File "/usr/local/lib/python3.9/site-packages/invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/detail.html", line 222, in block 'record_body'
    {%- block record_files -%}
  File "/usr/local/lib/python3.9/site-packages/invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/detail.html", line 231, in block 'record_files'
    {%- if files|has_previewable_files -%}
  File "invenio_app_rdm/records_ui/views/filters.py", line 93, in has_previewable_files
    return any([is_previewable(ext) for ext in extensions])
  File "invenio_app_rdm/records_ui/views/filters.py", line 93, in <listcomp>
    return any([is_previewable(ext) for ext in extensions])
  File "invenio_previewer/views.py", line 75, in is_previewable
    return extension in current_previewer.previewable_extensions
  File "werkzeug/utils.py", line 109, in __get__
    value = self.fget(obj)  # type: ignore
  File "invenio_previewer/ext.py", line 52, in previewable_extensions
    self.load_entry_point_group(self.entry_point_group)
  File "invenio_previewer/ext.py", line 94, in load_entry_point_group
    self.register_previewer(ep.name, ep.load())
  File "invenio_previewer/ext.py", line 84, in register_previewer
    assert name not in self.previewers, \```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant