Modify

Opened 6 years ago

Last modified 3 years ago

#4137 new defect

ProgrammingError: current transaction is aborted, commands ignored until end of transaction block

Reported by: anonymous Owned by: andersm
Priority: normal Component: PeerReviewPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.10

Description

How to Reproduce

While doing a POST operation on /peerReviewView, Trac issued an internal error.

(please provide additional details here)

Request parameters:

{'Vote': u'yes', '__FORM_TOKEN': u'52c18c32a893319ac3383115', 'Review': u'4'}

User Agent was: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4

System Information

Trac 0.11.1
Python 2.4.3 (#1, Apr 3 2007, 07:17:42)
[GCC 4.1.1 (Gentoo 4.1.1-r3)]
setuptools 0.6c7
psycopg2 2.0.2 (dec dt ext pq3)
Genshi 0.5.1
mod_python 3.3.1
Pygments 0.10
Subversion 1.5.0 (r31699)
jQuery: 1.2.6

Python Traceback

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 423, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 197, in dispatch
    resp = chosen_handler.process_request(req)
  File "build/bdist.linux-i686/egg/codereview/peerReviewView.py", line 192, in process_request
  File "build/bdist.linux-i686/egg/codereview/peerReviewView.py", line 236, in vote
  File "build/bdist.linux-i686/egg/codereview/ReviewerStruct.py", line 47, in save
  File "/usr/lib/python2.4/site-packages/trac/db/util.py", line 51, in execute
    return self.cursor.execute(sql)
  File "/usr/lib/python2.4/site-packages/trac/db/util.py", line 51, in execute
    return self.cursor.execute(sql)
ProgrammingError: current transaction is aborted, commands ignored until end of transaction block



Attachments (0)

Change History (2)

comment:1 Changed 6 years ago by serj@…

Fixed this by adding this in ReviewerStruct.py:

db.rollback()

also i modified this plugin to use with LDAP (permissions and users)
can post the code if helps

       try:^
            db.rollback()
            cursor.execute("INSERT INTO Reviewers (IDReview, Reviewer, Status, Vote) VALUES('%s', '%s', '%s', '%s') "%(self.IDReview, self.Reviewer, self.Status, self.Vote))
            db.commit()
        except:
            #Update information in existing database entry
            db.rollback()
            cursor.execute("UPDATE Reviewers SET Status='%s', Vote='%s' WHERE IDReview='%s' AND Reviewer='%s'"% (self.Status, self.Vote, self.IDReview, self.Reviewer))
            db.commit()

comment:2 Changed 3 years ago by andersm

  • Owner changed from proofek to andersm

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.