The "Send emails" scheduled task failed with the "One or more errors occurred.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 года назад
Hi,
I have already read every post in the forum about this problem and nothing works...

Emails are not sent automatically every 60 seconds as defined in the system.
But when we click run now all emails are sent properly...so why does automatic sending not work?

Thanks for help.

The "Send emails" scheduled task failed with the "One or more errors occurred. (No connection could be made because the target machine actively refused it)" error (Task type: "Nop.Services.Messages.QueuedMessagesSendTask, Nop.Services". Store name: "Materials". Task run address: "https://materials.co.il/scheduletask/runtask").


System.AggregateException: One or more errors occurred. (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 Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at Nop.Services.Tasks.TaskThread.Run() in C:\repos\NopCommerce\Materials\src\Libraries\Nop.Services\Tasks\TaskThread.cs:line 71
---> (Inner Exception #0) 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 Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)<---
3 года назад
Check that you have the correct URL specified in admin area > configuration > stores.
If your site uses SSL, then be sure the prefix is https:
If you make a change to the URL, then restart your site.
3 года назад
We don't use SSL we use Coludflare, So we get SSL from Coludflare

I've already checked it out and restart my site...Nothing worked.
This is the web: https://materials.co.il/
3 года назад
Maybe it's related to Cloudflare; can you disable it, restart the site, and then test?
3 года назад
It's unrelated because the other sites in Cloudflare and everything works properly....
Only the version is different.
3 года назад
That doesn't mean it's not related.  Yes, the way the scheduler works now has changed; the way it now uses a different context/thread may not work nicely with your CloudFlare configuration.  It's worth testing to eliminate it.
3 года назад
"Actively refused it" means that the host sent a reset instead of an ack when you tried to connect. It is therefore not a problem in your code. Either there is a firewall blocking the connection or the process that is hosting the service is not listening on that port. This may be because it is not running at all or because it is listening on a different port.

refer below url its might be help you.
http://csharp.net-informations.com/communications/connection.htm
https://our.umbraco.com/forum/umbraco-forms/88858-no-connection-could-be-made-because-the-target-machine-actively-refused-it-12700125
3 года назад
sangeetshah wrote:
.... This may be because it is not running at all or because it is listening on a different port....

He said " other sites in Cloudflare and everything works properly....Only the version is different."
2 года назад
I am also having this same problem on multiple installations of this for clients. I checked all of the "go to" typical answers. Clients are ready to punt this product to the curb due to this.
It fails on numerous tasks with  "No such host is known". The name is correct and the URL is correct but still receives an error.
один год назад
Same problem .

After changing dns to Cloudflare .. emails for nopcommerce events like customer registration are no longer working. Logs show failure message. I have added ip address shown in the admin panel log to the Cloudflare dns entries for email.

Few things I notice is the ip address keeps changing with every failed log entry. our hosting is with everleap hosting.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.