By spjsche on
I am running cron manually from the "status" page because it is on windoze, and poormanscron is not yet available for V5.0rc1.
Everytime I try to run it, the above is reported in my logs.
How do I unstick it, and is there any way to find out where it is stuck.
It has been like that for over 12 hours now.
Thanking you in anticipation.
Comments
Same problem here (V5.0rc1
Same problem here (V5.0rc1 on Linux w/o root access)...
When I manually run cron, the log regularly shows:
Cron has been running for more than an hour and is most likely stuck.When I try to re-run cron, it logs:
Attempting to re-run cron while it is already running.How can I stop the ever-running cron?
---
Background: I tried to install the HEAD version of poormanscron, but it fired crontabs every few seconds though configured to fire only every hour... this considerably slowed down my site, produced a lot of "Error 500s", and therefore I uninstalled it again until it's bugs are resolved.
Pancho, Thanks for the
Pancho,
Thanks for the comments, I thought I was the only one having problems with cron.
I must admit I was inserting quite a lot of data, in the nodes, and unless you run cron regularly, then this could be an issue.
I do not know what the answer is, because one does not know where cron is getting stuck.
I noticed you produced some logs about what cron is doing, may I ask you how you managed it.
One problem is that I am running on windoze.
Does the same thing happen to you even if you run cron via the crontab ?
Thks
Cron stuck
Same here v5.0RC1 ( http://www.flyforfun.be )
I only add one or two articles a week so the amount of data cannot be the issue ?
Is the cron stuck status saved in the db anywhere in the variables table maybe ?
I would also like pointers to getting logging, I am running on a hosted machine and only have FTP and HTTP access (no terminal/ssh) so I have to rely on what the logging pages show.
Frank
Poormanscron is now
Poormanscron is now available for 5.0, and it provides an option for logging the progress of cron.
Perhaps this will indicate the issues.
I have installed version 5.0, but I have not yet got to the stage of populating the site as I am having other issues.
Logging with poormanscron + cron got UNstuck !
OK,
so now I have poormanscron installed on v5 (an upgraded RC1 to v5). Poormanscron does not give me any error (I enabled all the logging). This looked OK, but, in the status page, it still said that cron was run 4 days ago and in the search settings I see that only 89% of my site is indexed (setting is index max of 10 items per cron run). In addition, it then ran EVERY time a page is called (poormanscron that is), though I left it on the default setting of 60 minutes...
I suspected from where the logging stopped that the search index did not work correctly for some reason. Tried deleting the search index (re-index site button in search settings) and that worked, now the cron runs normally through poormanscron but NOT through running it manually from the status page. That still produces an error ?!
(UPDATE) Mmmm... maybe that was my cache still working or so. I now have a full working cron again, I suspect not due too poormanscron but it is the extensive logging of this module that pointed me the right way. I'LL USE THIS MODULE from nowon as default cron runner... THANKS for poormanscron.
Frank
Well Done
Well Done
Uninstalled Poormanscron
After a couple of days I had to stop poormanscron becase fo following error appearing a couple of thousand times in the logs :
Cron in stuck again! It is only the re-indexing of the site that seems to unlock it temporarily.
UPDATE :
After adding a lot of watchdog code I found that the real problem was a routine in the node module getting stuck on a specific node (which was my homepage!). I cleared all text en meta tags (nodewords module) from my homepage and ran cron again. It ran just fine. I re-added the text in the rich text editor (not by copying the old HTML !) and it still runs fine. Apparently something in the HTML corrupted the workings of the update_index routine in the node module ?
You can mail me ( frank@raac.be )for the updated poormanscron / search and node module code that do the EXTENSIVE logging and it shows you exactly on which node the cron job fails.
Kind regards and happy cronning,
Frank
Thanks for the update, but I
Thanks for the update, but I am still trying to sort out some other issues.
When I begin to populate my site, and start having cron issues I will be in touch.
Thanks for your time.
Stephen
update database manually, disable cache
Hello
I had the same problem with Drupal 5.0. Checking the source code I found out the cron function uses (among others) http://api.drupal.org/api/head/function/variable_del. This function deletes rows from the database.
So I did the same using phpmyadmin: One by one I deleted all rows starting with "cron" and then disabled the cache. Upon running cron again I finally saw the message "Cron ran successfully". Now I have enabled cache again and still cron seems to finish successfully.
Maybe this will help others as well.
But please do make backups!
Good point, the only thing
Good point, the only thing is that because I am testing locally, I have never ever switched cache on. I only switch it on when I am happy all is working.
But I will keep my eye on naughty cron, and see what happens as soon as I start populating the system.
Thanks for the pointer.
Stephen
It worked well
housetier thank you very much. I had same problem and i also cleared cron% in phpmyadmin and disable enabled cache, so it works again. Thanks...
Those other things didn't work
So I tried the only thing I could think of that really needs Cron - I disabled the Update_Status module. Then it worked. During the Cron run, Update_Status has to go to the DO web site to get module information. I'm guessing that the poor response time caused the module serious problems - but 3 days is a bit too much!
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
I'm baffled
I'm having the same problem: "Cron has been running for more than an hour and is most likely stuck" Furthermore, it's been stuck for days, and the only halfway informative page I can Google up on the problem is this thread--whic does not solve the problem for me.
So I'm looking at the watchdog module to see what would make it return this error message, and I am baffled. Here is the relevant bit of code:
But the thing is, there is NO "cron_semaphore" variable in the variable table for my site. So, as I read it, it should just skip on to the "else" clause--but it doesn't. So, if someone could point out to me where I'm mistaken, I'd appreciate it. I really need to get this fixed--0% of my site is indexed, so my search box is kaput.
Do you use Update Satus?
If so, disable it. Then try running cron again (manually).
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Works for me
Works for me well
Running Cron manually works at first but eventually exceeds mem
I've got a similar issue (Drupal 5.3). Here's what I've done:
Under admin/settings/search, Re-index site.
Go to admin/logs/status, run Cron manually: Cron fails.
Go to admin/logs/watchdog: error message, attempting to rerun Cron while it's already running.
So:
In phpmyadmin, I do a search for Cron through all tables
Delete one in table cache, and delete all four in table variables
Go to admin/settings/search, set index per run to 10
Go to admin/logs/status, run Cron manually: Success...
However: this indexes only 13% of my site. So I run Cron again. And again...
On the seventh time, I get
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 3600 bytes) in /home/www/.../site/includes/image.inc on line 308
And I can't go back and run cron again without first going back and reindexing and deleting the variables.
I've tried increasing my memory using htaccess and settings.php, but those haven't yielded any changes, and I don't have access to my php.ini file.
This is a pretty small site right now, it's only 72 pages, most of which are blank placeholders... I don't understand why running cron jobs with the minimum settings is more than it can handle. Why does it seem that each Cron job takes more memory than the last until it eventually exceeds my limits? I thought the whole point of using Cron jobs was that you could break your processor intensive jobs up into little chunks... Do I need to wait a few minutes between runs?
edit: this happens when I run cron manually either through the admin interface or by typing it directly into the browser.
Delete only variables
You should only have to delete "cron_semaphore" and "cron_last". You really don't need to clear the search stuff at all.
As for the memory problem, I'm guessing that's some module with a hook_cron that has a problem. I doubt that it's search.module.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Don't forget to empty cache
The cache table caches a serialized version of the variable table, so after you delete "cron_semaphore" and "cron_last" from your system table, you need to either delete the variables row in your cache table or empty the cache table. Otherwise, Drupal will just use the cached version of the variables.
Clearing cache worked
I had the same problem. Cleared the cache and Cron ran successfully.
Yeah, I had the same problem.
Yeah, I had the same problem. Deleting "cron_semaphore" and "cron_last" worked for awhile but eventually the error came back. Finally tracked it down to my server setup.
I contacted my hosting company who were happy to increase my MySQL timeout for me, I then deleted "cron_semaphore" and "cron_last" again and the problem has gone away.
This could be something to look out for.
Note: Disabling the core update status module allows cron to run smoothly, error only occurs when cron tries to do too much I guess.
Could also be
That could also be a sign that your site is hosted on an older, slower server, with possibly older OS, etc. You might ask your provider to move you to a newer box. There are plenty of hosting providers who will be happy to move you to their servers at no extra cost if they won't.
NancyDru
Cron Issue
I had the issue where cron was stuck and clearing the caches worked. Now I need to find out why it go stuck.
Hollye Merton
Application Software Specialist