SynoCommunity / spksrc

Cross compilation framework to create native packages for the Synology's NAS
https://synocommunity.com
Other
3.04k stars 1.24k forks source link

Sonarr v3 + DSM 7 . Unable to add Download Station as client #4763

Closed altanir84 closed 3 years ago

altanir84 commented 3 years ago

Setup

Package Name: Sonarr Package Version: 3.0.6.1265

NAS Model: Synology DS418 NAS Architecture: rtd1296 DSM version: DSM 7.0-41890

Expected behavior

Add Download Station as client

Actual behavior

Sonarr can't add DS as client, results in a HTTP request failed: [400:BadRequest]

Steps to reproduce

1. Upgrade to DSM 7 2. Install Mono 5.20.1.34-17 3. Install and upgrade Sonarr, try to add the client.

Doubled checked user permissions, firewall, uninstalled and reinstalled everything. Can't get it working.

Package log

[v3.0.6.1265] NzbDrone.Common.Http.HttpException: HTTP request failed: [400:BadRequest] [GET] at [http://192.168.1.xxx:PORT/webapi/query.cgi?api=(removed)&version=1&method=query&query=SYNO.API.Auth%2CSYNO.DownloadStation.Task] at NzbDrone.Core.Download.Clients.DownloadStation.Proxies.DiskStationProxyBase.ProcessRequest[T] (NzbDrone.Common.Http.HttpRequestBuilder requestBuilder, System.String operation, NzbDrone.Core.Download.Clients.DownloadStation.DiskStationApi api, NzbDrone.Core.Download.Clients.DownloadStation.DownloadStationSettings settings) [0x000e8] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Download\Clients\DownloadStation\Proxies\DiskStationProxyBase.cs:125 at NzbDrone.Core.Download.Clients.DownloadStation.Proxies.DiskStationProxyBase.UpdateApiInfo (NzbDrone.Core.Download.Clients.DownloadStation.DownloadStationSettings settings) [0x0005e] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Download\Clients\DownloadStation\Proxies\DiskStationProxyBase.cs:207 at NzbDrone.Core.Download.Clients.DownloadStation.Proxies.DiskStationProxyBase.GetApiInfo (NzbDrone.Core.Download.Clients.DownloadStation.DiskStationApi api, NzbDrone.Core.Download.Clients.DownloadStation.DownloadStationSettings settings) [0x00022] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Download\Clients\DownloadStation\Proxies\DiskStationProxyBase.cs:234 at NzbDrone.Core.Download.Clients.DownloadStation.Proxies.DiskStationProxyBase.GetApiInfo (NzbDrone.Core.Download.Clients.DownloadStation.DownloadStationSettings settings) [0x00000] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Download\Clients\DownloadStation\Proxies\DiskStationProxyBase.cs:248 at NzbDrone.Core.Download.Clients.DownloadStation.TorrentDownloadStation.ValidateVersion () [0x00000] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Download\Clients\DownloadStation\TorrentDownloadStation.cs:392 at NzbDrone.Core.Download.Clients.DownloadStation.TorrentDownloadStation.TestConnection () [0x00000] in M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Download\Clients\DownloadStation\TorrentDownloadStation.cs:356

400 The plain HTTP request was sent to HTTPS port

400 Bad Request

The plain HTTP request was sent to HTTPS port

nginx

2021-08-06 16:34:49.7|Warn|SonarrErrorPipeline|Invalid request Validation failed: -- Host: Unable to connect to Torrent Download Station 2021-08-06 16:34:49.7|Debug|Api|[POST] /api/v3/downloadclient/test: 400.BadRequest (576 ms) 2021-08-06 16:35:41.1|Debug|Api|[GET] /api/v3/command: 200.OK (2 ms) 2021-08-06 16:35:41.2|Debug|Api|[GET] /api/v3/command: 200.OK (3 ms) 2021-08-06 16:37:11.1|Debug|Api|[GET] /api/v3/command: 200.OK (9 ms) 2021-08-06 16:37:11.3|Debug|Api|[GET] /api/v3/command: 200.OK (2 ms) 2021-08-06 16:38:11.2|Debug|Api|[GET] /api/v3/command: 200.OK (2 ms) 2021-08-06 16:38:34.5|Debug|Api|[GET] /api/v3/health: 200.OK (2 ms) 2021-08-06 16:38:34.5|Debug|Api|[GET] /api/v3/system/status: 200.OK (9 ms) 2021-08-06 16:38:34.8|Debug|Api|[GET] /api/v3/diskspace: 200.OK (290 ms) 2021-08-06 16:38:36.3|Debug|Api|[GET] /api/v3/log?page=1&pageSize=50&sortDirection=descending&sortKey=time: 200.OK (235 ms) 2021-08-06 16:38:41.4|Debug|Api|[GET] /api/v3/command: 200.OK (3 ms) 2021-08-06 16:38:41.5|Debug|Api|[GET] /api/v3/command: 200.OK (2 ms) 2021-08-06 16:40:11.5|Info|RssSyncService|Starting RSS Sync 2021-08-06 16:40:11.5|Debug|FetchAndParseRssService|Available indexers 1 2021-08-06 16:40:11.6|Debug|Api|[GET] /api/v3/command: 200.OK (2 ms) 2021-08-06 16:40:11.8|Debug|Api|[GET] /api/v3/command: 200.OK (2 ms) 2021-08-06 16:40:12.0|Debug|Rarbg|Downloading Feed https://torrentapi.org/pubapi_v2.php?mode=list&ranked=0&category=18%3B41%3B49&limit=100&token=(removed)&format=json_extended&app_id=Sonarr 2021-08-06 16:40:12.9|Debug|FetchAndParseRssService|Found 0 from Rarbg 2021-08-06 16:40:12.9|Debug|FetchAndParseRssService|Found 0 reports 2021-08-06 16:40:12.9|Info|DownloadDecisionMaker|No results found 2021-08-06 16:40:12.9|Info|RssSyncService|RSS Sync Completed. Reports found: 0, Reports grabbed: 0 2021-08-06 16:40:12.9|Debug|PendingReleaseService|Removing failed releases from pending 2021-08-06 16:40:13.1|Debug|Api|[GET] /api/v3/health: 200.OK (2 ms) 2021-08-06 16:40:13.1|Debug|Api|[GET] /api/v3/command: 200.OK (2 ms) 2021-08-06 16:40:22.1|Debug|Api|[GET] /api/v3/config/host: 200.OK (13 ms) 2021-08-06 16:40:22.5|Debug|Api|[GET] /api/v3/update: 200.OK (392 ms) 2021-08-06 16:41:41.7|Debug|Api|[GET] /api/v3/command: 200.OK (2 ms) 2021-08-06 16:41:41.9|Debug|Api|[GET] /api/v3/command: 200.OK (2 ms) 2021-08-06 16:43:12.0|Debug|Api|[GET] /api/v3/command: 200.OK (2 ms) 2021-08-06 16:43:12.3|Debug|Api|[GET] /api/v3/command: 200.OK (3 ms) 2021-08-06 16:43:12.6|Debug|Api|[GET] /api/v3/command: 200.OK (2 ms) 2021-08-06 16:44:39.2|Debug|Api|[GET] /api/v3/log?page=1&pageSize=50&sortDirection=descending&sortKey=time: 200.OK (11 ms) 2021-08-06 16:44:42.2|Debug|Api|[GET] /api/v3/command: 200.OK (2 ms) 2021-08-06 16:44:42.4|Debug|Api|[GET] /api/v3/command: 200.OK (2 ms) 2021-08-06 16:44:46.3|Debug|Api|[GET] /api/v3/health: 200.OK (2 ms) 2021-08-06 16:44:46.3|Debug|Api|[GET] /api/v3/system/status: 200.OK (4 ms) 2021-08-06 16:44:46.6|Debug|Api|[GET] /api/v3/diskspace: 200.OK (284 ms) 2021-08-06 16:44:47.8|Debug|Api|[GET] /api/v3/command: 200.OK (3 ms) 2021-08-06 16:44:47.9|Debug|Api|[GET] /api/v3/system/task: 200.OK (52 ms) 2021-08-06 16:44:51.7|Debug|Api|[GET] /api/v3/config/ui: 200.OK (3 ms) 2021-08-06 16:44:52.6|Debug|Api|[GET] /api/v3/config/host: 200.OK (13 ms) 2021-08-06 16:44:53.5|Debug|Api|[GET] /api/v3/health: 200.OK (2 ms) 2021-08-06 16:44:53.5|Debug|Api|[GET] /api/v3/system/status: 200.OK (4 ms) 2021-08-06 16:44:53.8|Debug|Api|[GET] /api/v3/diskspace: 200.OK (290 ms) 2021-08-06 16:44:55.1|Debug|Api|[GET] /api/v3/log?page=1&pageSize=50&sortDirection=descending&sortKey=time: 200.OK (12 ms) 2021-08-06 16:44:56.6|Debug|Api|[GET] /api/v3/log/file: 200.OK (46 ms)

publicarray commented 3 years ago

From memory the API changed in DSM7 and sonar needs to updated to support the change. I think the other *arr packages already updated to the new API.

altanir84 commented 3 years ago

I tried radarr as well and it also returns the same error while trying to add DS as a client.

BenjV commented 3 years ago

As @publicarray said the downloadstation api changed and on DSM 7 you cannot go back to the old version of Download Station. But on the Sonarr github I red that the problem was fixed and they switched to the new Download Station api. So if it still does not function I would suggest to create an issue on their github.

I wrote the api for Medusa so I know that the new api has some quirks and Synology did not release any documentation. Also to function correctly you have to use admin as the user that Sonarr uses to login to downloadstation, no other account wll funtion.

altanir84 commented 3 years ago

Really? Well, that's a bummer! Everywhere I look, it is recommended to disable the admin account, in order to prevent attacks. And using another account with admin rights would mean to disable 2 factor authentication for such account, which is another bummer.

Oh man, how I regret upgrading to DSM 7.

Edit: Changed update from main branch to develop and tried with version 3.0.6.1301, still not working. Damn. Used an account with admin permissions, and still no luck.

log:

2021-08-07 14:54:23.9|Warn|SonarrErrorPipeline|Invalid request Validation failed: -- Host: Unable to connect to Torrent Download Station 2021-08-07 14:54:23.9|Debug|Api|[POST] /api/v3/downloadclient/test: 400.BadRequest (94 ms) 2021-08-07 14:54:40.0|Debug|Api|[GET] /api/v3/health: 200.OK (2 ms) 2021-08-07 14:54:40.0|Debug|Api|[GET] /api/v3/system/status: 200.OK (9 ms) 2021-08-07 14:54:40.3|Debug|Api|[GET] /api/v3/diskspace: 200.OK (311 ms) 2021-08-07 14:54:41.0|Debug|Api|[GET] /api/v3/config/host: 200.OK (12 ms) 2021-08-07 14:54:41.7|Debug|Api|[GET] /api/v3/update: 200.OK (685 ms) 2021-08-07 14:54:56.2|Debug|Api|[GET] /api/v3/log?page=1&pageSize=50&sortDirection=descending&sortKey=time: 200.OK (261 ms) 2021-08-07 14:54:58.6|Debug|Api|[GET] /api/v3/log/file: 200.OK (82 ms)

edit 2: I enabled the admin account and tried using it, same result.

altanir84 commented 3 years ago

Final Edit:

I'll be dammed, I figured it out! I was using the wrong port! I was using the same port I use to access the NAS, but it IS a https port, thus resulting in the error above. On the DSM control panel, under Login Portal there is both http and https ports. I tried using the http one and it worked (using the develop version). DS is added as a client. Sorry for posting this as an issue, it was really looking like one. Thanks for all the replies, and have a wonderful day.