rembo10 / headphones

Automatic music downloader for SABnzbd
GNU General Public License v3.0
3.4k stars 600 forks source link

Deluge torrent remove error #3036

Closed anojht closed 7 years ago

anojht commented 7 years ago

Hello, I have headphones using Deluge as download client. Whenever a torrent is done downloading it goes to seeding stage. Even though in Deluge I have set seed ratio to 0 and stop seeding at 0 for troubleshooting and testing.

Inside headphones I get the following error in Debug LOG:

ERROR | Traceback (most recent call last):; File "/app/headphones/headphones/deluge.py", line 265, in removeTorrent; state = json.loads(response.text)['result']['state']; TypeError: 'NoneType' object has no attribute 'getitem'

ERROR | Deluge: Removing torrent failed: 'NoneType' object has no attribute 'getitem'

As a result post processing never triggers because torrent is not removed and moved to the completed location.

Deluge version is 1.3.15 Headphones version is f20520541d77d6325a53f3fceef68a557afc10cf

Anyone have an idea as to what is causing this?

anojht commented 7 years ago

An UPDATE: After playing around with different settings now I get the following error inside Headphones:

DEBUG | Deluge: "state" KeyError when trying to remove torrent e317c1401e2b3691df138febc46f5f29959f70f3

EDIT: I found the root of the issue. Turns out headphones keeps trying to remove old torrent that doesn't exist anymore. The torrent hash does not match any of the new torrents sent to Deluge.

AdeHub commented 7 years ago

Don't think this would stop post processing, got any logs?

But, we should probably stop that error being displayed and maybe clean up records that no longer exist in download client (manually removed)

anojht commented 7 years ago

I always have to trigger post processing manually because the torrent never reaches a paused state from seeding inside deluge and as a result never gets moved to the completed folder.

I have uploaded both my logs below: headphones.log

headphones1.log

AdeHub commented 7 years ago

Post processing kicks in when the torrent has finished downloading, not seeding.

The logs are a mess of jumbled up processes, try the following:

There's no need to have torrent_removal_interval set to run every 5 minutes, please set this back to 720, restart headphones.

Clear Snatched from History

Re-Snatch an album (that gets sent to Deluge)

After it's finished downloading then post logs from the automatic post processing, from Checking download folder for completed downloads (only snatched ones) onwards

anojht commented 7 years ago

I set 'torrent_removal_interval' to 5 minutes for testing. I will revert back and try the troubleshooting steps you outlined and post the logs back here.

BTW Thanks for your swift responses! It is nice to see an active Collaborator on a project.

anojht commented 7 years ago

So I tried your suggestions and here is my log below from Checking download folder for completed downloads (only snatched ones) Note that the download that's finished is the Kendrick Lamar Album and its in the seeding stage inside Deluge:

headphones.log

AdeHub commented 7 years ago

Can you shutdown headphones and then change the config.ini torrent_removal_interval to be 720, then restart and check the logs again after it starts post processing

anojht commented 7 years ago

Apologies, looks like headphones didn't save the changes to the torrent_removal_interval that I reverted back to. I will try your suggestion and post the logs back here, thanks for your patience!

anojht commented 7 years ago

Hello @AdeHub, here are my logs after 10 hours since setting torrent_removal_interval back to its defaults and waiting for post processing to kick in on the album that is still in the seeding stage inside Deluge.

Post processing does not trigger at all.

headphones.log

AdeHub commented 7 years ago

So does the folder exist?

/downloads/Kendrick Lamar - DAMN. (2017) FLAC

anojht commented 7 years ago

The folder exists in the following path: /downloads/incomplete/Kendrick Lamar - DAMN. (2017) FLAC

I have setup Deluge to move completed items to /downloads/ but this never takes place because torrents sent from headphones are always in seeding stage when they are done downloading so they never get "completed". I thought post processing would still kick off regardless since even if the moving doesn't happen, the incomplete folder is still inside the /downloads/ directory. But post processing never fires.

AdeHub commented 7 years ago

Deluge should be moving after downloading, does this never happen for you? what if you add a torrent manually?

anojht commented 7 years ago

This behavior occurs with both sonarr and radarr, and when I add torrents manually, just not with headphones. I think I have discovered something to do with docker folder mappings, I am testing here and I will update you

anojht commented 7 years ago

UPDATE: I got headphones to work by doing the following: the docker container I am using for headphones is from linuxserver

It has the /downloads variable as a place to map your downloads folder. However the Deluge container I am using uses the variable /data as the place for mapping the downloads folder. So due to this discrepancy Deluge never was able to move the completed torrent to the correct location.

I have manually changed the variable inside headphones to match with Deluge and now torrents get moved to the correct folder when completed and as a result also get removed from Deluge. Headphones post processing also kicks off and completes successfully.

I apologize, for this small configuration mismatch that was overlooked and I want to thank you for your time and patience. If it's OK with you, I will close the issue!

AdeHub commented 7 years ago

👍