[CalendarServer-dev] Error running calendarserver after upgrading db from 5.x to 7.x

Andre LaBranche dre at apple.com
Sat Jan 30 17:57:36 PST 2016

> On Jan 30, 2016, at 1:18 PM, Andre LaBranche <dre at apple.com> wrote:
> This is not expected. Does memcached need to be configured for Unicode, maybe?

It looks like we expect to be in ascii mode, as far as memcached is concerned:

You can debug the memcache side of this by configuring calendarserver to not launch memcached; instead you'll do so manually, in the foreground.

Edit caldavd.plist, and insert the following Pools configuration under the Memcached dict:


Manually start memcached in verbose mode on
memcached -l -vv

Start calendar server, load a principal page: https://whatever:8443/principals/users/you <https://whatever:8443/principals/users/you>

As you log in, you should see stuff in the memcached window:

<22 new auto-negotiating client connection
22: Client using the ascii protocol
>22 END

Also try the following test script which sets and gets unicode strings. bytes. whatever they are :) In SVN mode, I run ./bin/python mctest.py from the SVN dir to make sure the interpreter has access to six and memcache. If you don't use SVN mode, and don't have these modules installed system-wide, edit PYTHONPATH to help your interpreter find these modules.

# -*- coding: latin-1 -*-
from __future__ import print_function

import six

servers = [""]
mc = Client(servers, debug=1)

def setget(key, val):
    mc.set(key, val)
    newval = mc.get(key)
    print("key:", key)
    print("set:".rjust(8), val)
    print ("got:".rjust(8), newval, "\n")

setget("ascii", "xyzzy")

setget("unicode_1", six.u('\U0001f648'))
setget("unicode_2", six.u('\u25c9'))
setget("unicode_3", six.u('\u4f1a'))
setget("unicode_4", six.u('dr\\xe9'))


Output looks like:

key: ascii
    set: xyzzy
    got: xyzzy 

key: unicode_1
    set: 🙈
    got: 🙈 

key: unicode_2
    set: ◉
    got: ◉ 

key: unicode_3
    set: 会
    got: 会 

key: unicode_4
    set: dré
    got: dré 

... and the memcached log confirms we're still in ascii mode:

<25 new auto-negotiating client connection
25: Client using the ascii protocol
<25 set ascii 0 0 5 
<25 get ascii
>25 sending key ascii
>25 END
<25 set unicode_1 0 0 4 
<25 get unicode_1
>25 sending key unicode_1
>25 END

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-dev/attachments/20160130/2426c544/attachment.html>

More information about the calendarserver-dev mailing list