Opened 3 years ago

Closed 20 months ago

#3515 closed bug (Fixed)

[AutoAdd] - Disables watch on a folder when a torrent file fails decoding.

Reported by: deaddrop9 Owned by:
Priority: minor Milestone: 2.1.2
Component: Plugin Version: 2.0.3
Keywords: AutoAdd Cc:

Description

Steps

Create an invalid torrent file (something this is not bencoded) eg

echo "Invalid torrent file format" > /path/to/watch-folder/bad.torrent

Expected outcome

Torrent file should be detected by AutoAdd, and after failing attempts to add a few times, it should be renamed to bad.torrent.invalid (using existing file failure functionality) and AutoAdd should continue to monitor the folder.

Actual outcome

Watch folder is disabled in AutoAdd, and torrent filename is unchanged. Re-enabling the folder in AutoAdd, just leads to repeated disables.

deluged[112816]: 21:51:20 [ERROR   ][deluge_autoadd.core           :367 ] Disabling "/path/to/watch-folder", error during update: [Failure instance: Traceback: <class 'RuntimeError'>: unexpected end of file in bencoded string
deluged[112816]: /usr/lib/python3/dist-packages/deluge/plugins/AutoAdd-1.8.egg/deluge_autoadd/core.py:108:enable_looping
deluged[112816]: /usr/lib/python3/dist-packages/deluge/plugins/AutoAdd-1.8.egg/deluge_autoadd/core.py:379:enable_watchdir
deluged[112816]: /usr/local/lib/python3.8/dist-packages/twisted/internet/task.py:194:start
deluged[112816]: /usr/local/lib/python3.8/dist-packages/twisted/internet/task.py:239:__call__
deluged[112816]: --- <exception caught here> ---
deluged[112816]: /usr/local/lib/python3.8/dist-packages/twisted/internet/defer.py:151:maybeDeferred
deluged[112816]: /usr/lib/python3/dist-packages/deluge/plugins/AutoAdd-1.8.egg/deluge_autoadd/core.py:278:update_watchdir
deluged[112816]: /usr/lib/python3/dist-packages/deluge/plugins/AutoAdd-1.8.egg/deluge_autoadd/core.py:164:load_torrent
deluged[112816]: ]

Root cause is failure to check data returned from bdecode function. (it return None when decoding fails) (pull request to fix coming shortly)

Change History (1)

comment:1 by Calum, 20 months ago

Milestone: needs verified2.1.2
Resolution: Fixed
Status: newclosed

Thanks for fix!

Note: See TracTickets for help on using tickets.