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@…

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 non7top 12 years ago.
Patch for latest master

Download all attachments as: .zip

Change History (10)

Changed 13 years ago by Elberet

fix session lookup error

comment:1 Changed 12 years ago by non7top

  • Cc non7top@… added

comment:2 Changed 12 years ago by non7top

This one still exists with 569dd0c58588549188dd44912e3338866c3a6dc2

Changed 12 years ago by non7top

Patch for latest master

comment:3 Changed 12 years ago by non7top

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 Changed 12 years ago by non7top

Please commit to master

comment:5 Changed 12 years ago by andar

  • Status changed from new to pending

comment:6 Changed 12 years ago by non7top

Looks like this fixes the problem. Thanks.

comment:7 Changed 12 years ago by andar

  • Resolution set to fixed
  • Status changed from pending to closed

comment:8 Changed 7 years ago by Cas

  • Milestone changed from 2.0.x to 2.x

Milestone renamed

Note: See TracTickets for help on using tickets.