Updates and New Show Failure: Unable to connect to the remote server

OS: Windows 8.1
Problem: Trakt proxy connection issue. Unable to check for software updates or search for new shows.

My Error:

System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:51485
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetResponse()
   at NzbDrone.Common.Http.HttpClient.Execute(HttpRequest request) in m:\BuildAgent\work\328d72309b633a8\src\NzbDrone.Common\Http\HttpClient.cs:line 86
   at NzbDrone.Common.Http.HttpClient.Get[T](HttpRequest request) in m:\BuildAgent\work\328d72309b633a8\src\NzbDrone.Common\Http\HttpClient.cs:line 160
   at NzbDrone.Core.MetadataSource.TraktProxy.SearchTrakt(String title) in m:\BuildAgent\work\328d72309b633a8\src\NzbDrone.Core\MetadataSource\TraktProxy.cs:line 76
   at NzbDrone.Core.MetadataSource.TraktProxy.SearchForNewSeries(String title) in m:\BuildAgent\work\328d72309b633a8\src\NzbDrone.Core\MetadataSource\TraktProxy.cs:line 83

Similar to:

My Error:

System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:51485
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetResponse()
   at NzbDrone.Common.Http.HttpClient.Execute(HttpRequest request) in m:\BuildAgent\work\328d72309b633a8\src\NzbDrone.Common\Http\HttpClient.cs:line 86
   at NzbDrone.Common.Http.HttpClient.Get[T](HttpRequest request) in m:\BuildAgent\work\328d72309b633a8\src\NzbDrone.Common\Http\HttpClient.cs:line 160
   at NzbDrone.Core.Update.UpdatePackageProvider.GetRecentUpdates(String branch) in m:\BuildAgent\work\328d72309b633a8\src\NzbDrone.Core\Update\UpdatePackageProvider.cs:line 46
   at NzbDrone.Core.Update.RecentUpdateProvider.GetRecentUpdatePackages() in m:\BuildAgent\work\328d72309b633a8\src\NzbDrone.Core\Update\RecentUpdateProvider.cs:line 26
   at NzbDrone.Api.Update.UpdateModule.GetRecentUpdates() in m:\BuildAgent\work\328d72309b633a8\src\NzbDrone.Api\Update\UpdateModule.cs:line 21
   at NzbDrone.Api.REST.RestModule`1.<set_GetResourceAll>b__c(Object options) in m:\BuildAgent\work\328d72309b633a8\src\NzbDrone.Api\REST\RestModule.cs:line 111
   at CallSite.Target(Closure , CallSite , Func`2 , Object )
   at Nancy.Routing.Route.<>c__DisplayClass4.<Wrap>b__3(Object parameters, CancellationToken context)

Similar to:

Both issues point to the same root problem… sonarr/trakt is unable to to connect to something on port 51485. Nothing is listening on port 51485. One of the similar issues suggested there may be some proxy configuration issues or tunnel adapters installed. I verified I have no system proxy configure in internet options. I verified that no proxy software is installed. I removed some TAP adapters in device manager, leaving only bluetooth, wifi, and ethernet devices. I disabled some other ASUS services in the service manager because ASUS software was causing problems on a different occasion. I’ve run out of ideas. Does anyone know a better way to debug or force drone to use another host/port? Is something supposed to be listening on a random high port via localhost? Seems odd that I would connect to myself rather than reaching out to external resources. Thanks in advance.

What about connecting to SABnzbd or Nzbget? Do you get the same issue? (trying to determine if its local or remote or both that try to go through localhost port).

When I test the connection it says it completes fine. I’ve also successfully failed a test by having the wrong credentials in place during setup. I haven’t been able to pull in any show data to actually test a download though.

This is still very suspicious, nothing in Sonarr requires a connection to another port running on the same system.

Could you run these two commands and post the output?

reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" | find /i "proxy"

netsh winhttp show proxy

Are you using a VPN on this system?
What anti-virus do you have installed (a lot of them have a web filtering component)?

Hey Markus,

Thanks for the troubleshooting commands. My friend decided to format his machine (multiple reasons, not just this). Anyway, everything works after a fresh install. So, I had him run these commands anyway to see what a normal working system should look like.

C:\Windows\System32>reg query “HKEY_CURRENT_USER\Software\Microsoft\Windows\Curr
entVersion\Internet Settings” | find /i “proxy”
AutoConfigProxy REG_SZ wininet.dll
MigrateProxy REG_DWORD 0x1
ProxyEnable REG_DWORD 0x0

C:\Windows\System32>netsh winhttp show proxy

Current WinHTTP proxy settings:

Direct access (no proxy server).

Anyway, hopefully this will be helpful for someone in the future. I think we were on to something here. Thanks for the quick support.