Modify

Opened 5 years ago

Closed 4 years ago

#5450 closed defect (duplicate)

DB error when adding additonal tickets to blockedby/blocking

Reported by: vArDo Owned by: coderanger
Priority: normal Component: MasterTicketsPlugin
Severity: normal Keywords:
Cc: mateusz@…, asterix@… Trac Release: 0.11

Description

When I try to add additional ticket to Blockedby field (the same with 'blocking' field) I get the following error:

File "/usr/lib/python2.5/site-packages/trac/web/api.py", line 339,
in send_error
   'text/html')
 File "/usr/lib/python2.5/site-packages/trac/web/chrome.py", line
702, in render_template
   if not req.session or not int(req.session.get('accesskeys', 0)):
 File "/usr/lib/python2.5/site-packages/trac/web/api.py", line 169,
in __getattr__
   value = self.callbacks[name](self)
 File "/usr/lib/python2.5/site-packages/trac/web/main.py", line 257,
in _get_session
   return Session(self.env, req)
 File "/usr/lib/python2.5/site-packages/trac/web/session.py", line
150, in __init__
   self.get_session(req.authname, authenticated=True)
 File "/usr/lib/python2.5/site-packages/trac/web/session.py", line
164, in get_session
   super(Session, self).get_session(sid, authenticated)
 File "/usr/lib/python2.5/site-packages/trac/web/session.py", line
56, in get_session
   (sid, int(authenticated)))
 File "/usr/lib/python2.5/site-packages/trac/db/util.py", line 50, in execute
   return self.cursor.execute(sql_escape_percent(sql), args)
 File "/usr/lib/python2.5/site-packages/trac/db/util.py", line 50, in execute
   return self.cursor.execute(sql_escape_percent(sql), args)
InternalError: current transaction is aborted, commands ignored until
end of transaction block

This is what I get in PostgreSQL logs:

2009-06-29 21:07:07 CEST ERROR:  duplicate key
value violates unique constraint "mastertickets_pkey"
2009-06-29 21:07:07 CEST STATEMENT:  INSERT INTO mastertickets (dest,
source) VALUES (5121, E'1005')
2009-06-29 21:07:07 CEST ERROR:  current transaction is aborted,
commands ignored until end of transaction block
2009-06-29 21:07:07 CEST STATEMENT:  SELECT last_visit FROM session
WHERE sid=E'vArDo' AND authenticated=1
2009-06-29 21:07:07 CEST ERROR:  current transaction is aborted,
commands ignored until end of transaction block
2009-06-29 21:07:07 CEST STATEMENT:  SELECT last_visit FROM session
WHERE sid=E'vArDo' AND authenticated=1

You can test this behaviour at Gajim's Trac: http://trac.gajim.org/ticket/5121 :

Steps to repro:

  1. remove all tickets from blockedby
  2. add one ticket to blockedby
  3. add additional ticket to blockedby <-- you will see the above-mentioned error

Attachments (2)

matertickets-alter.sql (217 bytes) - added by leeus 5 years ago.
Use with care, it drops the table and recreates it. Save a backup of the data first!!!!
masterticket-toint.diff (1.6 KB) - added by leeus 5 years ago.
Changes the way that the tickets id are passed

Download all attachments as: .zip

Change History (5)

comment:1 Changed 5 years ago by asterix

  • Cc asterix@… added

comment:2 Changed 5 years ago by leandor@…

Hi there!

We had to change the masterticket table definition for postgres to use INTEGER instead of TEXT for the fields.

And also had to apply a patch to the code to solve that issue. They'll a bit naive, since maybe there're other parts of the code that aren't postgres friendly, but that's a start.

I'll upload both changes next.

Changed 5 years ago by leeus

Use with care, it drops the table and recreates it. Save a backup of the data first!!!!

Changed 5 years ago by leeus

Changes the way that the tickets id are passed

comment:3 Changed 4 years ago by boonekamp

  • Resolution set to duplicate
  • Status changed from new to closed

Fixed in the new MasterTickets 3.0 line of development.

See #2658.

Add Comment

Modify Ticket

Action
as closed The owner will remain coderanger.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.