bugzilla.mozilla.org will be intermittently unavailable on Saturday, March 24th, from 16:00 until 20:00 UTC.

[traceback] DoesNotExist: Revision matching query does not exist - /docs/mozilla-central



Infrastructure & Operations
WebOps: Other
6 years ago
5 years ago


(Reporter: stephend, Assigned: jakem)



(Whiteboard: [service-interrupt], URL)



6 years ago
https://developer.mozilla.org/en-US/docs/mozilla-central throws a 500/traceback:

Traceback (most recent call last):

  File "/data/www/developer.mozilla.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.mozilla.org/kuma/vendor/src/django-waffle/waffle/decorators.py", line 20, in _wrapped_view
    return view(request, *args, **kwargs)

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

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

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

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

  File "/data/www/developer.mozilla.org/kuma/apps/wiki/views.py", line 290, in document
    if (not doc.current_revision and doc.parent and

  File "/data/www/developer.mozilla.org/kuma/vendor/src/django/django/db/models/fields/related.py", line 311, in __get__
    rel_obj = rel_mgr.using(db).get(**params)

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

DoesNotExist: Revision matching query does not exist.
Component: Docs Platform → Editing
Product: Mozilla Developer Network → Mozilla Developer Network

Comment 1

6 years ago
John, who can take this?
So, what I suspect is going on here is that current_revision is set, but to an invalid revision ID. Which means the document thinks it has a current revision, but then can't find it.

Solution is going to involve

1) Manually querying the live DB to find out what current_revision_id is for document 15195 (which is the one that's causing the problem).

2) Probably manually doing an UPDATE to set its current_revision_id to 129656 (which is the latest valid revision in the DB for that document).
(In reply to James Bennett [:ubernostrum] from comment #2)

Specifically, to find out what the document thinks its current revision is:

SELECT current_revision_id FROM wiki_document WHERE wiki_document.id = 15195;

That'll return what's most likely an invalid ID, but can be checked by doing

SELECT document_id FROM wiki_revision WHERE wiki_revision.id = (whatever came out of the first query);

And probably the fix is

UPDATE wiki_document SET current_revision_id = 129656 WHERE wiki_document.id = 15195;
WebOps: Please see comment 2 and comment 3.

Maybe we could set up some time for you guys to meet with James on IRC to work through this.
Assignee: nobody → server-ops-webops
Component: Editing → Server Operations: Web Operations
Product: Mozilla Developer Network → mozilla.org
QA Contact: cshields
Version: unspecified → other


6 years ago
Assignee: server-ops-webops → nmaul

Comment 5

6 years ago

current_revision_id was 304723. Set to the one recommended in comment 3.

mysql> SELECT document_id FROM wiki_revision WHERE wiki_revision.id = 304723;
Empty set (0.00 sec)

mysql> SELECT document_id FROM wiki_revision WHERE wiki_revision.id = 304722;
Empty set (0.00 sec)

mysql> SELECT document_id FROM wiki_revision WHERE wiki_revision.id = 304721;
| document_id |
|        4693 |
1 row in set (0.00 sec)

Also note, the current revision id now (129656) appears to be newer than the previous one, but is a much lower ID number:


Maybe this means nothing, but it seems strange. I would expect revision numbers to only increase...
Last Resolved: 6 years ago
Resolution: --- → FIXED
Whiteboard: [service interrupt]


6 years ago
Whiteboard: [service interrupt] → [service-interrupt]

Comment 6

6 years ago
Verified FIXED:

[10:31:32.575] GET https://developer.mozilla.org/en-US/docs/mozilla-central [HTTP/1.1 200 OK 213ms]
Component: Server Operations: Web Operations → WebOps: Other
Product: mozilla.org → Infrastructure & Operations
You need to log in before you can comment on or make changes to this bug.