Opened 13 years ago

Closed 12 years ago

Last modified 7 years ago

#1943 closed bug (Fixed)

Session handling breaks AutoAdd plugin

Reported by: Elberet Owned by:
Priority: critical Milestone: 2.x
Component: Core Version: master
Keywords: Cc: non7top@gmail.com

Description

Symptom:

17:41:08.104 [ERROR   ][deluge.plugins.autoadd.core   :295 ] Disabling '/torrent/watch', error during update: [Failure instance: Traceback: <type 'exceptions.KeyError'>: -1
(snip!)
/usr/lib64/python2.7/site-packages/deluge/plugins/AutoAdd-1.02-py2.7.egg/deluge/plugins/autoadd/core.py:242:update_watchdir
/usr/lib64/python2.7/site-packages/deluge/core/torrentmanager.py:406:add
/usr/lib64/python2.7/site-packages/deluge/core/torrentmanager.py:289:get_torrent_list
/usr/lib64/python2.7/site-packages/deluge/core/rpcserver.py:497:get_session_auth_level

This exception occurs whenever the AutoAdd plugin's update_watchdir runs, finds a new .torrent file and tries to add the torrent while Deluge is running in daemon mode and no client is connected. At that time, the RPCServer's self.factory.session_id value is either -1 or the ID of the session that last disconnected, while RPCServer's self.factory.authorized_sessions is empty, resulting in a KeyError.

This occurred on a Gentoo Linux box running Linux 3.0.4-gentoo-r1 x86_64 on an Athlon 64 X2 with Python 2.7, twisted 11.0.0. Deluge is based on commit 7227c97c, it is running headless and as a non-root user.

I have attached a quick and very, very dirty workaround.

Attachments (2)

commit-dd1c179 (1.5 KB ) - added by Elberet 13 years ago.
fix session lookup error
fix_session_lookup_error.patch (1.3 KB ) - added by Vladimir Berezhnoy 12 years ago.
Patch for latest master

Download all attachments as: .zip

Change History (10)

by Elberet, 13 years ago

Attachment: commit-dd1c179 added

fix session lookup error

comment:1 by Vladimir Berezhnoy, 13 years ago

Cc: non7top@gmail.com added

comment:2 by Vladimir Berezhnoy, 12 years ago

This one still exists with 569dd0c58588549188dd44912e3338866c3a6dc2

by Vladimir Berezhnoy, 12 years ago

Patch for latest master

comment:3 by Vladimir Berezhnoy, 12 years ago

Latest patch "fix_session_lookup_error.patch (1.3 KB) - added by non7top" doesn't resolve the problem. I think I'll have to switch back to some earlier revision.

comment:4 by Vladimir Berezhnoy, 12 years ago

Please commit to master

comment:5 by andar, 12 years ago

Status: newpending

comment:6 by Vladimir Berezhnoy, 12 years ago

Looks like this fixes the problem. Thanks.

comment:7 by andar, 12 years ago

Resolution: fixed
Status: pendingclosed

comment:8 by Calum, 7 years ago

Milestone: 2.0.x2.x

Milestone renamed

Note: See TracTickets for help on using tickets.