inveniosoftware / invenio-app-rdm

Turn-key research data management platform.
https://inveniordm.docs.cern.ch
MIT License
110 stars 149 forks source link

BuildError: Could not build url for endpoint 'deposit_create' #2917

Closed Samk13 closed 19 hours ago

Samk13 commented 5 days ago

Package version (if known): 13.0.0b1.dev18

Describe the bug

Deleting a draft will result in: BuildError werkzeug.routing.exceptions.BuildError: Could not build url for endpoint 'deposit_create'. Did you mean 'oaiset.create_view' instead?

Steps to Reproduce

  1. fill in a minimum draft
  2. save it, preview it, and go back to the deposit page
  3. click delete
  4. See error BuildError:

Expected behavior

Not getting punched by an error. 🥊👊

Logs (if applicable)

127.0.0.1 - - [21/Nov/2024 00:31:22] "GET /me/uploads HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/home/user/.pyenv/versions/3.12.6/envs/latest-build/lib/python3.12/site-packages/flask/app.py", line 2552, in __call__
    return self.wsgi_app(environ, start_response)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.pyenv/versions/3.12.6/envs/latest-build/lib/python3.12/site-packages/werkzeug/middleware/proxy_fix.py", line 187, in __call__
    return self.app(environ, start_response)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.pyenv/versions/3.12.6/envs/latest-build/lib/python3.12/site-packages/werkzeug/middleware/dispatcher.py", line 78, in __call__
    return app(environ, start_response)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.pyenv/versions/3.12.6/envs/latest-build/lib/python3.12/site-packages/flask/app.py", line 2532, in wsgi_app
    response = self.handle_exception(e)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.pyenv/versions/3.12.6/envs/latest-build/lib/python3.12/site-packages/flask/app.py", line 2529, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.pyenv/versions/3.12.6/envs/latest-build/lib/python3.12/site-packages/flask/app.py", line 1825, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.pyenv/versions/3.12.6/envs/latest-build/lib/python3.12/site-packages/flask/app.py", line 1823, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.pyenv/versions/3.12.6/envs/latest-build/lib/python3.12/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.pyenv/versions/3.12.6/envs/latest-build/lib/python3.12/site-packages/flask_login/utils.py", line 290, in decorated_view
    return current_app.ensure_sync(func)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/INVENIO/issues/invenio-app-rdm/invenio_app_rdm/users_ui/views/dashboard.py", line 25, in uploads
    return render_template(
           ^^^^^^^^^^^^^^^^
  File "/home/user/.pyenv/versions/3.12.6/envs/latest-build/lib/python3.12/site-packages/flask/templating.py", line 147, in render_template
    return _render(app, template, context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.pyenv/versions/3.12.6/envs/latest-build/lib/python3.12/site-packages/flask/templating.py", line 130, in _render
    rv = template.render(context)
         ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.pyenv/versions/3.12.6/envs/latest-build/lib/python3.12/site-packages/jinja2/environment.py", line 1304, in render
    self.environment.handle_exception()
  File "/home/user/.pyenv/versions/3.12.6/envs/latest-build/lib/python3.12/site-packages/jinja2/environment.py", line 939, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/home/user/INVENIO/issues/invenio-app-rdm/invenio_app_rdm/users_ui/templates/semantic-ui/invenio_app_rdm/users/uploads.html", line 11, in top-level template code
    {% set active_dashboard_menu_item = 'uploads' %}
  File "/home/user/INVENIO/issues/invenio-app-rdm/invenio_app_rdm/users_ui/templates/semantic-ui/invenio_app_rdm/users/base.html", line 8, in top-level template code
    {%- extends config.BASE_TEMPLATE %}
  File "/home/user/INVENIO/issues/invenio-app-rdm/invenio_app_rdm/theme/templates/semantic-ui/invenio_app_rdm/page.html", line 11, in top-level template code
    {%- extends "invenio_theme/page.html" -%}
  File "/home/user/.pyenv/versions/3.12.6/envs/latest-build/lib/python3.12/site-packages/invenio_theme/templates/semantic-ui/invenio_theme/page.html", line 86, in top-level template code
    {%- block body %}
  File "/home/user/.pyenv/versions/3.12.6/envs/latest-build/lib/python3.12/site-packages/invenio_theme/templates/semantic-ui/invenio_theme/page.html", line 97, in block 'body'
    {%- block body_inner %}
  File "/home/user/INVENIO/issues/invenio-app-rdm/invenio_app_rdm/theme/templates/semantic-ui/invenio_app_rdm/page.html", line 21, in block 'body_inner'
    {%- block page_body %}
  File "/home/user/INVENIO/issues/invenio-app-rdm/invenio_app_rdm/users_ui/templates/semantic-ui/invenio_app_rdm/users/base.html", line 12, in block 'page_body'
    {%- block user_dashboard_header %}
  File "/home/user/INVENIO/issues/invenio-app-rdm/invenio_app_rdm/users_ui/templates/semantic-ui/invenio_app_rdm/users/base.html", line 13, in block 'user_dashboard_header'
    {% include "invenio_app_rdm/users/header.html" %}
  File "/home/user/INVENIO/issues/invenio-app-rdm/invenio_app_rdm/users_ui/templates/semantic-ui/invenio_app_rdm/users/header.html", line 26, in top-level template code
    <a class="ui tiny button positive left labeled icon m-0" href={{ url_for("deposit_create") }}>
  File "/home/user/.pyenv/versions/3.12.6/envs/latest-build/lib/python3.12/site-packages/flask/app.py", line 2034, in url_for
    return self.handle_url_build_error(error, endpoint, values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.pyenv/versions/3.12.6/envs/latest-build/lib/python3.12/site-packages/flask/app.py", line 2023, in url_for
    rv = url_adapter.build(  # type: ignore[union-attr]
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.pyenv/versions/3.12.6/envs/latest-build/lib/python3.12/site-packages/werkzeug/routing/map.py", line 917, in build
    raise BuildError(endpoint, values, method, self)
werkzeug.routing.exceptions.BuildError: Could not build url for endpoint 'deposit_create'. Did you mean 'oaiset.create_view' instead?
utnapischtim commented 19 hours ago

that should be fixed by dev19 because of this commit

utnapischtim commented 19 hours ago

please reopen if not