Edgewall Software
Modify

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#11958 closed defect (cantfix)

IntegrityError: duplicate key value violates unique constraint "report_pkey" DETAIL: Key (id)=(10) already exists.

Reported by: Massimo <massimo.b@…> Owned by:
Priority: normal Milestone:
Component: ticket system Version: 1.0.3
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I have this issue, when I try to save a new ticket query. This is a fresh 1.0.3 installation with Postgres, never migrated that database.

The issue is reproducible on a separate test project using the same plugins and configuration. Attached you find the configuration.

Most recent call last:

File "/usr/lib64/python2.7/site-packages/trac/web/main.py", line 513, in _dispatch_request
  dispatcher.dispatch(req)
File "/usr/lib64/python2.7/site-packages/trac/web/main.py", line 222, in dispatch
  resp = chosen_handler.process_request(req)
File "/usr/lib64/python2.7/site-packages/trac/ticket/report.py", line 163, in process_request
  self._do_create(req)
File "/usr/lib64/python2.7/site-packages/trac/ticket/report.py", line 226, in _do_create
  """, (title, query, description))
File "/usr/lib64/python2.7/site-packages/trac/db/util.py", line 72, in execute
  return self.cursor.execute(sql_escape_percent(sql), args)

The query expression:

query:?status=accepted
&
status=assigned
&
status=new
&
status=reopened
&
component=GUI
&
col=id
&
col=summary
&
col=component
&
col=status
&
col=owner
&
col=type
&
col=priority
&
col=milestone
&
col=time
&
col=reporter
&
order=priority
System Information:

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0
Trac 	1.0.4
Docutils 	0.12
FullBlog 	0.1.1-r0
Genshi 	0.7 (with speedups)
GIT 	2.0.5
psycopg2 	2.5.3
Pygments 	2.0predev-20150123
Python 	2.7.9 (default, Jan 23 2015, 15:27:02) [GCC 4.8.3]
pytz 	2014.10
setuptools 	7.0
jQuery	1.7.2
jQuery UI	1.8.21
jQuery Timepicker	1.0.1
Enabled Plugins:
acct-mgr.admin 	N/A 	/usr/lib64/python2.7/site-packages/acct_mgr/admin.pyc
acct-mgr.api 	N/A 	/usr/lib64/python2.7/site-packages/acct_mgr/api.pyc
acct-mgr.db 	N/A 	/usr/lib64/python2.7/site-packages/acct_mgr/db.pyc
acct-mgr.htfile 	N/A 	/usr/lib64/python2.7/site-packages/acct_mgr/htfile.pyc
acct-mgr.http 	N/A 	/usr/lib64/python2.7/site-packages/acct_mgr/http.pyc
acct-mgr.macros 	N/A 	/usr/lib64/python2.7/site-packages/acct_mgr/macros.pyc
acct-mgr.notification 	N/A 	/usr/lib64/python2.7/site-packages/acct_mgr/notification.pyc
acct-mgr.pwhash 	N/A 	/usr/lib64/python2.7/site-packages/acct_mgr/pwhash.pyc
acct-mgr.register 	N/A 	/usr/lib64/python2.7/site-packages/acct_mgr/register.pyc
acct-mgr.svnserve 	N/A 	/usr/lib64/python2.7/site-packages/acct_mgr/svnserve.pyc
acct-mgr.web-ui 	N/A 	/usr/lib64/python2.7/site-packages/acct_mgr/web_ui.pyc
RoadmapHours 	0.5 	/mnt/data/trac/projects/trac-pmp/plugins/RoadmapHours-0.5-py2.7.egg
SimpleMultiProject 	0.0.4dev-r14359 	/mnt/data/trac/projects/trac-pmp/plugins/SimpleMultiProject-0.0.4dev_r14359-py2.7.egg
timingandestimationplugin 	1.3.7 	/mnt/data/trac/projects/trac-pmp/plugins/timingandestimationplugin-1.3.7-py2.7.egg
TracAnnouncer 	1.0dev-r13984 	/mnt/data/trac/projects/trac-pmp/plugins/TracAnnouncer-1.0dev_r13984-py2.7.egg
TracAutocompleteUsersPlugin 	0.4.3dev-r14213 	/mnt/data/trac/projects/trac-pmp/plugins/TracAutocompleteUsersPlugin-0.4.3dev_r14213-py2.7.egg
TracDiscussion 	0.9dev-r14140 	/mnt/data/trac/projects/trac-pmp/plugins/TracDiscussion-0.9dev_r14140-py2.7.egg
TracFullBlogPlugin 	0.1.1-r0 	/mnt/data/trac/projects/trac-pmp/plugins/TracFullBlogPlugin-0.1.1_r0-py2.7.egg
TracGanttCalendarPlugin 	0.6.4-r859 	/mnt/data/trac/projects/trac-pmp/plugins/TracGanttCalendarPlugin-0.6.4_r859-py2.7.egg
TracMasterTickets 	3.0.5dev-r14323 	/mnt/data/trac/projects/trac-pmp/plugins/TracMasterTickets-3.0.5dev_r14323-py2.7.egg
TracWatchlistPlugin 	1.0.1 	/mnt/data/trac/projects/trac-pmp/plugins/TracWatchlistPlugin-1.0.1-patched_py2.7.egg
TracWorkflowAdmin 	0.12.0.2 	/mnt/data/trac/projects/trac-pmp/plugins/TracWorkflowAdmin-0.12.0.2-py2.7.egg
WikiAutoComplete 	1.0 	/mnt/data/trac/projects/trac-pmp/plugins/WikiAutoComplete-1.0-py2.7.egg
WorkLog 	0.4dev-r13835 	/mnt/data/trac/projects/trac-pmp/plugins/WorkLog-0.4dev_r13835-py2.7.egg

Attachments (1)

trac.ini (7.7 KB ) - added by Massimo <massimo.b@…> 9 years ago.
trac.ini

Download all attachments as: .zip

Change History (7)

by Massimo <massimo.b@…>, 9 years ago

Attachment: trac.ini added

trac.ini

comment:1 by Massimo <massimo.b@…>, 9 years ago

Component: generalticket system

comment:2 by Jun Omae, 9 years ago

Resolution: cantfix
Status: newclosed

Reproduced with PostgreSQL. That is a PluginIssue (th:TimingAndEstimationPlugin with PostgreSQL). Please report to plugin authors on trac-hacks.

comment:3 by Jun Omae, 9 years ago

Handling database type in the plugin is buggy….

  • timingandestimationplugin/reportmanager.py

    a b class CustomReportManager:  
    8080      ("INSERT INTO custom_report (id, uuid, maingroup, subgroup, version, ordering) " \
    8181         "VALUES (%s, %s, %s, %s, %s, %s)",
    8282       (next_id, uuid, maingroup, subgroup, version, ordering)))
    83     if type(self.env.get_read_db().cnx) == trac.db.postgres_backend.PostgreSQLConnection:
     83    if self.env.config.get('trac', 'database').startswith('postgres:'):
    8484      self.log.debug("Attempting to increment sequence (only works in postgres)")
    8585      try:
    8686        dbhelper.execute_in_nested_trans(self.env, "update_seq", ("SELECT nextval('report_id_seq');",[]));
Last edited 9 years ago by Jun Omae (previous) (diff)

comment:4 by Massimo <massimo.b@…>, 9 years ago

Thanks for investigating… th:#12191

Last edited 9 years ago by Ryan J Ollos (previous) (diff)

in reply to:  3 comment:5 by Massimo <massimo.b@…>, 9 years ago

Replying to jomae:

Handling database type in the plugin is buggy….

--- a/timingandestimationplugin/reportmanager.py
+++ b/timingandestimationplugin/reportmanager.py

Tried that bugfix on timingandestimationplugin-1.4.4b-py2.7.egg, but does not solve the issue. Proceeding the discussion on trac-hacks.org

comment:6 by Jun Omae, 9 years ago

report_id_seq in your database has currently invalid value by that plugin. It need to be reset.

SELECT setval('report_id_seq', (SELECT MAX(id) FROM report));
Last edited 9 years ago by Jun Omae (previous) (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.