[traceback] DoesNotExist: User matching query does not exist. Kuma docs/new 500 error



Wiki pages
6 years ago
4 years ago


(Reporter: dchan, Unassigned)



(Whiteboard: u= c= s= p=, URL)



6 years ago
1. Visit
2. Server returns 500 Internal Server Error

Expected result
No server error

I think setting initial_parent_id to '' in the except block on L559 should solve the issue.

 538 def new_document(request):
 539     """Create a new wiki document."""
 540     initial_parent_id = request.GET.get('parent', '')
 554     if initial_parent_id:
 555         try:
 556             parent_doc = Document.objects.get(pk=initial_parent_id)
 557             parent_slug = parent_doc.slug
 558             parent_path = request.build_absolute_uri(parent_doc.get_absolut     e_url())
 559         except Document.DoesNotExist:
 560             logging.debug('Cannot find parent')
https://developer-dev.allizom.org/en-US/docs/CSS:normal?redirect=no, too.

Traceback (most recent call last):

  File "/data/www/developer-dev.allizom.org/kuma/vendor/src/django/django/core/handlers/base.py", line 100, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/data/www/developer-dev.allizom.org/kuma/vendor/src/django-waffle/waffle/decorators.py", line 20, in _wrapped_view
    return view(request, *args, **kwargs)

  File "/data/www/developer-dev.allizom.org/kuma/vendor/src/django/django/views/decorators/http.py", line 37, in inner
    return func(request, *args, **kwargs)

  File "/data/www/developer-dev.allizom.org/kuma/apps/wiki/views.py", line 166, in process
    return func(request, *args, **kwargs)

  File "/data/www/developer-dev.allizom.org/kuma/vendor/src/django/django/views/decorators/http.py", line 124, in inner
    response = func(request, *args, **kwargs)

  File "/data/www/developer-dev.allizom.org/kuma/vendor/src/django/django/db/transaction.py", line 271, in _autocommit
    return func(*args, **kw)

  File "/data/www/developer-dev.allizom.org/kuma/apps/wiki/views.py", line 467, in document
    response = jingo.render(request, 'wiki/document.html', data)

  File "/data/www/developer-dev.allizom.org/kuma/vendor/src/jingo/jingo/__init__.py", line 78, in render
    rendered = render_to_string(request, template, context)

  File "/data/www/developer-dev.allizom.org/kuma/vendor/src/jingo/jingo/__init__.py", line 96, in render_to_string
    return template.render(**get_context())

  File "/usr/lib64/python2.6/site-packages/jinja2/environment.py", line 891, in render
    return self.environment.handle_exception(exc_info, True)

  File "/data/www/developer-dev.allizom.org/kuma/apps/wiki/templates/wiki/document.html", line 15, in top-level template code
    {% set help_link = url('wiki.translate', document_path=document.parent.full_path, locale=document.parent.locale)|urlparams(tolocale=request.locale) %}

  File "/data/www/developer-dev.allizom.org/kuma/apps/wiki/templates/wiki/base.html", line 17, in top-level template code
    {% set scripts = ('wiki',) %}

  File "/data/www/developer-dev.allizom.org/kuma/templates/base.html", line 159, in top-level template code
    {% block content %}{% endblock %}

  File "/data/www/developer-dev.allizom.org/kuma/apps/wiki/templates/wiki/document.html", line 278, in block "content"
    {% if current_revision.creator %}

  File "/usr/lib64/python2.6/site-packages/jinja2/environment.py", line 371, in getattr
    return getattr(obj, attribute)

  File "/data/www/developer-dev.allizom.org/kuma/vendor/src/django/django/db/models/fields/related.py", line 313, in __get__
    rel_obj = QuerySet(self.field.rel.to).using(db).get(**params)

  File "/data/www/developer-dev.allizom.org/kuma/vendor/src/django/django/db/models/query.py", line 347, in get
    % self.model._meta.object_name)

DoesNotExist: User matching query does not exist.
Severity: normal → major
OS: Linux → All
Hardware: x86_64 → All
Summary: Kuma docs/new 500 error → [traceback] DoesNotExist: User matching query does not exist. Kuma docs/new 500 error
Not sure if we want to fix this. Many/most users are missing from developer-dev because it's a dev sandbox.

We might want to return a default/system user when users aren't found though.
Priority: -- → P1


6 years ago
Version: Kuma → unspecified


6 years ago
Component: Website → Landing pages
Product: Mozilla Developer Network → Mozilla Developer Network
Priority: P1 → P2
Marking this as WONTFIX as per comment 2. Luke, do we still want to return a default/system user? I can open a separate bug for that.
Flags: needinfo?(lcrouch)
Forgot to mark this as WONTFIX. Doing that now, but the question still stands.
Last Resolved: 5 years ago
Resolution: --- → WONTFIX
Let's wait on that. The main annoyance is the server error email, which will go away with Sentry.
Flags: needinfo?(lcrouch)
You need to log in before you can comment on or make changes to this bug.