SOLVED Rarbg not working as indexer for Sonarr

Status
Not open for further replies.

SpaceAvenger69

Dabbler
Joined
Feb 4, 2015
Messages
20
I am running the latest stable version of FreeNAS (9.3) and am running Sonarr (v. 2.0.0.3357) via the plugin. Sonarr is working great with the exception of using RarBG for an indexer. I am able to set this up when running Windows 7 in a VM but would like to get it set up in the plugin version.

The log file shows:

15-8-26 11:53:34.8|Warn|Rarbg|Unable to connect to indexer: Error: SendFailure (Error writing headers)

System.Net.WebException: Error: SendFailure (Error writing headers) ---> System.Net.WebException: Error writing headers ---> System.IO.IOException: The authentication or decryption has failed. ---> Mono.Security.Protocol.Tls.TlsException: The authentication or decryption has failed.
at Mono.Security.Protocol.Tls.RecordProtocol.ProcessAlert (AlertLevel alertLevel, AlertDescription alertDesc) [0x00000] in <filename unknown>:0
at Mono.Security.Protocol.Tls.RecordProtocol.InternalReceiveRecordCallback (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at Mono.Security.Protocol.Tls.SslClientStream.EndNegotiateHandshake (IAsyncResult result) [0x00000] in <filename unknown>:0
at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
at System.Net.HttpWebRequest.GetResponse () [0x00000] in <filename unknown>:0
at NzbDrone.Common.Http.HttpClient.ExecuteWebRequest (NzbDrone.Common.Http.HttpRequest request, System.Net.HttpWebRequest webRequest) [0x00000] in <filename unknown>:0

15-8-26 11:53:34.8|Warn|NzbDroneErrorPipeline|Invalid request Validation failed:
-- Unable to connect to indexer, check the log for more details

Any help in getting this set up correctly would be greatly appreciated.

TIA
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I'm guessing I may need to recompile mono with a newer version of SSL?
I can try this tonight, and send you a test build.
 

SpaceAvenger69

Dabbler
Joined
Feb 4, 2015
Messages
20
That sounds great! I would really appreciate it. BTW...you're doing a great job on these plugins. I commend you! :D
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949

SpaceAvenger69

Dabbler
Joined
Feb 4, 2015
Messages
20
That build didn't resolve it. See new log output below. I know others were having this issue although not specific to the FreeNAS/FreeBSD platform. (https://forums.sonarr.tv/t/setting-up-rarbg-as-an-indexer/6386). I'm not a developer or programmer so most of this thread is 'greek' to me although I did try to check a few things. I'm guessing that the FreeNAS port of Sonarr doesn't use curl since I couldn't identify a version number when I ran 'curl --version' in the jail. Wish I could be of more assistance. If you need more details please let me know.

Current log entry:
15-8-26 23:15:04.9|Warn|Rarbg|Unable to connect to indexer: Error: SendFailure (Error writing headers)

System.Net.WebException: Error: SendFailure (Error writing headers) ---> System.Net.WebException: Error writing headers ---> System.IO.IOException: The authentication or decryption has failed. ---> Mono.Security.Protocol.Tls.TlsException: The authentication or decryption has failed.
at Mono.Security.Protocol.Tls.RecordProtocol.ProcessAlert (AlertLevel alertLevel, AlertDescription alertDesc) [0x00013] in /usr/wrkdirprefix/usr/ports/lang/mono/work/mono-4.0.1/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs:574
at Mono.Security.Protocol.Tls.RecordProtocol.InternalReceiveRecordCallback (IAsyncResult asyncResult) [0x000d0] in /usr/wrkdirprefix/usr/ports/lang/mono/work/mono-4.0.1/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs:376
--- End of inner exception stack trace ---
at Mono.Security.Protocol.Tls.SslClientStream.EndNegotiateHandshake (IAsyncResult result) [0x00035] in /usr/wrkdirprefix/usr/ports/lang/mono/work/mono-4.0.1/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs:425
at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (IAsyncResult asyncResult) [0x0000c] in /usr/wrkdirprefix/usr/ports/lang/mono/work/mono-4.0.1/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs:99
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) [0x00065] in /usr/wrkdirprefix/usr/ports/lang/mono/work/mono-4.0.1/mcs/class/System/System.Net/HttpWebRequest.cs:937
at System.Net.HttpWebRequest.GetResponse () [0x0000e] in /usr/wrkdirprefix/usr/ports/lang/mono/work/mono-4.0.1/mcs/class/System/System.Net/HttpWebRequest.cs:949
at NzbDrone.Common.Http.HttpClient.ExecuteWebRequest (NzbDrone.Common.Http.HttpRequest request, System.Net.HttpWebRequest webRequest) [0x00051] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Common\Http\HttpClient.cs:213

15-8-26 23:15:05.0|Warn|NzbDroneErrorPipeline|Invalid request Validation failed:
-- Unable to connect to indexer, check the log for more details
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
From reading some comments here curl is only needed in certain cases.
https://forums.sonarr.tv/t/setting-up-rarbg-as-an-indexer/6386/42

