Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download handler throwing errors connecting to NZBget #9789

Closed
Fuergrissa1 opened this issue Aug 13, 2021 · 7 comments
Closed

Download handler throwing errors connecting to NZBget #9789

Fuergrissa1 opened this issue Aug 13, 2021 · 7 comments

Comments

@Fuergrissa1
Copy link

Describe the bug
I've been getting this error from the download handler that I am struggling to resolve. I have torrents turned off and only use NZB, but I've verified the Host/user/pass for both are correct (deluge and NZBGet both configured in medusa, both test as "Success: Connected and Authenticated") But I still get the following error in the log and while downloads do usually get picked back up by Medusa after completing in NZBget there is a significant delay and sometimes they are left hanging as "Snatched" long after the download completes.

To Reproduce

  1. Verify settings NZBSearch > Host:port, Username, Password, from NZBGet config, I've tried the admin user/pass as well as restricted user/pas. Both pass the "Test NZBGet"
  2. Error appears in log each time the download handler runs on schedule
  3. Some downloads post process automatically but with a substantial delay after download completes (unknown if this is falling back to postprocessingdir).
  4. Some downloads are left hanging as "Snatched"

Expected behavior
Medusa will find completed downloads from NZBGet and post process them

Screenshots
If applicable, add screenshots to help explain your problem.

Medusa (please complete the following information):
Branch: master
Commit: 9b23c72
Version: 0.5.15
Database: 44.18
Python Version: | 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)]
SSL Version: | OpenSSL 1.1.0j 20 Nov 2018
OS: | Windows-10-10.0.19041-SP0

Debug logs (at least 50 lines):
General > Advanced Settings > Enable debug

2021-08-13 10:58:27 ERROR	DOWNLOADHANDLER :: [9b23c72] Exception while checking torrent status. with error: test_authentication() missing 4 required positional arguments: 'host', 'username', 'password', and 'use_https'

Traceback (most recent call last):

  File "C:\ProgramData\Medusa\Medusa\medusa\schedulers\download_handler.py", line 373, in run

    self._clean(nzb_client)

  File "C:\ProgramData\Medusa\Medusa\medusa\schedulers\download_handler.py", line 332, in _clean

    if not self._test_connection(client, client_type):

  File "C:\ProgramData\Medusa\Medusa\medusa\schedulers\download_handler.py", line 319, in _test_connection

    return client.test_authentication()

