clinton-hall / nzbToMedia

Provides NZB and Torrent postprocessing To CouchPotatoServer, SickBeard/SickRage, HeadPhones, Mylar and Gamez
GNU General Public License v3.0
674 stars 176 forks source link

405 returned on postprocessing request towards Radarr #1807

Closed weedaj closed 3 years ago

weedaj commented 3 years ago

Describe the bug Receiving a 405 MethodNotAllowed on postprocessing towards from NZBGET to Radarr

Technical Specs

  1. Synology DS-212j
  2. root@DiskStation:~# python --version Python 3.7.7
  3. NZBGet
  4. Radarr (version Version 0.2.0.1504 / Mono Version 4.6.2, cannot upgrade due known issues on Radarr/Mono with armv5)

Expected behavior Radarr is expected to accept postprocess request from NZBGET (through nzbtomedia) but in stead Radarr reports a 405 in response to the postprocess request as a result from a downloaded movie. See attached logs. I have mimicked the postprocess request through cURL as I expected a Allowed header to find out more but same result. See provided logs. How to resolve this?

Log

curl -v --header "Content-Type: application/json" \
>   --request POST \
>   --data '{"name": "DownloadedMovieScan", "path": "/volume1/downloads/complete
/_Films2rename2/Cars (2006) 1080p NL Audio & Subs", "downloadClientI
d": "ffd1bd7b35cc429d947c587d8a28d813", "importMode": "Move"}' \
>   http://192.168.178.203:8310/radarr/api/command?apiKey=8935a7c1b6ce45b0ae138c
5ef89b8e05
Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying 192.168.178.203:8310...
* TCP_NODELAY set
* Connected to 192.168.178.203 (192.168.178.203) port 8310 (#0)
> POST /radarr/api/command?apiKey=XXXX HTTP/1.1
> Host: 192.168.178.203:8310
> User-Agent: curl/7.66.0
> Accept: */*
> Content-Type: application/json
> Content-Length: 209
>
* upload completely sent off: 209 out of 209 bytes
* Mark bundle as not supporting multiuse
< HTTP/1.1 405 Method Not Allowed
< X-ApplicationVersion: 0.2.0.1504
< Cache-Control: no-cache, no-store, must-revalidate
< Pragma: no-cache
< Expires: 0
< Content-Type: application/json; charset=utf-8
< Server: Mono-HTTPAPI/1.0
< Date: Sun, 17 Jan 2021 06:54:29 GMT
< Transfer-Encoding: chunked
< Keep-Alive: timeout=15,max=100
<
{
  "message": "MethodNotAllowed"
* Connection #0 to host 192.168.178.203 left intact

Attached the NZBGET log: Cars (2006) 1080p NL Audio &amp;amp; Subs.log

clinton-hall commented 3 years ago

I think the issue is probably with "path": "/volume1/downloads/complete /_Films2rename2/Cars (2006) 1080p NL Audio &amp;amp;amp; Subs

I suspect the URL encoding of the & is causing issues.

Does this happen with other downloads, or only ones with & in the download name?

weedaj commented 3 years ago

I think the issue is probably with "path": "/volume1/downloads/complete /_Films2rename2/Cars (2006) 1080p NL Audio &amp;amp;amp; Subs

I suspect the URL encoding of the & is causing issues.

Does this happen with other downloads, or only ones with & in the download name?

hi, thanks for your reply. poor choice to serve as example in my post but it happens on all Radarr downloads. Another example below:

INFO | Tue Jan 19 2021 01:26:18 | nzbToRadarr: [01:26:18] [ERROR]::RADARR: Server returned status 405
INFO | Tue Jan 19 2021 01:26:16 | nzbToRadarr: [01:26:16] [POSTPROCESS]::RADARR: Starting DownloadedMoviesScan scan for Cars 3 2017 720p BluRay X264-AMIABLE
INFO | Tue Jan 19 2021 01:26:16 | nzbToRadarr: [01:26:16] [DEBUG]::RADARR: Opening URL: http://localhost:8310/radarr/api/command with PARAMS: {'name': 'DownloadedMoviesScan', 'path': '/volume1/downloads/complete/_Films2rename2/Cars 3 2017 720p BluRay X264-AMIABLE', 'downloadClientId': '8fcfcdbefefe45e28f8b9d8937dc9c82', 'importMode': 'Move'}
clinton-hall commented 3 years ago

ok... looks like Radarr may have moved to api V3 (and depreciated the old)

Can you test http://localhost:8310/radarr/api/v3/command with PARAMS: {'apiKey': <insert api key here>, 'name': 'DownloadedMoviesScan', 'path': '/volume1/downloads/complete/_Films2rename2/Cars 3 2017 720p BluRay X264-AMIABLE', 'downloadClientId': '8fcfcdbefefe45e28f8b9d8937dc9c82', 'importMode': 'Move'}

basically, the main change is adding v3 to the url.

weedaj commented 3 years ago

hi @clinton-hall , thanks again... Unfortunately no difference in result:

# curl -v --header "Content-Type: application/json" \
>   --request POST \
>   --data '{"apiKey": "8935a7c1b6ce45b0ae138c5ef89b8e05", name": "DownloadedMovieScan", "path": "/volume1/downloads/complete/_Films2rename2/Cars 3 2017 720p BluRay X264-AMIABLE", "downloadClientId": "ffd1bd7b35cc42
9d947c587d8a28d813", "importMode": "Move"}' \
>   http://192.168.178.203:8310/radarr/api/v3/command
Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying 192.168.178.203:8310...
* TCP_NODELAY set
* Connected to 192.168.178.203 (192.168.178.203) port 8310 (#0)
> POST /radarr/api/v3/command HTTP/1.1
> Host: 192.168.178.203:8310
> User-Agent: curl/7.66.0
> Accept: */*
> Content-Type: application/json
> Content-Length: 245
>
* upload completely sent off: 245 out of 245 bytes
* Mark bundle as not supporting multiuse
< HTTP/1.1 405 Method Not Allowed
< X-ApplicationVersion: 0.2.0.1504
< Cache-Control: no-cache, no-store, must-revalidate
< Pragma: no-cache
< Expires: 0
< Content-Type: application/json; charset=utf-8
< Server: Mono-HTTPAPI/1.0
< Date: Wed, 20 Jan 2021 06:35:26 GMT
< Transfer-Encoding: chunked
< Keep-Alive: timeout=15,max=100
<
{
  "message": "MethodNotAllowed"
* Connection #0 to host 192.168.178.203 left intact
clinton-hall commented 3 years ago

what are the Drone Factory settings in Radarr?

weedaj commented 3 years ago

what are the Drone Factory settings in Radarr?

I didn't configure anything there

image

weedaj commented 3 years ago

@clinton-hall sorry to have wasted your time. In the recent past I (and many with me) had trouble with Radarr updates not being suitable on my ARMv5 machine causing me to uninstall and reinstall a version that was proven to work. I had not set the web_root within Radarr yet but it was still in the NZBTORADARR config. The 405 threw me off to be honest but setting the web_root in Radarr restored the postprocessing integration. Thanks for your help and again apologies.

clinton-hall commented 3 years ago

No worries. Glad you got it working.