Ticket #8792 (assigned defect)

Opened 2 years ago

Last modified 6 months ago

ValueError: list.remove(x): x not in list

Reported by: Marek Assigned to: rjollos (accepted)
Priority: high Component: MasterTicketsPlugin
Severity: normal Keywords:
Cc: marekjarosz@poczta.onet.pl Trac Release: 0.12

Description

Someone's created a ticket with a huge number of blocked by.

Now, every time I try to change anything in this ticket I get an internal error:

Trac detected an internal error:

ValueError: list.remove(x): x not in list
File "/usr/lib/python2.4/site-packages/Trac-0.12.2-py2.4.egg/trac/web/main.py", line 511, in _dispatch_request
File "/usr/lib/python2.4/site-packages/Trac-0.12.2-py2.4.egg/trac/web/main.py", line 237, in dispatch
File "/usr/lib/python2.4/site-packages/Trac-0.12.2-py2.4.egg/trac/ticket/web_ui.py", line 169, in process_request
File "/usr/lib/python2.4/site-packages/Trac-0.12.2-py2.4.egg/trac/ticket/web_ui.py", line 541, in _process_ticket_request
File "/usr/lib/python2.4/site-packages/Trac-0.12.2-py2.4.egg/trac/ticket/web_ui.py", line 1238, in _do_save
File "/usr/lib/python2.4/site-packages/Trac-0.12.2-py2.4.egg/trac/ticket/model.py", line 360, in save_changes
File "build/bdist.linux-x86_64/egg/mastertickets/api.py", line 111, in ticket_changed
File "build/bdist.linux-x86_64/egg/mastertickets/model.py", line 68, in save
File "build/bdist.linux-x86_64/egg/mastertickets/model.py", line 61, in <lambda> 
Trac 	0.12.2
Genshi 	0.6
mod_python 	3.2.8
psycopg2 	2.0.8 (dec dt ext pq3)
Pygments 	1.3.1
Python 	2.4.3 (#1, Sep 3 2009, 15:37:37) [GCC 4.1.2 20080704 (Red Hat 4.1.2-46)]
pytz 	2010l
setuptools 	0.6c12
Subversion 	1.4.2 (r22196)
jQuery	1.4.2

Attachments

Change History

05/13/11 12:02:53 changed by Marek

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/Trac-0.12.2-py2.4.egg/trac/web/api.py", line 440, in send_error
    data, 'text/html')
  File "/usr/lib/python2.4/site-packages/Trac-0.12.2-py2.4.egg/trac/web/chrome.py", line 868, in render_template
    stream.render(method, doctype=doctype, out=buffer)
  File "build/bdist.macosx-10.3-fat/egg/genshi/core.py", line 183, in render
  File "build/bdist.macosx-10.3-fat/egg/genshi/output.py", line 58, in encode
  File "build/bdist.macosx-10.3-fat/egg/genshi/output.py", line 339, in __call__
  File "build/bdist.macosx-10.3-fat/egg/genshi/output.py", line 826, in __call__
  File "build/bdist.macosx-10.3-fat/egg/genshi/output.py", line 670, in __call__
  File "build/bdist.macosx-10.3-fat/egg/genshi/output.py", line 771, in __call__
  File "build/bdist.macosx-10.3-fat/egg/genshi/output.py", line 586, in __call__
  File "build/bdist.macosx-10.3-fat/egg/genshi/core.py", line 288, in _ensure
  File "build/bdist.macosx-10.3-fat/egg/genshi/core.py", line 288, in _ensure
  File "/usr/lib/python2.4/site-packages/Trac-0.12.2-py2.4.egg/trac/web/chrome.py", line 981, in _strip_accesskeys
    for kind, data, pos in stream:
  File "build/bdist.macosx-10.3-fat/egg/genshi/core.py", line 288, in _ensure
  File "/usr/lib/python2.4/site-packages/Trac-0.12.2-py2.4.egg/trac/web/chrome.py", line 970, in _generate
    for kind, data, pos in stream:
  File "build/bdist.macosx-10.3-fat/egg/genshi/core.py", line 288, in _ensure
  File "build/bdist.macosx-10.3-fat/egg/genshi/template/base.py", line 605, in _include
  File "build/bdist.macosx-10.3-fat/egg/genshi/template/markup.py", line 378, in _match
  File "build/bdist.macosx-10.3-fat/egg/genshi/template/markup.py", line 378, in _match
  File "build/bdist.macosx-10.3-fat/egg/genshi/template/markup.py", line 327, in _match
  File "build/bdist.macosx-10.3-fat/egg/genshi/template/base.py", line 545, in _flatten
  File "build/bdist.macosx-10.3-fat/egg/genshi/core.py", line 288, in _ensure
  File "build/bdist.macosx-10.3-fat/egg/genshi/path.py", line 588, in _generate
  File "build/bdist.macosx-10.3-fat/egg/genshi/template/base.py", line 605, in _include
  File "build/bdist.macosx-10.3-fat/egg/genshi/template/markup.py", line 316, in _strip
  File "build/bdist.macosx-10.3-fat/egg/genshi/template/base.py", line 545, in _flatten
  File "build/bdist.macosx-10.3-fat/egg/genshi/core.py", line 288, in _ensure
  File "build/bdist.macosx-10.3-fat/egg/genshi/path.py", line 588, in _generate
  File "build/bdist.macosx-10.3-fat/egg/genshi/template/base.py", line 605, in _include
  File "build/bdist.macosx-10.3-fat/egg/genshi/template/markup.py", line 316, in _strip
  File "build/bdist.macosx-10.3-fat/egg/genshi/template/base.py", line 565, in _flatten
  File "build/bdist.macosx-10.3-fat/egg/genshi/template/base.py", line 277, in _eval_expr
  File "build/bdist.macosx-10.3-fat/egg/genshi/template/eval.py", line 178, in evaluate
  File "/usr/lib/python2.4/site-packages/Trac-0.12.2-py2.4.egg/trac/templates/error.html", line 165, in <Expression u'shorten_line(repr(value))'>
    <td><code>${shorten_line(repr(value))}</code></td>
  File "build/bdist.linux-x86_64/egg/mastertickets/model.py", line 117, in __repr__
  File "build/bdist.linux-x86_64/egg/mastertickets/model.py", line 115, in l
TypeError: sequence item 0: expected string, int found

09/19/12 17:13:56 changed by Mark

Same here. For me, it happened the first time I tried to remove something from the "blocked by"/"blocking" fields.

My main problem is that even after I removed all values from the "blocked by" and "blocking" fields from the related tickets, the depgraph is still the same. The content of the graph and the content of the ticket remained inconsistent, even after I restarted Trac.

System Information

Trac 	1.0
Genshi 	0.6 (without speedups)
pysqlite 	2.6.0
Python 	2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)]
setuptools 	0.6c11
SQLite 	3.6.21
jQuery	1.7.2

Installed Plugins

tracaccountmanager 	0.3.2 	c:\python27\lib\site-packages\tracaccountmanager-0.3.2-py2.7.egg
tracmastertickets 	3.0.2 	d:\swankey-server\trac-environment\ammo\plugins\tracmastertickets-3.0.2-py2.7.egg

10/24/12 12:05:03 changed by anonymous

Occurs here too after removing "Blocking" tickets.

Note that the blocking tickets I had added were already closed (it might help..).

Traceback:

Most recent call last:

File "/usr/lib/python2.6/dist-packages/trac/web/main.py", line 511, in _dispatch_request
  dispatcher.dispatch(req)
File "/usr/lib/python2.6/dist-packages/trac/web/main.py", line 237, in dispatch
  resp = chosen_handler.process_request(req)
File "/usr/lib/python2.6/dist-packages/trac/ticket/web_ui.py", line 169, in process_request
  return self._process_ticket_request(req)
File "/usr/lib/python2.6/dist-packages/trac/ticket/web_ui.py", line 541, in _process_ticket_request
  self._do_save(req, ticket, action)
File "/usr/lib/python2.6/dist-packages/trac/ticket/web_ui.py", line 1238, in _do_save
  cnum=internal_cnum):
