apple / ccs-calendarserver

The Calendar and Contacts Server.
https://www.calendarserver.org
Apache License 2.0
484 stars 136 forks source link

sqlite3 and "too many SQL variables" on <calendar-multiget> #514

Closed controlcde closed 6 years ago

controlcde commented 6 years ago

I´m currently using an old ccs v3.2 (debian 7.11 with sqlite backend) which I want to migrate to ccs 9.1.1 - postgres). I´m using vdirsyncer as sync client and for the most accounts it works like a charm but on a few accounts I´ve got problems. It seams so that the maximum number of sqlite operations has reached:

2018-06-11 15:40:31+0200 [-] [caldav-4] [PooledMemCacheProtocol,client] [twext.web2.server#error] [Failure instance: Traceback: <class 'sqlite3.OperationalError'>: too many SQL variables
2018-06-11 15:40:31+0200 [-] [caldav-4] /usr/lib/python2.7/dist-packages/twisted/internet/defer.py:1187:unwindGenerator
2018-06-11 15:40:31+0200 [-] [caldav-4] /usr/lib/python2.7/dist-packages/twisted/internet/defer.py:1045:_inlineCallbacks
2018-06-11 15:40:31+0200 [-] [caldav-4] /usr/lib/python2.7/dist-packages/twistedcaldav/method/report_multiget_common.py:314:multiget_common
2018-06-11 15:40:31+0200 [-] [caldav-4] /usr/lib/python2.7/dist-packages/twisted/internet/defer.py:1187:unwindGenerator
2018-06-11 15:40:31+0200 [-] [caldav-4] --- <exception caught here> ---
2018-06-11 15:40:31+0200 [-] [caldav-4] /usr/lib/python2.7/dist-packages/twisted/internet/defer.py:1045:_inlineCallbacks
2018-06-11 15:40:31+0200 [-] [caldav-4] /usr/lib/python2.7/dist-packages/twistedcaldav/method/report_multiget_common.py:193:doResponse
2018-06-11 15:40:31+0200 [-] [caldav-4] /usr/lib/python2.7/dist-packages/txdav/caldav/datastore/index_file.py:238:resourcesExist
2018-06-11 15:40:31+0200 [-] [caldav-4] /usr/lib/python2.7/dist-packages/twistedcaldav/sql.py:314:_db_values_for_sql
2018-06-11 15:40:31+0200 [-] [caldav-4] /usr/lib/python2.7/dist-packages/twistedcaldav/sql.py:341:_db_execute
2018-06-11 15:40:31+0200 [-] [caldav-4] ]

vdirsyncer seams to sync with the command. Are in 3.2 any options to solve the problem? Maybe to limit the maximal number of elements a calendar-multiget could request?

dreness commented 6 years ago

Hey - I replied to your mailing list post earlier today, but just for completeness: check out https://github.com/apple/ccs-calendarserver/blob/master/conf/caldavd-stdconfig.plist#L1864 and / or https://github.com/apple/ccs-calendarserver/blob/master/conf/caldavd-stdconfig.plist#L1867

controlcde commented 6 years ago

@dreness Thanks a lot. The vdirsyncer maintainer also fixed something so the sync will work.