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
RomanovM wrote:

So, when a task is automatically running, its LastStartDate and LastSuccessDate are updated, but guests are not deleted?

Correct, the LastStartDate and LastSuccessDate updates, but the number of guest accounts keeps growing day after day.

RomanovM wrote:

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?
Apologies, I realise my comment wasn't clear - it is the latter, guest accounts are deleted when I use the Deleting guest customers via the /Admin/Common/Maintenance page. I do however get the following error Fatal error encountered during command execution in the logs at times when I run that maintenance task, when there are a lot of guest accounts to delete, but the guest accounts are still deleted, even though the error shows up in the logs and I get the error in the browser:
An unhandled exception occurred while processing the request.
SocketException: 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.


I assume this has something to do with a timeout of sorts on the MySQL database? Unfortunately, I don't have control over the database server, it is on a shared hosted platform.
2 years ago
I don't think it is due to the database.  See if this helps
https://www.nopcommerce.com/pt/boards/topic/89598/keep-alive-not-working
2 years ago
avdveen wrote:

Correct, the LastStartDate and LastSuccessDate updates, but the number of guest accounts keeps growing day after day.

Check your DeleteGuestTaskOlderThanMinutes setting value.
2 years ago
RomanovM wrote:

Check your DeleteGuestTaskOlderThanMinutes setting value.

Once again, your suggestion fixes the problem, thank you!

The value was set to 1440, which I assume is the default, but with that value, it didn't run the task successfully. I decreased it to 60 and guest accounts are now deleted. Even with a higher value e.g. 120 or 300, the task runs successfully and guests are deleted.
2 years ago
1440 minutes is 24 hours.  I don't see any reason why "it didn't run the task successfully" just becasue of a larger time window.  Is it possible it was running OK, and you just have many guests within 24 hours?  What are those guests  - bots?  It seems that you may have some other issue where search engines are not being 'ignored'.
2 years ago
New York wrote:
1440 minutes is 24 hours.  I don't see any reason why "it didn't run the task successfully" just because of a larger time window.  Is it possible it was running OK, and you just have many guests within 24 hours?  What are those guests  - bots?  It seems that you may have some other issue where search engines are not being 'ignored'.

Yip, 24 hours is not a long time, my thoughts too but yes there are quite a lot of guest users created in that timeframe and based on what I saw in some of the log messages at some point it seems the guests deletion task times out on the db connection, for some reason if there are too many accounts to remove. Thus if I reduce the value, it runs successfully. Having said that, I've increased the value back to 1440 again and will monitor it over the next few days - if the guest accounts aren't deleted again, I'll have to drop it back until I can figure out why it doesn't work at higher values.

I took the site over from a previous admin, so still finding my feet with what they did prior and settings they may have changed from defaults but yes there are a lot of bots (based on IPs, it seems like Google and Bing, mostly) - guess I should start ignoring these. Is there a way to do this within nopCommerce, or do I need a plugin or something simpler like robots.txt?
2 years ago
Make sure you have this active customer:  builtin@search_engine_record.com
(if searching in admin customer, clear the criteria for 'Customer roles')

Consider getting an IP blocking plugin.  (Block entire countries)
2 years ago
New York wrote:
Make sure you have this active customer:  builtin@search_engine_record.com
(if searching in admin customer, clear the criteria for 'Customer roles')

Consider getting an IP blocking plugin.  (Block entire countries)

Thanks, New York - that account exists (as does the [email protected] account), I checked that a while ago but thanks for mentioning it, it might help someone else :-)

I see that the scheduled task is now working as expected, with guest accounts older than 1440 minutes (24 hours) being deleted automatically; I'm still not sure what was wrong and what exactly fixed it, apart from removing the temp table and fiddling with the 'DeleteGuestTaskOlderThanMinutes' value, but I'm just glad things are working and back to normal!
Thanks again for everyone's help, suggestions, and comments, the support here is great!

I think this extension, IP Filter (firewall) should do the trick! :-D
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.