Opened 16 years ago

Last modified 13 years ago

#8315 closed

MySQL Commands out of sync on attempt to rollback — at Version 5

Reported by: voidfiles@… Owned by: Karen Tracey
Component: Database layer (models, ORM) Version: dev
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Malcolm Tredinnick)

I have newest code as of this ticket. This only happens when I run django through a fastCGI on dreamhost. I have built my own python, and mysqlDB so its not dreamhosts stuff. Followed the directions in the django tutorial. Happened after a checkout so that is why I think this might be a bug, and not a support issue.

Here is the Error dump.

 /home/varius_2/loudfarm.tastestalkr.com/dispatch.fcgi" stderr: Traceback (most recent call last):
 /home/varius_2/loudfarm.tastestalkr.com/dispatch.fcgi" stderr:   File "build/bdist.linux-i686/egg/flup/server/fcgi_base.py", line 558, in run
 /home/varius_2/loudfarm.tastestalkr.com/dispatch.fcgi" stderr:     protocolStatus, appStatus = self.server.handler(self)
 /home/varius_2/loudfarm.tastestalkr.com/dispatch.fcgi" stderr:   File "build/bdist.linux-i686/egg/flup/server/fcgi_base.py", line 1112, in handler
 /home/varius_2/loudfarm.tastestalkr.com/dispatch.fcgi" stderr:     result = self.application(environ, start_response)
 /home/varius_2/loudfarm.tastestalkr.com/dispatch.fcgi" stderr:   File "/home/varius_2/opt/lib/python2.5/site-packages/django/core/handlers/wsgi.py", line 216, in __call__
 /home/varius_2/loudfarm.tastestalkr.com/dispatch.fcgi" stderr:     response = self.get_response(request)
 /home/varius_2/loudfarm.tastestalkr.com/dispatch.fcgi" stderr:   File "/home/varius_2/opt/lib/python2.5/site-packages/django/core/handlers/base.py", line 124, in get_response
 /home/varius_2/loudfarm.tastestalkr.com/dispatch.fcgi" stderr:     receivers = signals.got_request_exception.send(sender=self.__class__, request=request)
 /home/varius_2/loudfarm.tastestalkr.com/dispatch.fcgi" stderr:   File "/home/varius_2/opt/lib/python2.5/site-packages/django/dispatch/dispatcher.py", line 132, in send
 /home/varius_2/loudfarm.tastestalkr.com/dispatch.fcgi" stderr:     response = receiver(signal=self, sender=sender, **named)
 /home/varius_2/loudfarm.tastestalkr.com/dispatch.fcgi" stderr:   File "/home/varius_2/opt/lib/python2.5/site-packages/django/db/__init__.py", line 56, in _rollback_on_exception
 /home/varius_2/loudfarm.tastestalkr.com/dispatch.fcgi" stderr:     transaction.rollback_unless_managed()
 /home/varius_2/loudfarm.tastestalkr.com/dispatch.fcgi" stderr:   File "/home/varius_2/opt/lib/python2.5/site-packages/django/db/transaction.py", line 157, in rollback_unless_managed
 /home/varius_2/loudfarm.tastestalkr.com/dispatch.fcgi" stderr:     connection._rollback()
 /home/varius_2/loudfarm.tastestalkr.com/dispatch.fcgi" stderr:   File "/home/varius_2/opt/lib/python2.5/site-packages/django/db/backends/mysql/base.py", line 227, in _rollback
 /home/varius_2/loudfarm.tastestalkr.com/dispatch.fcgi" stderr:     BaseDatabaseWrapper._rollback(self)
 /home/varius_2/loudfarm.tastestalkr.com/dispatch.fcgi" stderr:   File "/home/varius_2/opt/lib/python2.5/site-packages/django/db/backends/__init__.py", line 32, in _rollback
 /home/varius_2/loudfarm.tastestalkr.com/dispatch.fcgi" stderr:     return self.connection.rollback()
 /home/varius_2/loudfarm.tastestalkr.com/dispatch.fcgi" stderr: ProgrammingError: (2014, "Commands out of sync; you can't run this command now")

Change History (5)

comment:1 by Karen Tracey <kmtracey@…>, 16 years ago

Specifics beyond 'not dreamhosts stuff' could be helpful here. What MySQLdb & MySQL levels exactly? I assume you are using InnoDB since the error sounds transaction-related? What exactly triggers the error? Any attempt to access any url on your site?

comment:2 by voidfiles@…, 16 years ago

Yea thanks for the response.

So here is what I get mysql
mysql Ver 14.12 Distrib 5.0.16, for pc-linux-gnu (i386) using readline 5.0

MySQL-python-1.2.2

I get the error when I try and access admin, and one other url

I am using MyISAM, not InnoDB

Thanks for telling me what elese to include I have never filled a ticket before.

comment:3 by Karen Tracey, 16 years ago

Owner: changed from nobody to Karen Tracey
Status: newassigned
Summary: Updated code to rev. 8350MySQL Commands out of sync on attempt to rollback

I think there are a couple of problems interacting here. First there is something weird causing ill-described "crashes" going on with sessions/cookies, see #8314 and various reports on the user's list today. The reason I think that is related to this report is that I just hit this traceback when I:

  • changed my settings.py to point to my test DB instead of my production DB
  • used the same browser I had been using to access my production DB to instead access the test DB, this caused a commands out of sync error/traceback
  • I then managed to avoid the traceback by clearing cookies from my browser, once I did that I could access the test DB admin

So the cookies/session oddness is one problem and is I think being looked into separately. The fact that the exception it caused resulted in a MySQL "Commands out of sync" error is a different problem which I will try looking into.

To voidfiles: try clearing cookies in your browser and see if that fixes the problem.

To anyone with trac superpowers: Could you fix the original description formatting? (Or if that is something mere mortals can do please tell me how, 'cause I don't know how to do it and this one is hurting my eyes.)

comment:4 by Karen Tracey, 16 years ago

Status: assignednew
Triage Stage: UnreviewedAccepted

Meant to change the triage stage, not assign to myself.

comment:5 by Malcolm Tredinnick, 16 years ago

Description: modified (diff)

Fixed description to stop Karen's eyes from hurting.

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