#11039 closed defect (fixed)
IntegrityError: column name is not unique
Reported by: | anonymous | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Component: | DefaultCcPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: |
Description (last modified by )
Trac detected an internal error: IntegrityError: column name is not unique Python Traceback Most recent call last: File "/usr/lib64/python2.7/site-packages/trac/web/main.py", line 522, in _dispatch_request dispatcher.dispatch(req) File "/usr/lib64/python2.7/site-packages/trac/web/main.py", line 208, in dispatch chosen_handler) File "/usr/lib64/python2.7/site-packages/trac/web/main.py", line 350, in _pre_process_request chosen_handler = filter_.pre_process_request(req, chosen_handler) File "/usr/lib64/python2.7/site-packages/defaultcc/admin.py", line 77, in pre_process_request cc.insert() File "/usr/lib64/python2.7/site-packages/defaultcc/model.py", line 59, in insert (self.name, _fixup_cc_list(self.cc))) File "/usr/lib64/python2.7/site-packages/trac/db/util.py", line 65, in execute return self.cursor.execute(sql_escape_percent(sql), args) File "/usr/lib64/python2.7/site-packages/trac/db/sqlite_backend.py", line 78, in execute result = PyFormatCursor.execute(self, *args) File "/usr/lib64/python2.7/site-packages/trac/db/sqlite_backend.py", line 56, in execute args or []) File "/usr/lib64/python2.7/site-packages/trac/db/sqlite_backend.py", line 48, in _rollback_on_error return function(self, *args, **kwargs)
Attachments (0)
Change History (5)
comment:1 Changed 12 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 12 years ago by
comment:3 Changed 12 years ago by
Status: | new → assigned |
---|
I can reproduce the error when trying to rename a component with a name that already exists. The plugin is doing an insert into the defaultcc table in pre_process_request
, before any check is performed to determine if the component name already exists. The fix that I'll put in place will check that the user is not attempting to rename the component to the name of an already existing component before doing the delete and insert operations.
In Trac 0.11.7 and 0.12.5, IntegrityError
will be raised when renaming a Component but the new name already exists. This was fixed in Trac 1.0, t 10737#file8 so that a TracError is raised. Therefore, even after the fix is put in place, you'll see an IntegrityError in Trac < 1.0, but the traceback will not involve the DefaultCcPlugin.
File "/home/user/Workspace/test/trac.git/trac/web/main.py", line 522, in _dispatch_request dispatcher.dispatch(req) File "/home/user/Workspace/test/trac.git/trac/web/main.py", line 243, in dispatch resp = chosen_handler.process_request(req) File "/home/user/Workspace/test/trac.git/trac/admin/web_ui.py", line 117, in process_request path_info) File "/home/user/Workspace/test/trac.git/trac/ticket/admin.py", line 53, in render_admin_panel return self._render_admin_panel(req, cat, page, version) File "/home/user/Workspace/test/trac.git/trac/ticket/admin.py", line 88, in _render_admin_panel comp.update() File "/home/user/Workspace/test/trac.git/trac/ticket/model.py", line 875, in update @self.env.with_transaction(db) File "/home/user/Workspace/test/trac.git/trac/db/api.py", line 77, in transaction_wrapper fn(ldb) File "/home/user/Workspace/test/trac.git/trac/ticket/model.py", line 882, in do_update """, (self.name, self.owner, self.description, self._old_name)) File "/home/user/Workspace/test/trac.git/trac/db/util.py", line 65, in execute return self.cursor.execute(sql_escape_percent(sql), args) File "/home/user/Workspace/test/trac.git/trac/db/sqlite_backend.py", line 78, in execute result = PyFormatCursor.execute(self, *args) File "/home/user/Workspace/test/trac.git/trac/db/sqlite_backend.py", line 56, in execute args or []) File "/home/user/Workspace/test/trac.git/trac/db/sqlite_backend.py", line 48, in _rollback_on_error return function(self, *args, **kwargs)
comment:4 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I'll take a look. Any hints on how to reproduce the issue?