Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#11649 closed (invalid)

Error 'BaseQuery' object has no attribute 'extra' after applying 1.1 release

Reported by: ctieche Owned by: nobody
Component: Uncategorized Version: 1.1
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Alex Gaynor)

This occured immediately after I applied the 1.1 release onto a site that was previously using a beta 1.1 version from about 3 months ago. Sorry, can't be more exact.

Traceback (most recent call last):
  File "/home/users/web/b2940/moo.tieche/python-packages/flup/server/fcgi_base.py", line 558, in run
    protocolStatus, appStatus = self.server.handler(self)
  File "/home/users/web/b2940/moo.tieche/python-packages/flup/server/fcgi_base.py", line 1116, in handler
    result = self.application(environ, start_response)
  File "/home/users/web/b2940/moo.tieche/python-packages/django/core/handlers/wsgi.py", line 245, in __call__
    response = middleware_method(request, response)
  File "/home/users/web/b2940/moo.tieche/python-packages/django/contrib/sessions/middleware.py", line 36, in process_response
    request.session.save()
  File "/home/users/web/b2940/moo.tieche/python-packages/django/contrib/sessions/backends/db.py", line 58, in save
    obj.save(force_insert=must_create)
  File "/home/users/web/b2940/moo.tieche/python-packages/django/db/models/base.py", line 410, in save
    self.save_base(force_insert=force_insert, force_update=force_update)
  File "/home/users/web/b2940/moo.tieche/python-packages/django/db/models/base.py", line 470, in save_base
    manager.filter(pk=pk_val).extra(select={'a': 1}).values('a').order_by())):
  File "/home/users/web/b2940/moo.tieche/python-packages/django/db/models/query.py", line 452, in values
    return self._clone(klass=ValuesQuerySet, setup=True, _fields=fields)
  File "/home/users/web/b2940/moo.tieche/python-packages/django/db/models/query.py", line 681, in _clone
    c._setup_query()
  File "/home/users/web/b2940/moo.tieche/python-packages/django/db/models/query.py", line 773, in _setup_query
    if not self.query.extra and not self.query.aggregates:
AttributeError: 'BaseQuery' object has no attribute 'extra'

Change History (3)

comment:1 by Alex Gaynor, 15 years ago

Description: modified (diff)

Please use the preview button.

comment:2 by dc, 15 years ago

Resolution: invalid
Status: newclosed

Please ask on django-users or #django channel and reopen with more info if it is a Django bug. And please provide detailed steps to reproduce this bug (including models). Step by step described bug is easy to reproduce and fix.

comment:3 by Karen Tracey, 15 years ago

This was likely due to the server running a mixture of code from 1.1 Beta and 1.1. BaseQuery.extra was added in [10648], which was post-beta. It appears the server is running with a django/db/models/query.py from 1.1 (since it's expecting BaseQuery to have an extra attribute) yet a django/db/models/sql/query.py (where BaseQuery lives) from 1.1 Beta, before BaseQuery had this new attribute.

Note: See TracTickets for help on using tickets.
Back to Top