Opened 7 years ago

Closed 7 years ago

Last modified 7 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: UI/UX:

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/", line 558, in run
    protocolStatus, appStatus = self.server.handler(self)
  File "/home/users/web/b2940/moo.tieche/python-packages/flup/server/", line 1116, in handler
    result = self.application(environ, start_response)
  File "/home/users/web/b2940/moo.tieche/python-packages/django/core/handlers/", line 245, in __call__
    response = middleware_method(request, response)
  File "/home/users/web/b2940/moo.tieche/python-packages/django/contrib/sessions/", line 36, in process_response
  File "/home/users/web/b2940/moo.tieche/python-packages/django/contrib/sessions/backends/", line 58, in save
  File "/home/users/web/b2940/moo.tieche/python-packages/django/db/models/", 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/", 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/", 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/", line 681, in _clone
  File "/home/users/web/b2940/moo.tieche/python-packages/django/db/models/", 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 Changed 7 years ago by Alex Gaynor

Description: modified (diff)
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

Please use the preview button.

comment:2 Changed 7 years ago by dc

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 Changed 7 years ago by Karen Tracey

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/ from 1.1 (since it's expecting BaseQuery to have an extra attribute) yet a django/db/models/sql/ (where BaseQuery lives) from 1.1 Beta, before BaseQuery had this new attribute.

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