Closed Bug 612869 Opened 14 years ago Closed 14 years ago

Clicking on some existing articles displays "An Error Occured"

Categories

(support.mozilla.org :: Knowledge Base Software, task, P2)

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: scoobidiver, Assigned: erik)

References

Details

When I click on https://support-stage.mozilla.com/fr/kb/Installer%20Firefox, "An Error Occured" is displayed.
Stack trace:

Traceback (most recent call last):

  File "/data/www/support-stage-new.mozilla.com/kitsune/vendor/src/django/django/core/handlers/base.py", line 100, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/data/www/support-stage-new.mozilla.com/kitsune/vendor/src/django/django/views/decorators/http.py", line 37, in inner
    return func(request, *args, **kwargs)

  File "/data/www/support-stage-new.mozilla.com/kitsune/apps/wiki/views.py", line 119, in document
    return jingo.render(request, 'wiki/document.html', data)

  File "/data/www/support-stage-new.mozilla.com/kitsune/vendor/src/jingo/jingo/__init__.py", line 78, in render
    rendered = render_to_string(request, template, context)

  File "/data/www/support-stage-new.mozilla.com/kitsune/vendor/src/jingo/jingo/__init__.py", line 96, in render_to_string
    return template.render(**get_context())

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

  File "/data/www/support-stage-new.mozilla.com/kitsune/apps/wiki/templates/wiki/document.html", line 6, in top-level template code
    {% set classes = 'document' %}

  File "/data/www/support-stage-new.mozilla.com/kitsune/apps/wiki/templates/wiki/base.html", line 15, in top-level template code
    {% set top_text = _('Firefox Help') %}

  File "/data/www/support-stage-new.mozilla.com/kitsune/templates/layout/base.html", line 58, in top-level template code
    {% block content_area %}

  File "/data/www/support-stage-new.mozilla.com/kitsune/apps/wiki/templates/wiki/base.html", line 34, in block "content_area"
    {% block content %}

  File "/data/www/support-stage-new.mozilla.com/kitsune/apps/wiki/templates/wiki/document.html", line 26, in block "content"
    {% if document.is_majorly_outdated() %}

  File "/data/www/support-stage-new.mozilla.com/kitsune/apps/wiki/models.py", line 413, in is_majorly_outdated
    significance__gte=MAJOR_SIGNIFICANCE).exists()

  File "/data/www/support-stage-new.mozilla.com/kitsune/vendor/src/django/django/db/models/manager.py", line 141, in filter
    return self.get_query_set().filter(*args, **kwargs)

  File "/data/www/support-stage-new.mozilla.com/kitsune/vendor/src/django/django/db/models/query.py", line 550, in filter
    return self._filter_or_exclude(False, *args, **kwargs)

  File "/data/www/support-stage-new.mozilla.com/kitsune/vendor/src/django/django/db/models/query.py", line 568, in _filter_or_exclude
    clone.query.add_q(Q(*args, **kwargs))

  File "/data/www/support-stage-new.mozilla.com/kitsune/vendor/src/django/django/db/models/sql/query.py", line 1128, in add_q
    can_reuse=used_aliases)

  File "/data/www/support-stage-new.mozilla.com/kitsune/vendor/src/django/django/db/models/sql/query.py", line 1000, in add_filter
    raise ValueError("Cannot use None as a query value")

ValueError: Cannot use None as a query value


<WSGIRequest
GET:<QueryDict: {}>,
POST:<QueryDict: {}>,
COOKIES:{'SSID': 'AwAfwSkAAAAA-NjXTLoQCwL42NdMBAAAAAAAAAAAAAAAAABrwuNMAAAAAAAAAAAAAAA',
 'SSLB': '0',
 'SSRT': 'a8LjTAA',
 'SSSC': '1.G5537132826573082810.4.0.0',
 'SUMOloggedin': 'true',
 'SUMOv1': 'a7ruasl5vi6u7fdna6ctknhou1',
 'WT_FPC': 'id=93.0.19.136-304970160.30113040:lv=1289972580104:ss=1289964899310',
 'csrftoken': '28f63cb7cb9c63f3632e8842efe8e05c',
 'sessionid': 'ab299c24d1a30200ae627acbe17079cc',
 'wtspl': '949485'},