TypeError: test_authentication() missing 4 required positional arguments: 'host', 'username', 'password', and 'use_https'
2021-08-13 10:58:24 DEBUG	DOWNLOADHANDLER :: [9b23c72] Successfully connected to NZBget
2021-08-13 10:58:20 DEBUG	DOWNLOADHANDLER :: [9b23c72] Successfully connected to NZBget
2021-08-13 10:58:18 DEBUG	DOWNLOADHANDLER :: [9b23c72] Deluge: Response to POST request is {"id": 72, "result": {}, "error": null}
2021-08-13 10:58:18 DEBUG	DOWNLOADHANDLER :: [9b23c72] With post data: {"method": "core.get_torrent_status", "params": ["e4d44da9e71a8f4411bc3fd82aad7689cfa0f07f", ["name", "hash", "progress", "state", "ratio", "stop_ratio", "is_seed", "is_finished", "paused", "files", "download_location"]], "id": 72}
2021-08-13 10:58:18 DEBUG	DOWNLOADHANDLER :: [9b23c72] User-Agent: Medusa/0.5.15 (Windows; 10; a3008882-f3e5-11eb-9945-7085c25dfb2c)
2021-08-13 10:58:18 DEBUG	DOWNLOADHANDLER :: [9b23c72] POST URL: http://localhost:8085/json [Status: 200]
2021-08-13 10:58:18 DEBUG	DOWNLOADHANDLER :: [9b23c72] Checking Deluge torrent e4d44da9e71a8f4411bc3fd82aad7689cfa0f07f status.
2021-08-13 10:58:18 DEBUG	DOWNLOADHANDLER :: [9b23c72] With post data: {"method": "web.connected", "params": [], "id": 10}
2021-08-13 10:58:18 DEBUG	DOWNLOADHANDLER :: [9b23c72] User-Agent: Medusa/0.5.15 (Windows; 10; a3008882-f3e5-11eb-9945-7085c25dfb2c)
2021-08-13 10:58:18 DEBUG	DOWNLOADHANDLER :: [9b23c72] POST URL: http://localhost:8085/json [Status: 200]
2021-08-13 10:58:18 DEBUG	DOWNLOADHANDLER :: [9b23c72] With post data: {"method": "auth.login", "params": ["**********"], "id": 1}
2021-08-13 10:58:18 DEBUG	DOWNLOADHANDLER :: [9b23c72] User-Agent: Medusa/0.5.15 (Windows; 10; a3008882-f3e5-11eb-9945-7085c25dfb2c)
2021-08-13 10:58:18 DEBUG	DOWNLOADHANDLER :: [9b23c72] POST URL: http://localhost:8085/json [Status: 200]
2021-08-13 10:58:18 DEBUG	DOWNLOADHANDLER :: [9b23c72] Deluge: Response to POST request is {"id": 72, "result": {}, "error": null}
2021-08-13 10:58:18 DEBUG	DOWNLOADHANDLER :: [9b23c72] With post data: {"method": "core.get_torrent_status", "params": ["e4d44da9e71a8f4411bc3fd82aad7689cfa0f07f", ["name", "hash", "progress", "state", "ratio", "stop_ratio", "is_seed", "is_finished", "paused", "files", "download_location"]], "id": 72}
2021-08-13 10:58:18 DEBUG	DOWNLOADHANDLER :: [9b23c72] User-Agent: Medusa/0.5.15 (Windows; 10; a3008882-f3e5-11eb-9945-7085c25dfb2c)
2021-08-13 10:58:18 DEBUG	DOWNLOADHANDLER :: [9b23c72] POST URL: http://localhost:8085/json [Status: 200]
2021-08-13 10:58:18 DEBUG	DOWNLOADHANDLER :: [9b23c72] Checking Deluge torrent e4d44da9e71a8f4411bc3fd82aad7689cfa0f07f status.
2021-08-13 10:58:18 DEBUG	DOWNLOADHANDLER :: [9b23c72] With post data: {"method": "web.connected", "params": [], "id": 10}
2021-08-13 10:58:18 DEBUG	DOWNLOADHANDLER :: [9b23c72] User-Agent: Medusa/0.5.15 (Windows; 10; a3008882-f3e5-11eb-9945-7085c25dfb2c)
2021-08-13 10:58:18 DEBUG	DOWNLOADHANDLER :: [9b23c72] POST URL: http://localhost:8085/json [Status: 200]
2021-08-13 10:58:18 DEBUG	DOWNLOADHANDLER :: [9b23c72] With post data: {"method": "auth.login", "params": ["**********"], "id": 1}
2021-08-13 10:58:18 DEBUG	DOWNLOADHANDLER :: [9b23c72] User-Agent: Medusa/0.5.15 (Windows; 10; a3008882-f3e5-11eb-9945-7085c25dfb2c)
2021-08-13 10:58:18 DEBUG	DOWNLOADHANDLER :: [9b23c72] POST URL: http://localhost:8085/json [Status: 200]
2021-08-13 10:58:16 DEBUG	DOWNLOADHANDLER :: [9b23c72] Starting new thread: DOWNLOADHANDLER
2021-08-13 10:56:23 DEBUG	EPISODEUPDATER :: [9b23c72] Finished updating network timezones
2021-08-13 10:56:23 DEBUG	EPISODEUPDATER :: [9b23c72] User-Agent: Medusa/0.5.15 (Windows; 10; a3008882-f3e5-11eb-9945-7085c25dfb2c)
2021-08-13 10:56:23 DEBUG	EPISODEUPDATER :: [9b23c72] GET URL: https://cdn.pymedusa.com/sb_network_timezones/network_timezones.txt [Status: 200]
2021-08-13 10:56:23 DEBUG	EPISODEUPDATER :: [9b23c72] Started updating network timezones
2021-08-13 10:56:23 DEBUG	EPISODEUPDATER :: [9b23c72] Starting new thread: EPISODEUPDATER

