Most frustrating Drupal encounter thusfar (and hopefully ever!)

Branjawn's picture

So, I don't even know where to begin.

I am importing iCal feeds (Google Calendar specifically) using FeedAPI, Calendar, iCal parser, Date, etc, etc. I had some crazy issues that are mostly resolved now. But my one hangup I cannot remedy.

Cron will not stop running. In other words, I cannot run cron because it won't stop. If I try to run it manually I get the "Cron run Failed" or something like that.

I have done everything with deleting the cron variables, emptying cache, sacrificing small animals, hung a horseshoe over my pc, all to no avail.

So, does anyone have experience with importing iCal feeds? Does anyone have experience with the cron that never ends? It just goes on and on my friend..

Comments

Cron

regi.bradley's picture

I have had the same problem with cron. Deleting the cron variables alone did not solve the problem for me either. If I remember correctly, I was able to get mine resolved by deleting the cron semaphore from the variables table followed by an immediate clearing of the cache.

Chron semaphore is what you need

afreeman's picture

Actually the cron job dies when your timeout limit is hit, unfortunately this often leaves the cron semaphore set in the variables table, which fakes cron.php into thinking there's an active cron running.

+1 on deleting cron semaphore. That should allow you to re-run cron. Incidentally if you're having issues with long-running crons, timeouts, etc, you might want to take a serious look at running cron from the commandline:

http://srhaber.com/blog/2009/02/11/command-line-cron-for-drupal/

Cron Semaphore

Branjawn's picture

Allow me to clarify, when I stated "deleting the cron variables" I meant cron semaphore and cron last from the variables table.

So, yes, I've done this already and it has not resulted in success.

Also, on my status page it displays this now: Cron maintenance tasks - Never run

hands off

Branjawn's picture

I think I might try not touching it for a few hours and check back. Perhaps I'm just throwing too much at the site/server at once in my effort to cure it.

Again, the initial cause of this is importing a new feed. Does that matter?

Queue

kwinters's picture

If you can't finish a whole process in a single PHP execution, you need to break it up into bits and schedule it with something like array_slice or http://drupal.org/project/job_queue. Otherwise it will just break every time you run it.

You can also set your max execution time to be way high, but that's not really a long-term solution and often just results in running out of memory.

Ken Winters

interesting?

Branjawn's picture

I have figured out that some events import with
DTSTART;VALUE=DATE:20090417
and others have only
DTSTART:20081122T000000Z.

Could this be messing things up?

example

Branjawn's picture

BEGIN:VEVENT
DTSTART;VALUE=DATE:20090417
DTEND;VALUE=DATE:20090418
DTSTAMP:20091017T155619Z
UID:ajc0v0j56587ab39or6uflmjro@google.com
CREATED:20090317T115658Z
DESCRIPTION:
LAST-MODIFIED:20090317T115711Z
LOCATION:
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Friday Nite Worship - High Point
TRANSP:TRANSPARENT
END:VEVENT
BEGIN:VEVENT
DTSTART:20081126T153000Z
DTEND:20081126T193000Z
DTSTAMP:20091017T155619Z
UID:kdfe4559nb4q821f4llc766je4@google.com
CREATED:20081120T182029Z
DESCRIPTION:
LAST-MODIFIED:20081120T182035Z
LOCATION:
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:YAC Outting
TRANSP:OPAQUE
END:VEVENT

new info

Branjawn's picture

More info, read this somewhere:

The default value type for DTSTART is DATE-TIME, but
20060315 is not a DATE-TIME; you can use DATE values in
DTSTART, but you have to be explicit:

DTSTART;VALUE=DATE:20060315

So, I'm trying to import the same field DTSTART as Date and Datetime? Could that be screwing things up? If so, there is nothing I can do about it right? Because the feed is generated by Google Calendar and I have no control over that...

cron nightmare

Branjawn's picture

This is still the bane of my existence.

feeling lucky?

tarvid's picture

You may have a mismatch in date modules or misconfiguration in time zones.

timezones

Branjawn's picture

I got the timezones issue worked out. Google sends as UTC -4 and I don't mess with it. So when it gets imported it's fine. At first I was time zoning it twice, so the times were off by 4 hours. Figured that one out pretty easy.

What would I check in the date module? I think the problem is for all day events the DTSTART is "date" and for regular events it is "datetime". The field I am importing to, by way of the Date module, only lets you choose one of those, so I choose "datetime".

Date module

tarvid's picture

http://drupal.org/project/date

Several items under trouble shooting.

Your analysis makes sense. One Drupal principle not well understood is that if you install enough modules your site will break.

yyyymmdd is both a date and a datetime. The time happens to be midnight. The Z-zulu suffix selects UTC. Without any tz, Drupal should use the site default.

Drush is your friend. Usually I wind up with a compatible set of modules. I did bang my head on date and views a few months ago and went back to event.

Do try to reach ekes on IRC.

Poormanscron

swordedge's picture

The host of a site that I am maintaining is not allowing cron to run in any of the three methods I am aware of. So, to replace it, I ended up using poormanscron. Everytime someone accesses the site, it checks to see how long it was since the last person accessed the site and if it has been long enough, it runs the cron process. Sounds like a kludge but it works.

How to stop hung up cron jobs in Drupal

Alexander Allen's picture

My cron also hung up while I was running it with cron.
I updated it to the latest cron 3.1 version and I still got the same problem.

To resolve:

  • Stop Apache (if you have the rights).
    I tried to delete the cron variables from drush without stopping Apache and got a "bus error".
  • Delete cron_semaphore, cron_last, ctools_last_cron, node_cron_last
  • Start Apache (if you stopped it).
  • Run cron!

If you have Drush installed (and I highly recommend so), you can do this in just few seconds like I did. If you have a Dreamhost server like I do you can check this post here.

triDUG

Group events

Add to calendar

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week