Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
  • Mayan EDMS Mayan EDMS
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 206
    • Issues 206
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 10
    • Merge requests 10
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Mayan EDMS
  • Mayan EDMSMayan EDMS
  • Issues
  • #1052
Closed
Open
Created Nov 01, 2021 by Johannes Bornhold@joh5

KeyError after upgrade to 4.1.2

Did recently upgrade two instances of EDMS to v4.1.2, from the version 3.4.11. Since this change I observe exceptions for around two thirds of the requests going into the cabinet tree due to a KeyError.

The traceback which I see is as follows:

mayan.apps.logging.middleware.error_logging <41> [ERROR] "process_exception() line 17 Exception caught by request middleware; <WSGIRequest: GET '/cabinets/cabinets/61/?page=2'>, 'resolved_object'"
Traceback (most recent call last):
  File "/opt/mayan-edms/lib/python3.7/site-packages/django/core/handlers/base.py", line 143, in _get_response
    response = response.render()
  File "/opt/mayan-edms/lib/python3.7/site-packages/django/template/response.py", line 106, in render
    self.content = self.rendered_content
  File "/opt/mayan-edms/lib/python3.7/site-packages/django/template/response.py", line 83, in rendered_content
    content = template.render(context, self._request)
  File "/opt/mayan-edms/lib/python3.7/site-packages/django/template/backends/django.py", line 61, in render
    return self.template.render(context)
  File "/opt/mayan-edms/lib/python3.7/site-packages/django/template/base.py", line 171, in render
    return self._render(context)
  File "/opt/mayan-edms/lib/python3.7/site-packages/django/template/base.py", line 163, in _render
    return self.nodelist.render(context)
  File "/opt/mayan-edms/lib/python3.7/site-packages/django/template/base.py", line 937, in render
    bit = node.render_annotated(context)
  File "/opt/mayan-edms/lib/python3.7/site-packages/django/template/base.py", line 904, in render_annotated
    return self.render(context)
  File "/opt/mayan-edms/lib/python3.7/site-packages/django/template/loader_tags.py", line 150, in render
    return compiled_parent._render(context)
  File "/opt/mayan-edms/lib/python3.7/site-packages/django/template/base.py", line 163, in _render
    return self.nodelist.render(context)
  File "/opt/mayan-edms/lib/python3.7/site-packages/django/template/base.py", line 937, in render
    bit = node.render_annotated(context)
  File "/opt/mayan-edms/lib/python3.7/site-packages/django/template/base.py", line 904, in render_annotated
    return self.render(context)
  File "/opt/mayan-edms/lib/python3.7/site-packages/django/template/defaulttags.py", line 398, in render
    return strip_spaces_between_tags(self.nodelist.render(context).strip())
  File "/opt/mayan-edms/lib/python3.7/site-packages/django/template/base.py", line 937, in render
    bit = node.render_annotated(context)
  File "/opt/mayan-edms/lib/python3.7/site-packages/django/template/base.py", line 904, in render_annotated
    return self.render(context)
  File "/opt/mayan-edms/lib/python3.7/site-packages/django/template/defaulttags.py", line 309, in render
    return nodelist.render(context)
  File "/opt/mayan-edms/lib/python3.7/site-packages/django/template/base.py", line 937, in render
    bit = node.render_annotated(context)
  File "/opt/mayan-edms/lib/python3.7/site-packages/django/template/base.py", line 904, in render_annotated
    return self.render(context)
  File "/opt/mayan-edms/lib/python3.7/site-packages/django/template/library.py", line 192, in render
    output = self.func(*resolved_args, **resolved_kwargs)
  File "/opt/mayan-edms/lib/python3.7/site-packages/mayan/apps/navigation/templatetags/navigation_tags.py", line 55, in navigation_resolve_menus
    context=context, name=name, source=source, sort_results=sort_results
  File "/opt/mayan-edms/lib/python3.7/site-packages/mayan/apps/navigation/templatetags/navigation_tags.py", line 13, in _navigation_resolve_menu
    context=context, source=source, sort_results=sort_results
  File "/opt/mayan-edms/lib/python3.7/site-packages/mayan/apps/navigation/classes.py", line 509, in resolve
    as_resolved_object=True
  File "/opt/mayan-edms/lib/python3.7/site-packages/mayan/apps/navigation/classes.py", line 585, in resolve_matched_links
    resolved_link = link.resolve(**kwargs)
  File "/opt/mayan-edms/lib/python3.7/site-packages/mayan/apps/navigation/classes.py", line 162, in resolve
    if not self.check_condition(context=context, resolved_object=resolved_object):
  File "/opt/mayan-edms/lib/python3.7/site-packages/mayan/apps/navigation/classes.py", line 41, in check_condition
    context=context, resolved_object=resolved_object
  File "/opt/mayan-edms/lib/python3.7/site-packages/mayan/apps/cabinets/links.py", line 23, in condition_cabinet_is_root
    return context['resolved_object'].is_root_node()
  File "/opt/mayan-edms/lib/python3.7/site-packages/django/template/context.py", line 83, in __getitem__
    raise KeyError(key)
KeyError: 'resolved_object'

In order to reproduce the issue, I just have to open the Cabinets overview or a specific page within a Cabinet. Example paths:

  • GET '/cabinets/cabinets/61/?page=2'
  • GET '/cabinets/cabinets/'

I've not yet managed to set up a test instance and reproduce the issue there from scratch. If I manage to do so I'll comment here on the issue with the details.

Assignee
Assign to
Time tracking