Additional context
This has been happening ever since I enabled the download handler a few releases back

@p0psicles
Copy link
Contributor

Can you test the develop branch? I recently made some improvements.

@Fuergrissa1
Copy link
Author

Is there a quick way to switch? I don't see an option in the back-end settings. Otherwise, I would do a backup, separate install to Develop branch and restore . Is that a good way to do this?

@p0psicles
Copy link
Contributor

You could try config - general - advanced. You should fill in your github login creds there.

@Fuergrissa1
Copy link
Author

When I try to checkout from general > advanced it throws this error:

2021-08-13 13:09:17 WARNING APIv2-Thread-11 :: [9b23c72] Couldn't determine current branch or current branch master doesn't match desired branch develop.
Checkout the desired branch or try again later.
2021-08-13 13:09:17 INFO APIv2-Thread-11 :: [9b23c72] Config backup successful
2021-08-13 13:09:16 INFO APIv2-Thread-11 :: [9b23c72] Config backup in progress...

Is there another method? can I clone over the existing files from the Git GUI?

@p0psicles
Copy link
Contributor

Yes.
Git fetch origin
Git checkout -t origin/develop
Should do the trick

@Fuergrissa1
Copy link
Author

Fuergrissa1 commented Aug 13, 2021

Thanks, I was able to do it with your advice. Also, It looks like the changes you made in the develop branch will fix this issue. here is a log:

Edit: I mis-read because the error text is different and the process continues on to get the relevant information from NZBGet, however, there is still an error present.

