Closed Bug 501660 Opened 15 years ago Closed 12 years ago

Using caldav multiple schedules with caching = DB Error : white page schedule

Categories

(Calendar :: Provider: CalDAV, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: bruno, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.11) Gecko/2009060200 SUSE/3.0.11-5.2 Firefox/3.0.11 FirePHP/0.3
Build Identifier: mozilla.org/calendar/sunbird/nightly/latest-comm-1.9.1 Mozilla/5.0 (X11; U; Linux i686; fr-FR; rv:1.9.1.1pre) Gecko/20090701 Calendar/1.0pre

Due to lack of performances on provider caldav I receive the tips to activate caching for each schedules.

Result : error 
Error: DB error: database table is locked
exc: [Exception... "Component returned failure code: 0x8052000e (NS_ERROR_FILE_IS_LOCKED) [mozIStorageStatementWrapper.execute]"  nsresult: "0x8052000e (NS_ERROR_FILE_IS_LOCKED)"  location: "JS frame :: file:///usr/local/sunbird-1.0/modules/calUtils.jsm -> file:///usr/local/sunbird-1.0/calendar-js/calStorageCalendar.js :: anonymous :: line 2477"  data: no]



Reproducible: Always

Steps to Reproduce:
1.Create more than 5 schedule on a caldav server with 2500 events each
2.Connect each schedule inside sunbird
3. check the cache setting 
4. Relaunch sunbird
5. Cry because of caching DB errors.
5.5 : uncheck caching of schedule
6. Stop sunbird, clear the data cache folder in profile
7. restart and wait.

Actual Results:  
looping in invalid request to the server
CalDAV: send(http://ical/caldav.php/bras/.in/): <?xml version="1.0" encoding="UTF-8"?>
<D:propfind xmlns:D="DAV:">                                                           
  <D:prop>                                                                            
    <D:getcontenttype/>                                                               
    <D:getetag/>                                                                      
  </D:prop>                                                                           
</D:propfind>                                                                         
CalDAV: recv:                                                                         
<multistatus>                                                                         
 <response>                                                                           
  <href>/caldav.php/bras/.in/</href>                                                  
  <propstat>                                                                          
   <prop>                                                                             
    <getcontenttype>httpd/unix-directory</getcontenttype>                             
    <getetag>""</getetag>                                                             
   </prop>                                                                            
   <status>HTTP/1.1 200 OK</status>                                                   
  </propstat>                                                                         
 </response>                                                                          
</multistatus>                                                                        

CalDAV: send(h

Expected Results:  
Having proper use of cache db ! If sqlite suck use mysql embedded.
Hard to believe nobody has think about caching multiple heavy schedules.
Need to be include in tests & regressions.
Looks like two issues, one the locking, the other the loop of requests.

For the loop of requests, see bug 435854.
I've added info to 435854.

Keep this one for the db locking which can be caused by the "crazy" loop.
With a working installation of 12 schedules, which works on sunbird 1.0pre without caching. When you enable caching on the schedule you get trouble.

Here's the debug log session.

It's critical as user, if enable caching doesn't see anymore his schedules.
Interesting. I believe this usually happens when a database query is executed, an exception is thrown, and query.reset() is not called. I thought we fixed these issues though by using try {} catch() {} finally {} though.

Maybe there is another reason though. Try removing/renaming the $PROFILE/calendar-data/cache.sqlite. This is the file that holds the cached data, if it doesn't exist the file is re-created from the live data. This should at least fix your issues for now, although I agree it won't fix the issue long term.
Sorry to inform you that cleaning the local data cache was my first reaction face to this problem.
In fact, caching crash if you have more than one schedule ( remote schedule ) activated, If you leave one it works.

sqlite was probably the worst engine in this use case ( multiple access to the same db ) as it locks all the db. 
So caching are absolutely not usable if multiple (schedule) process try to use the caching system. Perharps mysql-embedded would have been a better choice.
(I don't know).

If you want to release the 1.0 version you really need to add more information to the user : don't use cache on more than one remote calendar. (seems stupid as cache should serve to display and work offline )
Or try to build a cache for each schedule, which could be reasonnable as they are identified uniquely. Who care to have multiple "working" cache file in place of one big "non-functionnal" cache file ?
4 Month later.

With Mozilla/5.0 (X11; U; Linux i686; fr-FR; rv:1.9.1.6pre) Gecko/20091202 Sunbird/1.0b1

Trying multiple caldav calendars result in 

Error: Error selecting item by id 01ab86f8-6a9c-4a2d-a312-c1b448ba5f5d!
[Exception... "Component returned failure code: 0x8052000e (NS_ERROR_FILE_IS_LOCKED) [mozIStorageStatementWrapper.step]"  nsresult: "0x8052000e (NS_ERROR_FILE_IS_LOCKED)"  location: "JS frame :: file:///usr/local/sunbird-1.0/modules/calUtils.jsm -> file:///usr/local/sunbird-1.0/calendar-js/calStorageCalendar.js :: cSC_getItemById :: line 1603"  data: no]                                                                                                                                                 
DB Error: database table is locked                                                                                                                                     
Error: Error selecting item by id 01ab86f8-6a9c-4a2d-a312-c1b448ba5f5d!                                                                                                
[Exception... "Component returned failure code: 0x8052000e (NS_ERROR_FILE_IS_LOCKED) [mozIStorageStatementWrapper.step]"  nsresult: "0x8052000e (NS_ERROR_FILE_IS_LOCKED)"  location: "JS frame :: file:///usr/local/sunbird-1.0/modules/calUtils.jsm -> file:///usr/local/sunbird-1.0/calendar-js/calStorageCalendar.js :: cSC_getItemById :: line 1617"  data: no]                                                                                                                                                 
DB Error: database table is locked                                                                                                                                     
Error: DB error: database table is locked                                                                                                                              
exc: [Exception... "Component returned failure code: 0x8052000e (NS_ERROR_FILE_IS_LOCKED) [mozIStorageStatementWrapper.execute]"  nsresult: "0x8052000e (NS_ERROR_FILE_IS_LOCKED)"  location: "JS frame :: file:///usr/local/sunbird-1.0/modules/calUtils.jsm -> file:///usr/local/sunbird-1.0/calendar-js/calStorageCalendar.js :: cSC_writeProperty :: line 1839"  data: no]                                                                                                                                       
CalDAV: refresh completed with status 207 at http://caldav-test.ioda.net/caldav.php/magenta/home/                                                                      

All of this can be easily reproduced using our caldav-test server
http://caldav-test.ioda.net home page contain explanation how to use it.
here the url of the complete trace ( 62MB uncompressed ) 3.2MB to download

http://linux.ioda.net/sunbird/sunbird_totally_bogus_with_remote-caldav_cache_activated.log.zip

Can we put this bug confirmed !
Multiple cached calendars are "broken" anyway, see bug 479867. We usually set bugs confirmed if there is someone else that can reproduce this. I haven't had time to reproduce unfortunately. This doesn't mean we don't acknowledge your bug report though!

I really appreciate you setting up your test server and I do hope to find time to make use of it soon.
You're welcome Philipp, I've made this available to help developper having something real as test data.

I will update records on a month or bi-month frequence. but if dev look at 2009 mid-year they can found many many records.
(In reply to comment #8)
> Multiple cached calendars are "broken" anyway, see bug 479867. 

is this changed now that bug is fixed?
I couldn't produce a locked file error lately. Bruno, if this is still happening please reopen. Quite a few bugs have been fixed around caching, so this might indeed work better now.
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: