Page 1 of 1

[Solved] Calendar 0.7.13 recurring events error fills up the database

Posted: Fri Mar 21, 2008 8:28 pm
by leslie894
I am running CMSMS 1.2.3 with Calendar 0.7.13.

If a recurring event is created so that the recurring event selector is "No" while the "Recur until:" date is set to some point in the future, the script goes into a loop creating new events with exactly the same time as the parent event. Since the "recur until" date is never reached, this fills up the table in the database until some limit is reached at which point it stops. I have had over 130,000 events created this way.

While the database is filling up, the site is completely incapacitated. Eventually however, the database activity stops and the main part of the site is again available. If I am patient and wait for an error message from the Calendar script I get:
Fatal error: Maximum execution time of 30 seconds exceeded in /usr/www/users/von/planet/lib/adodb_lite/adodb.inc.php on line 384
An attempt to view the calendar itself resulted in the following error message:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 712 bytes) in /usr/www/users/von/planet/modules/Calendar/function.displaycalendar.php on line 131
The calendar admin page is completely inaccessible as the default view is the list of events. This makes it impossible to delete the offending event via the Calendar module.

When I triggered this problem the first time I didn't know what had occurred and there were few events so I deleted the Calendar module and then reinstalled it. When I triggered it last night there were a lot of entries so I edited the tables directly to remove the offending entries.

I was not clear on why the error was occuring so I've been experimenting this morning on a new calendar on a different site (same servers). It seems the problem occurs regardless of whether I am editing an exisiting event or creating a new one. The main point is the "Recur until:" date is set to a point in the future while the recurring event type selector is still set to "No".

I've been using CMSMS since mid-February and I haven't got a clue how to formally submit a "bug report" for the Calendar module. I hope posting here will suffice. My apologies if this is an inappropriate forum.

I'll have a closer look at the scripts and see if I can pinpoint the problem but I don't know enough to patch the problem myself.

Leslie

Re: Calendar 0.7.13 recurring events error fills up the database

Posted: Fri Mar 21, 2008 8:37 pm
by calguy1000
Can somebody please try to replicate this problem on one of their test sites.  I'd really appreciate it.

Re: Calendar 0.7.13 recurring events error fills up the database

Posted: Fri Mar 21, 2008 8:49 pm
by Nullig
I just tried it on a test server, and it's looping like crazy - 190,000 entries in under a minute, so far.

Nullig

Re: Calendar 0.7.13 recurring events error fills up the database

Posted: Fri Mar 21, 2008 9:06 pm
by Nullig
Finally ended up with 401,555 records in the table after the 300 second timeout.

The events show the start date I added, no end date  (I  had left it blank), the event_recur_period was 0 for the first record and NULL for the rest and the event_recur_end was 2008-06-10 00:00:00 for the first record (which was the date I put) and NULL for the rest.

Nullig

Re: Calendar 0.7.13 recurring events error fills up the database

Posted: Fri Mar 21, 2008 9:08 pm
by calguy1000
Okay, this is a 'must fix'.... I'll work on it this weekend, dammit.
dammit dammit dammit!!!

Re: Calendar 0.7.13 recurring events error fills up the database

Posted: Fri Mar 21, 2008 9:14 pm
by leslie894
So sorry! Especially considering it is a long weekend here in Canada. But thank you! The site I am working on is for an elementary school and the office staff will be adding the calendar events. It is guaranteed they would trigger this and would have no means of recovering except by having me edit the tables which might prove difficult once the site is live.

Re: Calendar 0.7.13 recurring events error fills up the database

Posted: Fri Mar 21, 2008 9:15 pm
by calguy1000
yeah, I'll fix it... the worst part is, the recurring events stuff isn't even my code!!!

And believe me, I know it's a long weekend.  I'm in Calgary.

Re: Calendar 0.7.13 recurring events error fills up the database

Posted: Fri Mar 21, 2008 9:20 pm
by Nullig
Guess you'll be spending it with the Easter Buggy...

I have to work on a migration of an internal mediawiki site this weekend. I work for the Can Fed Gov and since Harper came in, we've had to change all of our Linux desktops and servers to Micro$oft. What a pain...

Nullig

Re: Calendar 0.7.13 recurring events error fills up the database

Posted: Fri Mar 21, 2008 9:24 pm
by calguy1000
Eeeeeewww!!!

Re: Calendar 0.7.13 recurring events error fills up the database

Posted: Fri Mar 21, 2008 9:29 pm
by leslie894
Calguy1000,

I posted about a less-critical problem with the recurring events in the Modules/Add-on forum. Calendar's recurring events doesn't handle Daylight Time properly.

The problem stems from the fact recurring events are implemented by simply adding a certain number of seconds to the event times which doesn't account for the fact an hour is lost or gained when switching to and from Daylight Time.

Obviously the database problem needs an immediate patch as it can incapacitate a production site but there is a fundamental flaw in the logic behind the recurring events code that suggest it needs a complete re-think. Is there some place else I should post this? Or does telling you cover it?  ;D

Did I mention Happy Easter???  :)

Re: Calendar 0.7.13 recurring events error fills up the database

Posted: Fri Mar 21, 2008 9:39 pm
by calguy1000
Yeah, I read the problem about the daylight savings time issue, and unfortunately, your probably SOL.

it's related to a problem all CMS packages have when the website is located in a different time zone than the majority of the customers.... (in that case the customers were in Australia, and the website hosted in the us)... there was a 7 or 8 or something hour time difference).

There's no real way of handling that without over ridding the core date functions (which isn't easy to do).

Re: Calendar 0.7.13 recurring events error fills up the database

Posted: Sat Mar 22, 2008 4:34 pm
by calguy1000
Okay, Calendar 0.7.14 is out now.... and I could not repeat the error.

Re: Calendar 0.7.13 recurring events error fills up the database

Posted: Sat Mar 22, 2008 4:53 pm
by leslie894
Perfect! I can't reproduce it either. Thank you for getting on top of this so quickly.

Leslie

Re: [Solved] Calendar 0.7.13 recurring events error fills up the database

Posted: Sat Mar 22, 2008 5:02 pm
by Nullig
Perfect.

nullig