> 2021-08-13 15:06:36 INFO	POSTPROCESSQUEUE-POST-PROCESS :: [b496018] Completed Postproccessing
2021-08-13 15:06:36 INFO	POSTPROCESSQUEUE-POST-PROCESS :: [b496018] Updated history with resource path: D:\~~~~.#6342 and resource: ~~~~.nzb with new status Failed, Postprocessed
2021-08-13 15:06:36 INFO	POSTPROCESSQUEUE-POST-PROCESS :: [b496018] Failed Download Processing succeeded: ~~~~.nzb, D:\~~~~.#6342
2021-08-13 15:06:36 DEBUG	POSTPROCESSQUEUE-POST-PROCESS :: [b496018] Deleted folder: D:\~~~~.#6342
2021-08-13 15:06:36 INFO	POSTPROCESSQUEUE-POST-PROCESS :: [b496018] Deleting folder: D:\~~~~.#6342
2021-08-13 15:06:36 INFO	POSTPROCESSQUEUE-POST-PROCESS :: [b496018] Episodes where found for this failed processor, using those instead of a release name
2021-08-13 15:06:36 INFO	POSTPROCESSQUEUE-POST-PROCESS :: [b496018] Failed download detected: (resource: ~~~~.nzb, dir: D:\~~~~#6342)
2021-08-13 15:06:36 DEBUG	POSTPROCESSQUEUE-POST-PROCESS :: [b496018] Missed file: ~~~~.#6342: Failed download.
2021-08-13 15:06:36 INFO	POSTPROCESSQUEUE-POST-PROCESS :: [b496018] I did encounter some unprocessable items: 
2021-08-13 15:06:36 INFO	POSTPROCESSQUEUE-POST-PROCESS :: [b496018] Post-processing completed.
2021-08-13 15:06:36 DEBUG	POSTPROCESSQUEUE-POST-PROCESS :: [b496018] Processing resource: ~~~~.nzb
2021-08-13 15:06:36 INFO	POSTPROCESSQUEUE-POST-PROCESS :: [b496018] Processing path: ~~~~#6342
2021-08-13 15:06:36 INFO	POSTPROCESSQUEUE-POST-PROCESS :: [b496018] Beginning postprocessing for path D:\~~~~#6342 and resource ~~~~.nzb
2021-08-13 15:06:35 ERROR	DOWNLOADHANDLER :: [b496018] Exception while checking torrent status. with error: 'bool' object is not subscriptable
Traceback (most recent call last):
  File "C:\ProgramData\Medusa\Medusa\medusa\schedulers\download_handler.py", line 421, in run
    self._clean(nzb_client)
  File "C:\ProgramData\Medusa\Medusa\medusa\schedulers\download_handler.py", line 367, in _clean
    if not self._test_connection(client, client_type):
  File "C:\ProgramData\Medusa\Medusa\medusa\schedulers\download_handler.py", line 359, in _test_connection
    return result[0]
TypeError: 'bool' object is not subscriptable
2021-08-13 15:06:35 DEBUG	DOWNLOADHANDLER :: [b496018] Successfully connected to NZBget
2021-08-13 15:06:33 DEBUG	DOWNLOADHANDLER :: [b496018] Sending postprocess job for nzb with info_hash: 6341
status: Failed
client: nzbget
destination: D:\~~~~#6342
resource: ~~~~.nzb
2021-08-13 15:06:33 INFO	DOWNLOADHANDLER :: [b496018] Updating status to [Failed] for ~~~~ with info_hash 6341
2021-08-13 15:06:33 DEBUG	DOWNLOADHANDLER :: [b496018] Found nzb on nzbget with info_hash 6341
2021-08-13 15:06:31 DEBUG	DOWNLOADHANDLER :: [b496018] Successfully connected to NZBget
2021-08-13 15:06:27 DEBUG	DOWNLOADHANDLER :: [b496018] Successfully connected to NZBget
2021-08-13 15:06:25 DEBUG	DOWNLOADHANDLER :: [b496018] With post data: {"method": "web.connected", "params": [], "id": 10}
2021-08-13 15:06:25 DEBUG	DOWNLOADHANDLER :: [b496018] User-Agent: Medusa/0.5.15 (Windows; 10; 234e3a1c-fc68-11eb-b1f0-7085c25dfb2c)
2021-08-13 15:06:25 DEBUG	DOWNLOADHANDLER :: [b496018] POST URL: http://localhost:8085/json [Status: 200]
2021-08-13 15:06:25 DEBUG	DOWNLOADHANDLER :: [b496018] With post data: {"method": "auth.login", "params": ["**********"], "id": 1}
2021-08-13 15:06:25 DEBUG	DOWNLOADHANDLER :: [b496018] User-Agent: Medusa/0.5.15 (Windows; 10; 234e3a1c-fc68-11eb-b1f0-7085c25dfb2c)
2021-08-13 15:06:25 DEBUG	DOWNLOADHANDLER :: [b496018] POST URL: http://localhost:8085/json [Status: 200]
2021-08-13 15:06:25 DEBUG	DOWNLOADHANDLER :: [b496018] With post data: {"method": "web.connected", "params": [], "id": 10}
2021-08-13 15:06:25 DEBUG	DOWNLOADHANDLER :: [b496018] User-Agent: Medusa/0.5.15 (Windows; 10; 234e3a1c-fc68-11eb-b1f0-7085c25dfb2c)
2021-08-13 15:06:25 DEBUG	DOWNLOADHANDLER :: [b496018] POST URL: http://localhost:8085/json [Status: 200]
2021-08-13 15:06:25 DEBUG	DOWNLOADHANDLER :: [b496018] With post data: {"method": "auth.login", "params": ["**********"], "id": 1}
2021-08-13 15:06:25 DEBUG	DOWNLOADHANDLER :: [b496018] User-Agent: Medusa/0.5.15 (Windows; 10; 234e3a1c-fc68-11eb-b1f0-7085c25dfb2c)
2021-08-13 15:06:25 DEBUG	DOWNLOADHANDLER :: [b496018] POST URL: http://localhost:8085/json [Status: 200]
2021-08-13 15:06:22 DEBUG	DOWNLOADHANDLER :: [b496018] Starting new thread: DOWNLOADHANDLER

@medariox
Copy link
Contributor

Fixed with #9801

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants