Scheduled task and manual execution of task to delete Guest accounts fail

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
2 years ago
Hi, I noticed that guest accounts are not deleted via the scheduled task, nor when I run the maintenance task manually via the 'Maintenance' page.

I see the following error in the log:
The "Delete guests" scheduled task failed with the "One or more errors occurred. (Fatal error encountered during command execution.)" error (Task type: "Nop.Services.Customers.DeleteGuestsTask, Nop.Services". Store name: "My Store". Task run address: "https://mysite.com/scheduletask/runtask").

and

One or more errors occurred. (Fatal error encountered during command execution.)  

I also noticed this log entry occurring once or twice:

Table 'tmp_gueststodelete' already exists  

There is a huge amount of guest accounts currently, should I try removing them via the database directly? Does anyone know what the SQL command would be for MySQL? I'm running nopCommerce 4.40.4 on Linux, using Nginx and MySQL.

Thanks in advance!
2 years ago
Check your store settings are correct with the domain and host urls

To delete guests for today you need to enter tomorrows date
2 years ago
If you have access to the db, then manually delete the tmp_gueststodelete table, for some reason it wasn't deleted on a previous task running, perhaps some kind of failure. Then run the schedule task again.
2 years ago
RomanovM wrote:
If you have access to the db, then manually delete the tmp_gueststodelete table, for some reason it wasn't deleted on a previous task running, perhaps some kind of failure. Then run the schedule task again.

You're the man! Thanks, Maksim, that did the trick :-D
2 years ago
So it turns out the scheduled maintenance task still doesn't run automatically, even though the temp table does not exist.
If I run the maintenance task manually, it works - there are no log entries indicating why guest accounts are not deleted, even though the 'Delete guests' task's last success date updates as expected.
The guest account "Built-in system record used for background tasks" exists and looks fine to me.

Anything else I can check or do to make it work?
2 years ago
Please check if your Store URL is correct or not on the Store settings.
For example, if your Task run address is "https://mysite.com/scheduletask/runtask"
Then your store URL needs to be "https://mysite.com"
2 years ago
Hi Mahbubur,

Thanks for your reply - the store URL is set correctly.
I went through all the logs and warnings and noticed the issue started around Nov 2021, but there is no further detail. Nothing was changed around that time, which makes this issue even stranger.

I'll keep digging, thanks for all the replies, I appreciate it! :-)

André
2 years ago
Make sure there is a trailing "/" at the end of your setting for store URL.  e.g.

https://www.yourstore.com/
2 years ago
Hi New York, the trailing slash / is present.

The URL for the maintenance task, as per the logs: https://<redacted>.co.za/scheduletask/runtask

I realized that in my original post I said the site is running on Nginx, but that's incorrect: it is IIS (I confused this site with another ;-)).
But I don't see how that would break the maintenance task, since the site's been running on IIS from day one (early 2020).
2 years ago
avdveen wrote:

If I run the maintenance task manually, it works - there are no log entries indicating why guest accounts are not deleted, even though the 'Delete guests' task's last success date updates as expected.

So, when a task is automatically running, its LastStartDate and LastSuccessDate are updated, but guests are not deleted?
Also, what do you mean by "run the maintenance task manually", is it running "Delete guests" scheduled task from Admin/ScheduleTask/List page or "Deleting guest customers" feature from Admin/Common/Maintenance page?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.