But, I would like to include curl if it useful in some cases. Only problem is /usr/pbi/sonarr-amd64/share/sonarr/NzbDrone/CurlSharp.dll.config points to libcurl.so.3 for freebsd. Once they change that to libcurl.so.4 I'll recompile sonarr with curl and it should hopefully work.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
As a test, you could try the following in your sonarr jail.
'pkg install curl'
then edit /usr/pbi/sonarr-amd64/share/sonarr/NzbDrone/CurlSharp.dll.config and change the "libcurl.so.3" in the 'freebsd' line to "libcurl.so.4".
 

SpaceAvenger69

Dabbler
Joined
Feb 4, 2015
Messages
20
Tried installing curl and editing CurlSharp.dll.config but that didn't seem to work. See log. Looks like it's an SSL issue now.

15-8-27 07:47:45.7|Warn|Rarbg|Unable to connect to indexer: Curl Error SslConnectError for Url https://torrentapi.org/pubapi_v2.php?get_token=get_token

System.Net.WebException: Curl Error SslConnectError for Url https://torrentapi.org/pubapi_v2.php?get_token=get_token
at NzbDrone.Common.Http.CurlHttpClient.GetResponse (NzbDrone.Common.Http.HttpRequest httpRequest, System.Net.HttpWebRequest webRequest) [0x00000] in <filename unknown>:0
at NzbDrone.Common.Http.HttpClient.ExecuteCurlRequest (NzbDrone.Common.Http.HttpRequest request, System.Net.HttpWebRequest webRequest) [0x00000] in <filename unknown>:0
at NzbDrone.Common.Http.HttpClient.ExecuteRequest (NzbDrone.Common.Http.HttpRequest request, System.Net.HttpWebRequest webRequest) [0x00000] in <filename unknown>:0
at NzbDrone.Common.Http.HttpClient.Execute (NzbDrone.Common.Http.HttpRequest request) [0x00000] in <filename unknown>:0
at NzbDrone.Common.Http.HttpClient.Get (NzbDrone.Common.Http.HttpRequest request) [0x00000] in <filename unknown>:0
at NzbDrone.Common.Http.HttpClient.Get[JObject] (NzbDrone.Common.Http.HttpRequest request) [0x00000] in <filename unknown>:0
at NzbDrone.Core.Indexers.Rarbg.RarbgTokenProvider+<>c__DisplayClass1.<GetToken>b__0 () [0x00000] in <filename unknown>:0
at NzbDrone.Common.Cache.Cached`1[System.String].Get (System.String key, System.Func`1 function, Nullable`1 lifeTime) [0x00000] in <filename unknown>:0
at NzbDrone.Core.Indexers.Rarbg.RarbgTokenProvider.GetToken (NzbDrone.Core.Indexers.Rarbg.RarbgSettings settings) [0x00000] in <filename unknown>:0
at NzbDrone.Core.Indexers.Rarbg.RarbgRequestGenerator+<GetPagedRequests>d__0.MoveNext () [0x00000] in <filename unknown>:0
at System.Linq.Enumerable.First[IndexerRequest] (IEnumerable`1 source) [0x00000] in <filename unknown>:0
at NzbDrone.Core.Indexers.HttpIndexerBase`1[NzbDrone.Core.Indexers.Rarbg.RarbgSettings].TestConnection () [0x00000] in <filename unknown>:0

15-8-27 07:47:45.8|Warn|NzbDroneErrorPipeline|Invalid request Validation failed:
-- Unable to connect to indexer, check the log for more details
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
maybe we need to compile curl with a new version of openssl also. I can try making another test build tonight
 

SpaceAvenger69

Dabbler
Joined
Feb 4, 2015
Messages
20
Good news!! I remembered reading in that thread I referenced earlier regarding the fact that the API works on http also so I changed https://torrentapi.org in the API URL to http://... in the Rarbg settings and now it seems to be working. Basically, this means that your next Sonarr plugin update just needs to have curl compiled with it and the API URL address modified and it should be good to go. Thanks again for your help!!
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Good news!! I remembered reading in that thread I referenced earlier regarding the fact that the API works on http also so I changed https://torrentapi.org in the API URL to http://... in the Rarbg settings and now it seems to be working. Basically, this means that your next Sonarr plugin update just needs to have curl compiled with it and the API URL address modified and it should be good to go. Thanks again for your help!!
glad you got it working.
I'd prefer not to modify sonarr's code (the API URL) so I'll try solving this without changing that at some point in the future.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I got curl working with the plugin and RARBG now without any tweaking.

I may release an update to the plugin but in my testing updating the plugin didn't work so I am reluctant to do so.
What affected users could do is backup and restore their /var/db/sonarr directory to a freshly installed instance of the plugin.
 
Status
Not open for further replies.
Top