META:{'CSRF_COOKIE': '28f63cb7cb9c63f3632e8842efe8e05c',
 'DOCUMENT_ROOT': '/data/www/support-stage-new.mozilla.com/webroot',
 'GATEWAY_INTERFACE': 'CGI/1.1',
 'HTTPS': 'on',
 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
 'HTTP_ACCEPT_LANGUAGE': 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3',
 'HTTP_CONNECTION': 'keep-alive',
 'HTTP_COOKIE': 'wtspl=949485; WT_FPC=id=93.0.19.136-304970160.30113040:lv=1289972580104:ss=1289964899310; SSID=AwAfwSkAAAAA-NjXTLoQCwL42NdMBAAAAAAAAAAAAAAAAABrwuNMAAAAAAAAAAAAAAA; SSRT=a8LjTAA; SSLB=0; SSSC=1.G5537132826573082810.4.0.0; csrftoken=28f63cb7cb9c63f3632e8842efe8e05c; SUMOv1=a7ruasl5vi6u7fdna6ctknhou1; SUMOloggedin=true; sessionid=ab299c24d1a30200ae627acbe17079cc',
 'HTTP_HOST': 'support-stage.mozilla.com',
 'HTTP_KEEP_ALIVE': '115',
 'HTTP_MOZ_REQ_METHOD': 'HTTPS',
 'HTTP_REFERER': 'https://support-stage.mozilla.com/fr/kb/all?page=7',
 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b7) Gecko/20100101 Firefox/4.0b7',
 'HTTP_X_FORWARDED_FOR': '93.0.19.136',
 'PATH_INFO': u'/fr/kb/Installer Firefox',
 'PATH_TRANSLATED': 'redirect:/k/fr/kb/Installer Firefox/kb/Installer Firefox',
 'QUERY_STRING': '',
 'REDIRECT_HTTPS': 'on',
 'REDIRECT_SCRIPT_URI': 'https://support-stage.mozilla.com/fr/kb/Installer Firefox',
 'REDIRECT_SCRIPT_URL': '/fr/kb/Installer Firefox',
 'REDIRECT_STATUS': '200',
 'REDIRECT_URL': '/fr/kb/Installer Firefox',
 'REMOTE_ADDR': '10.2.81.4',
 'REMOTE_PORT': '53437',
 'REQUEST_METHOD': 'GET',
 'REQUEST_URI': '/fr/kb/Installer%20Firefox',
 'SCRIPT_FILENAME': '/data/www/support-stage-new.mozilla.com/kitsune/wsgi/kitsune.wsgi',
 'SCRIPT_NAME': u'',
 'SCRIPT_URI': 'https://support-stage.mozilla.com/fr/kb/Installer Firefox',
 'SCRIPT_URL': '/fr/kb/Installer Firefox',
 'SERVER_ADDR': '10.2.81.207',
 'SERVER_ADMIN': 'webmaster@mozilla.com',
 'SERVER_NAME': 'support-stage.mozilla.com',
 'SERVER_PORT': '443',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'SERVER_SIGNATURE': '<address>Apache/2.2.3 (Red Hat) Server at support-stage.mozilla.com Port 443</address>\n',
 'SERVER_SOFTWARE': 'Apache/2.2.3 (Red Hat)',
 'mod_wsgi.application_group': 'support-stage-new.mozilla.com|/k',
 'mod_wsgi.callable_object': 'application',
 'mod_wsgi.handler_script': '',
 'mod_wsgi.input_chunked': '0',
 'mod_wsgi.listener_host': '',
 'mod_wsgi.listener_port': '81',
 'mod_wsgi.process_group': 'kitsune-ssl',
 'mod_wsgi.request_handler': 'wsgi-script',
 'mod_wsgi.script_reloading': '1',
 'mod_wsgi.version': (3, 2),
 'platform.name': 'mrapp-stage04.mozilla.org',
 'wsgi.errors': <mod_wsgi.Log object at 0x2aaaad3084b0>,
 'wsgi.file_wrapper': <built-in method file_wrapper of mod_wsgi.Adapter object at 0x2aaab1a0f3f0>,
 'wsgi.input': <mod_wsgi.Input object at 0x2aaaad3084f0>,
 'wsgi.loaded': datetime.datetime(2010, 11, 17, 6, 30, 49, 838371),
 'wsgi.multiprocess': True,
 'wsgi.multithread': False,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'https',
 'wsgi.version': (1, 1)}>
Summary: Clicking on some existing articles display "An Error Occured" → Clicking on some existing articles displays "An Error Occured"
Priority: -- → P2
Target Milestone: --- → 2.3
Assignee: nobody → erik
Fixed in https://github.com/jsocol/kitsune/commit/5020b228ca729b9db5f09a222b9a0c8352619828. QA: The only way to test this via the front end is to try viewing a translation whose current revision has a NULL based_on_id (i.e. wiki_revision.based_on_id). However, the latest migrations don't have many of those, so you'll likely need to consult one of us with a recent dump when you're ready to test this.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Once revision delete lands:

* Create a new English document. Approve it.
* Translate that document. Approve it.
* Create a new revision of the English document and approve it.
* Delete the previous revision (no longer current) of the English document.

based_on_id is now NULL for the translated revision.
Component: General → Knowledge Base Software
QA Contact: general → kb-software
revision delete is not yet implemented - verified able to view the article linked above
Status: RESOLVED → VERIFIED
Verified translated article displays even when based_on_id is NULL
You need to log in before you can comment on or make changes to this bug.