[CalendarServer-users] "list index out of range" error on previously functioning caldavd installation

Andre LaBranche dre at apple.com
Mon Nov 16 11:46:23 PST 2015


Hi,

There's not quite enough info here to know exactly what's wrong, but in general:

The failure is happening as the server tries to create a user's calendar home (initFromStore). This is something that happens once, the first time the user logs in.
If you haven't already done so, I would double check your account definitions (e.g. xml files, LDAP, whatever you're using).

If you can manually connect with psql, try a couple queries to validate the DB:

caldav=# select * from calendarserver;
           name           | value 
--------------------------+-------
 CALENDAR-DATAVERSION     | 6
 ADDRESSBOOK-DATAVERSION  | 2
 NOTIFICATION-DATAVERSION | 1
 MANAGED-ATTACHMENTS      | 1
 VERSION                  | 59
 MIN-VALID-REVISION       | 716
(6 rows)

caldav=# select count(1) from calendar_home;
 count 
-------
    84
(1 row)

-dre

> On Nov 16, 2015, at 11:38 AM, Kyle Silfer <kyle at rtoads.com> wrote:
> 
> 
> On Nov 16, 2015, at 10:24 AM, Kyle Silfer wrote:
> 
>>> Simply add the following lines to your caldavd.plist
>>> 
>>> <key>UseDatabase</key>
>>> <false/>
> 
> I tried the opposite (making the key true) but it had no effect.
> 
>> Thanks for the clue! However, the Debian package is configured to use postgresql by default.
>> 
>> But I think based on what you're saying that there may be a communication issue between the database and caldavd. Postgresql is so obtuse to configure for "peer" versus password authentication, I may have screwed something up when I attempted to delete and recreate the database.
> 
> Well, I mirrored my pg_hba.conf and caldavd.plist files from the working server to the problem server and it doesn't matter, I am getting the same error.
> 
> I am now thinking that maybe my method of dropping the caldav database and recreating it to start fresh didn't work somehow. If the issue is mangled communication between caldavd and the database, I guess I will try deleting/recreating the postgresql database yet again.
> 
> Below is the full error incident as reported by iCal and caldavd/error.log, if anyone can interpret it. I am at a loss. This occurs after iCal client has connected to the server successfully as an admin user but before I have left the account adding window. The client offers two choices: "Stay Offline" or "Go Online". Choosing the latter resulting in the error repeating itself.
> 
> The full error from iCal is: 
> 
> "The server responded with
> “HTTP/1.1 500 Internal Server Error”
> to operation CalDAVAccountRefreshQueueableOperation.
> 
> The full error from caldavd/error.log is:
> 
> 2015-11-16 12:24:19-0700 [-] [caldav-0]  [-] [twext.web2.server#error] Exception rendering request: <PROPFIND /calendars/__uids__/38EAE584-2B75-582B-A058-018391D1003F/ (1, 1)>
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	Traceback (most recent call last):
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 423, in errback
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	    self._startRunCallbacks(fail)
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 490, in _startRunCallbacks
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	    self._runCallbacks()
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 577, in _runCallbacks
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	    current.result = callback(current.result, *args, **kw)
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1155, in gotResult
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	    _inlineCallbacks(r, g, deferred)
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	--- <exception caught here> ---
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1097, in _inlineCallbacks
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	    result = result.throwExceptionIntoGenerator(g)
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	  File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	    return g.throw(self.type, self.value, self.tb)
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	  File "/usr/lib/python2.7/dist-packages/twistedcaldav/directory/common.py", line 101, in locateChild
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	    child = yield self.homeResourceForRecord(record, request)
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1097, in _inlineCallbacks
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	    result = result.throwExceptionIntoGenerator(g)
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	  File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	    return g.throw(self.type, self.value, self.tb)
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	  File "/usr/lib/python2.7/dist-packages/twistedcaldav/directory/common.py", line 83, in homeResourceForRecord
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	    child = yield self.homeResourceCreator(record, transaction)
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1097, in _inlineCallbacks
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	    result = result.throwExceptionIntoGenerator(g)
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	  File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	    return g.throw(self.type, self.value, self.tb)
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	  File "/usr/lib/python2.7/dist-packages/twistedcaldav/directory/calendar.py", line 223, in createHomeResource
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	    parent, record.uid, transaction)
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1097, in _inlineCallbacks
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	    result = result.throwExceptionIntoGenerator(g)
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	  File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	    return g.throw(self.type, self.value, self.tb)
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	  File "/usr/lib/python2.7/dist-packages/twistedcaldav/resource.py", line 2027, in createHomeResource
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	    transaction, name)
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1097, in _inlineCallbacks
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	    result = result.throwExceptionIntoGenerator(g)
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	  File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	    return g.throw(self.type, self.value, self.tb)
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	  File "/usr/lib/python2.7/dist-packages/twistedcaldav/resource.py", line 2389, in homeFromTransaction
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	    storeHome = yield transaction.calendarHomeWithUID(uid)
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1097, in _inlineCallbacks
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	    result = result.throwExceptionIntoGenerator(g)
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	  File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	    return g.throw(self.type, self.value, self.tb)
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	  File "/usr/lib/python2.7/dist-packages/txdav/common/datastore/sql.py", line 1606, in homeWithUID
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	    homeObject = (yield homeObject.initFromStore())
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1099, in _inlineCallbacks
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	    result = g.send(result)
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	  File "/usr/lib/python2.7/dist-packages/txdav/common/datastore/sql.py", line 1570, in initFromStore
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	    self._txn, resourceID=self._resourceID))[0]
> 2015-11-16 12:24:19-0700 [-] [caldav-0] 	exceptions.IndexError: list index out of range
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>>>> Am 13.11.2015 um 19:54 schrieb Kyle Silfer <kyle at rtoads.com>:
>>>> 
>>>> I've installed the latest Debian calendarserver package on Ubuntu 14.04 on 3 different more-or-less identical Dell servers.
>>>> 
>>>> On one of the 3 servers I am experiencing an error. It started when I imported calendar events from a particularly large calendar. The symptom on the client side is a "CalDAVAccountRefreshQueueableOperation" error. It occurs now with every attempt to connect to the account.
>>>> 
>>>> The symptom on the server side is:
>>>> 
>>>> 2015-11-13 09:21:33-0700 [-] [caldav-0] 	  File "/usr/lib/python2.7/dist-packages/txdav/common/datastore/sql.py", line 1570, in initFromStore
>>>> 2015-11-13 09:21:33-0700 [-] [caldav-0] 	    self._txn, resourceID=self._resourceID))[0]
>>>> 2015-11-13 09:21:33-0700 [-] [caldav-0] 	exceptions.IndexError: list index out of range
>>>> 
>>>> Thinking this to perhaps be due to corrupt data, I deleted the caldav database plus files in the /var/spool/caldavd and /var/lib/caldavd, restarted the server and am still getting that error each time I try to connect.
>>>> 
>>>> The error seems to be from Python and has come up for users of other packages too.
>>>> 
>>>> If it isn't the calendar data that is causing or contributing to this error, is there a Python cache or other persistent data that needs to be deleted to really have a fresh start with calendarserver?
>>>> 
>>>> Because my other two installs are working fine, including one where I imported the same data.
>>>> 
>>>> Any clues?
>>>> 
>>>> ./k
>>>> 
>>>> 
>>>> _______________________________________________
>>>> calendarserver-users mailing list
>>>> calendarserver-users at lists.macosforge.org
>>>> https://lists.macosforge.org/mailman/listinfo/calendarserver-users
>>> 
>>> 
>>> 
>> 
>> --
>> Kyle Silfer
>> Reign of Toads
>> IT Consultation Services
>> 505.265.5840 h
>> 505.918.0978 c
>> 505.346.0660 x242 w
>> 
>> _______________________________________________
>> calendarserver-users mailing list
>> calendarserver-users at lists.macosforge.org
>> https://lists.macosforge.org/mailman/listinfo/calendarserver-users
>> 
>> 
> 
> --
> Kyle Silfer
> Reign of Toads
> IT Consultation Services
> 505.265.5840 h
> 505.918.0978 c
> 505.346.0660 x242 w
> 
> _______________________________________________
> calendarserver-users mailing list
> calendarserver-users at lists.macosforge.org
> https://lists.macosforge.org/mailman/listinfo/calendarserver-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-users/attachments/20151116/54668ef2/attachment-0001.html>


More information about the calendarserver-users mailing list