File "/usr/lib/python2.6/dist-packages/trac/ticket/model.py", line 360, in save_changes
  listener.ticket_changed(self, comment, author, old_values)
File "/usr/lib/pymodules/python2.6/mastertickets/api.py", line 111, in ticket_changed
  links.save(author, comment, tkt.time_changed, db)
File "/usr/lib/pymodules/python2.6/mastertickets/model.py", line 68, in save
  update_field(new_value)
File "/usr/lib/pymodules/python2.6/mastertickets/model.py", line 61, in <lambda>
  update_field = lambda lst: lst.remove(str(self.tkt.id))

Enabled plugins:

acunu-commit-updater 	N/A 	/srv/trac/plugins/acunu_commit_updater.pyc
BatchModify 	0.8.0-trac0.12 	/usr/lib/pymodules/python2.6
ticket-clone 	N/A 	/srv/trac/plugins/ticket_clone.pyc
TracMasterTickets 	3.0.2 	/usr/lib/pymodules/python2.6
TracMercurial 	0.12.0.28dev 	/usr/lib/pymodules/python2.6
TracProgressMeterMacro 	0.3 	/usr/lib/pymodules/python2.6

10/26/12 22:21:08 changed by rjollos

  • status changed from new to assigned.
  • priority changed from normal to high.
  • owner changed from coderanger to rjollos.

11/29/12 23:28:51 changed by Scott S.

I get the same error when I try to change a ticket from "blocked by" to "blocking."

Python Traceback

Most recent call last:
File "/opt/kforge19/lib/python2.6/site-packages/trac/web/main.py", line 511, in _dispatch_request
  dispatcher.dispatch(req)
File "/opt/kforge19/lib/python2.6/site-packages/trac/web/main.py", line 237, in dispatch
  resp = chosen_handler.process_request(req)
File "/opt/kforge19/lib/python2.6/site-packages/trac/ticket/web_ui.py", line 169, in process_request
  return self._process_ticket_request(req)
File "/opt/kforge19/lib/python2.6/site-packages/trac/ticket/web_ui.py", line 541, in _process_ticket_request
  self._do_save(req, ticket, action)
File "/opt/kforge19/lib/python2.6/site-packages/trac/ticket/web_ui.py", line 1238, in _do_save
  cnum=internal_cnum):
File "/opt/kforge19/lib/python2.6/site-packages/trac/ticket/model.py", line 360, in save_changes
  listener.ticket_changed(self, comment, author, old_values)
File "build/bdist.linux-x86_64/egg/mastertickets/api.py", line 111, in ticket_changed
  links.save(author, comment, tkt.time_changed, db)
File "build/bdist.linux-x86_64/egg/mastertickets/model.py", line 68, in save
  update_field(new_value)
File "build/bdist.linux-x86_64/egg/mastertickets/model.py", line 61, in <lambda>
  update_field = lambda lst: lst.remove(str(self.tkt.id))

Enabled Plugins

EstimationTools	0.4.6-r12062	/opt/kforge_project/gripperdesign/trac/695/plugins/EstimationTools-0.4.6_r12062-py2.6.egg
timingandestimationplugin	1.2.8	/opt/kforge_project/gripperdesign/trac/695/plugins/timingandestimationplugin-1.2.8-py2.6.egg
Trac-jsGantt	0.10-r11863	/opt/kforge_project/gripperdesign/trac/695/plugins/Trac_jsGantt-0.10_r11863-py2.6.egg
TracGit	0.12.0.2dev-r7757	/opt/kforge19/lib/python2.6/site-packages
TracMasterTickets	3.0.2	/opt/kforge_project/gripperdesign/trac/695/plugins/TracMasterTickets-3.0.2-py2.6.egg
TracMercurial	0.12.0.28dev-r10698	/opt/kforge19/lib/python2.6/site-packages
TracSubTicketsPlugin	0.1.0	/opt/kforge_project/gripperdesign/trac/695/plugins/TracSubTicketsPlugin-0.1.0-py2.6.egg

Add/Change #8792 (ValueError: list.remove(x): x not in list)




Change Properties
Action