No connection could be made because the target machine actively refused it

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 years ago
I have opened the Logs and I saw the same error repeating all the time: What is this error and which process is causing it. Stacktrace is incomplete

No connection could be made because the target machine actively refused it No connection could be made because the target machine actively refused it

System.Net.WebException: No connection could be made because the target machine actively refused it No connection could be made because the target machine actively refused it ---> System.Net.Http.HttpRequestException: No connection could be made because the target machine actively refused it ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it
   at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
   at System.Threading.Tasks.ValueTask`1.get_Result()
   at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Threading.Tasks.ValueTask`1.get_Result()
   at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask`1 creationTask)
   at System.Threading.Tasks.ValueTask`1.get_Result()
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
   at System.Net.HttpWebRequest.SendRequest()
   at System.Net.HttpWebRequest.GetResponse()
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetResponse()
   at System.Net.WebClient.GetWebResponse(WebRequest request)
   at System.Net.WebClient.DownloadBits(WebRequest request, Stream writeStream)
   at System.Net.WebClient.UploadBits(WebRequest request, Stream readStream, Byte[] buffer, Int32 chunkSize, Byte[] header, Byte[] footer)
   at System.Net.WebClient.UploadValues(Uri address, String method, NameValueCollection data)
   at Nop.Services.Tasks.TaskThread.Run() in C:\SourceControl\\NopCommerce\src\Libraries\Nop.Services\Tasks\TaskThread.cs:line 65
5 years ago
Hi,

Most probably the Store URL is incorrect. Go to Configuration -> Stores and check it.

Regards,
Stoyan
5 years ago
I changed it. That error went away but I get now
"Could not find a part of the path 'C:\Websites\MySite\test.mysite.com\scheduletask\runtask'."
5 years ago
Hi,

It seems that the Store URL is not correct again. It should not point to a physical local path, but a URL like this: http://localhost:YOUR_PORT/ ( or you can try with "http://test.mysite.com" ).

Regards,
Hristian
5 years ago
Thanks again. It works now but I get:

The remote server returned an error: (401) Unauthorized.
Full message  
System.Net.WebException: The remote server returned an error: (401) Unauthorized.
   at System.Net.HttpWebRequest.GetResponse()
   at System.Net.WebClient.GetWebResponse(WebRequest request)
   at System.Net.WebClient.DownloadBits(WebRequest request, Stream writeStream)
   at System.Net.WebClient.UploadBits(WebRequest request, Stream readStream, Byte[] buffer, Int32 chunkSize, Byte[] header, Byte[] footer)
   at System.Net.WebClient.UploadValues(Uri address, String method, NameValueCollection data)
   at Nop.Services.Tasks.TaskThread.Run() in C:\SourceControl\NopCommerce\src\Libraries\Nop.Services\Tasks\TaskThread.cs:line 65
5 years ago
Found the problem in the last issue. Had enabled the Windows authentication in IIS for some testing I was done and the keep alive task was failing.

Thanks for your support
4 years ago
This error is a network-related error occurred while establishing a connection to the Server. It means that the error is occurring because there is no server listening at the hostname and port you assigned. It literally means that the machine exists but that it has no services listening on the specified port .

Generally, it happens that something is preventing a connection to the port or hostname. Either there is a firewall blocking the connection or the process that is hosting the service is not listening on that specific port. This may be because it is not running at all or because it is listening on a different port. More on...no connection
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.