All scheduled tasks fail when running automatically but not manually

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Hace 4 años
Hi,
I noticed there was something wrong with my store when the emails stop sending automatically.  Going to logs I see plenty of errors (about 1/min), all with the same message. After some investigation I found out that every time I restarted the store and the tasks are automatically executed there would be an error for each of them. The error is the following:

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
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 D:\OneDrive\OneDrive\PROJETOS\STORE\NOPCOMMERCE_STORE\Libraries\Nop.Services\Tasks\TaskThread.cs:line 65


So, each time a task is run by the scheduler I get that error, but if I run the task manually, by clicking the run now button the task runs without problems (and emails are sent if on the email task).
I notice something strange on the last line of the error, it quotes a file that is not on the www root, it's on onedrive, which is very strange. Any clue if it may be the source of the problem?

I've seen plenty of answers to similar problems sugesting adding https to the store name in the setting and enabling the fore ssl on all pages. I've tried with SSL enabled everywhere and with it disabled but there was no difference.

Hopefully someone can help!

Thanks
Hace 4 años
Hove you read this topic?
https://www.nopcommerce.com/boards/topic/71550/log-file-errors
Hace 4 años
New york, thanks for the link, I hadn't read it before. Unfortunately I had already checked the store url before. I tried with https and without (and with www and without) with no change in results. And my hosts file is not being used so those are not the reasons the error is comming up for me.

Anoyone else has any clue?

Thanks!
Hace 4 años
rjcrisostomo wrote:


   at Nop.Services.Tasks.TaskThread.Run() in D:\OneDrive\OneDrive\PROJETOS\STORE\NOPCOMMERCE_STORE\Libraries\Nop.Services\Tasks\TaskThread.cs:line 65
[/code]


This path on the error log looks quite strange. This looks like the path of the development directory rather than the actual path where the site is hosted on.
Hace 4 años
Showing the "path of the development directory" is typical (if you have .pdb files).   Showing a path for a "... .cs" file would never have the host path.

(This has been mentioned before in other topics)
Hace 4 años
Thanks for the answers,

So the weird path is not a problem then. At least one mistery solved.

Anyone has any other ideas? As I'm stuck with this and can't figure out why the tasks don't run sucessfully when running by scheduler.
Hace 4 años
I had the problem
As in the link ubove - did you check the ipaddress for store url in the database is accessible.
My website v42demo.testing.com.au was not accessible on the server
to check - on the server
run cmd
ping v42demo.testing.com.au
Did not resoled

I edited my hosts file and added the local IP
10.0.0.150  v42demo.testing.com.au
then ping v42demo.testing.com.au

Pinging v42demo.testing.com.au [10.0.0.150] with 32 bytes of data:
Reply from 10.0.0.150: bytes=32 time<1ms TTL=128

Now it works
Hace 4 años
Hi Yidna,

Thank you very much for your help! That was exactly the problem. The ping wasn't resolving on the server so I added the ip (the private one, the public wouldn't work) on the hosts file and the ping started resolving and the errors on the scheduled tasks were gone.
Hace 3 años
Yidna wrote:
I had the problem
As in the link ubove - did you check the ipaddress for store url in the database is accessible.
My website v42demo.testing.com.au was not accessible on the server
to check - on the server
run cmd
ping v42demo.testing.com.au
Did not resoled

I edited my hosts file and added the local IP
10.0.0.150  v42demo.testing.com.au
then ping v42demo.testing.com.au

Pinging v42demo.testing.com.au [10.0.0.150] with 32 bytes of data:
Reply from 10.0.0.150: bytes=32 time<1ms TTL=128

Now it works


GENIOUS !
Hace 3 años
I have the same problem but it didn't get resolved by this. The server has a public IP address and I can ping it from within the server itself. I can ping the site and the IP from command prompt.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.