Bug 429521

Summary: deluge crashes when adding torrent
Product: [Fedora] Fedora Reporter: Ignacio Vazquez-Abrams <ivazqueznet>
Component: delugeAssignee: Peter Gordon <peter>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: low    
Version: 7   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-01-23 13:20:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ignacio Vazquez-Abrams 2008-01-21 11:08:47 UTC
$ deluge foo.torrent
create proxy object
create iface
send to iface
Traceback (most recent call last):
  File "/usr/bin/deluge", line 147, in <module>
    deluge_iface.interactive_add_torrent(filename)
  File "/usr/lib/python2.5/site-packages/dbus/proxies.py", line 64, in __call__
    return self._proxy_method(*args, **keywords)
  File "/usr/lib/python2.5/site-packages/dbus/proxies.py", line 136, in __call__
    **keywords)
  File "/usr/lib/python2.5/site-packages/dbus/connection.py", line 607, in
call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Python.RuntimeError:
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/dbus/service.py", line 692, in _message_cb
    retval = candidate_method(self, *args, **keywords)
  File "/usr/lib/python2.5/site-packages/deluge/ipc_manager.py", line 45, in
interactive_add_torrent
    self.interface.interactive_add_torrent(torrent_file)
  File "/usr/lib/python2.5/site-packages/deluge/interface.py", line 1295, in
interactive_add_torrent
    return self.interactive_add_torrent_path(torrent, path)
  File "/usr/lib/python2.5/site-packages/deluge/interface.py", line 1337, in
interactive_add_torrent_path
    self.config.get('start_paused'))
  File "/usr/lib/python2.5/site-packages/deluge/core.py", line 363, in add_torrent
    return self.sync() # Syncing will create a new torrent in the core, and
return it's ID
  File "/usr/lib/python2.5/site-packages/deluge/core.py", line 860, in sync
    for torrent in self.state.torrents:
RuntimeError: dictionary changed size during iteration

Comment 1 Ignacio Vazquez-Abrams 2008-01-21 11:12:36 UTC
Interesting. Now I get it even when adding via the GUI.

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/deluge/interface.py", line 1389, in
add_torrent_clicked
    self.interactive_add_torrent(single)
  File "/usr/lib/python2.5/site-packages/deluge/interface.py", line 1295, in
interactive_add_torrent
    return self.interactive_add_torrent_path(torrent, path)
  File "/usr/lib/python2.5/site-packages/deluge/interface.py", line 1337, in
interactive_add_torrent_path
    self.config.get('start_paused'))
  File "/usr/lib/python2.5/site-packages/deluge/core.py", line 363, in add_torrent
    return self.sync() # Syncing will create a new torrent in the core, and
return it's ID
  File "/usr/lib/python2.5/site-packages/deluge/core.py", line 860, in sync
    for torrent in self.state.torrents:
RuntimeError: dictionary changed size during iteration


Comment 2 Ignacio Vazquez-Abrams 2008-01-21 11:22:47 UTC
Gah, sorry.

deluge-(none):0.5.7.1-2.fc7.i386

After adding the following patch:

--- deluge/core.py.orig 2008-01-21 06:15:18.000000000 -0500
+++ deluge/core.py      2008-01-21 06:15:23.000000000 -0500
@@ -857,7 +857,7 @@ Space:") + " " + nice_free)
         no_space = False
 
         # Add torrents to core and unique_IDs
-        for torrent in self.state.torrents:
+        for torrent in self.state.torrents.keys():
             if not os.path.exists(torrent.filename):
                 print "Missing file: %s" % torrent.filename
                 del self.state.torrents[torrent]

I get the following error when adding via GUI:

Missing file: /foo.torrent
Pickling state...
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/deluge/interface.py", line 1389, in
add_torrent_clicked
    self.interactive_add_torrent(single)
  File "/usr/lib/python2.5/site-packages/deluge/interface.py", line 1295, in
interactive_add_torrent
    return self.interactive_add_torrent_path(torrent, path)
  File "/usr/lib/python2.5/site-packages/deluge/interface.py", line 1377, in
interactive_add_torrent_path
    self.torrent_model_append(unique_id)
  File "/usr/lib/python2.5/site-packages/deluge/interface.py", line 651, in
torrent_model_append
    state = self.manager.get_torrent_state(unique_id)
  File "/usr/lib/python2.5/site-packages/deluge/core.py", line 427, in
get_torrent_state
    raise InvalidUniqueIDError(_("Asked for a torrent that doesn't exist"))
deluge.core.InvalidUniqueIDError: u"Asked for a torrent that doesn't exist"

Note that the torrent file wasn't actually in / when I added it.

Comment 3 Peter Gordon 2008-01-21 15:20:45 UTC
Thanks for the bug report, Ignacio.

I enqueued 0.5.8.1-1 for updates-testing yesterday; would you please try this
with the new version? (Available from
http://koji.fedoraproject.org/koji/buildinfo?buildID=32184 for now if has not
been pushed.)



Comment 4 Ignacio Vazquez-Abrams 2008-01-21 16:09:54 UTC
Not quite.

Missing file: /foo.torrent
Pickling state...
Asked for a torrent that doesn't exist
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/deluge/interface.py", line 1464, in
add_torrent_clicked
    self.interactive_add_torrent(single)
  File "/usr/lib/python2.5/site-packages/deluge/interface.py", line 1354, in
interactive_add_torrent
    return self.interactive_add_torrent_path(torrent, path)
  File "/usr/lib/python2.5/site-packages/deluge/interface.py", line 1440, in
interactive_add_torrent_path
    self.torrent_model_append(unique_id)
  File "/usr/lib/python2.5/site-packages/deluge/interface.py", line 678, in
torrent_model_append
    self.get_torrent_state_list(unique_id, state))
  File "/usr/lib/python2.5/site-packages/deluge/interface.py", line 973, in
get_torrent_state_list
    queue = state['queue_pos']
TypeError: 'NoneType' object is unsubscriptable


Comment 5 Ignacio Vazquez-Abrams 2008-01-23 13:20:38 UTC
I moved ~/.config/deluge aside and reconfigured it from scratch (and noticed
another problem which I will open a separate bug for) and it decided to work.
Talk about fragile...