apple / ccs-calendarserver

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

carddav incorrect handling of xattrs on Debian Linux 5 #289

Closed macosforgebot closed 13 years ago

macosforgebot commented 14 years ago

alex.stapleton@… originally submitted this as ticket:362


Running ./run -a to get carddav running.

Logging in via HTTPS results in

Internal Server Error

An error occurred rendering the requested page. More information is available in the server log.

From the logs you can see this exception…

2010-02-17 21:44:06+0000 [-] [caldav-0]         Traceback (most recent call last):
2010-02-17 21:44:06+0000 [-] [caldav-0]           File "/home/alexs/Twisted/twisted/internet/defer.py", line 184, in addCallbacks
2010-02-17 21:44:06+0000 [-] [caldav-0]             self._runCallbacks()
2010-02-17 21:44:06+0000 [-] [caldav-0]           File "/home/alexs/Twisted/twisted/internet/defer.py", line 326, in _runCallbacks
2010-02-17 21:44:06+0000 [-] [caldav-0]             self.result = callback(self.result, *args, **kw)
2010-02-17 21:44:06+0000 [-] [caldav-0]           File "/home/alexs/Twisted/twisted/internet/defer.py", line 287, in _continue
2010-02-17 21:44:06+0000 [-] [caldav-0]             self.unpause()
2010-02-17 21:44:06+0000 [-] [caldav-0]           File "/home/alexs/Twisted/twisted/internet/defer.py", line 283, in unpause
2010-02-17 21:44:06+0000 [-] [caldav-0]             self._runCallbacks()
2010-02-17 21:44:06+0000 [-] [caldav-0]         --- <exception caught here> ---
2010-02-17 21:44:06+0000 [-] [caldav-0]           File "/home/alexs/Twisted/twisted/internet/defer.py", line 326, in _runCallbacks
2010-02-17 21:44:06+0000 [-] [caldav-0]             self.result = callback(self.result, *args, **kw)
2010-02-17 21:44:06+0000 [-] [caldav-0]           File "/home/alexs/Twisted/twisted/web2/dav/method/get.py", line 49, in <lambda>
2010-02-17 21:44:06+0000 [-] [caldav-0]             d.addCallback(lambda _: super(twisted.web2.dav.static.DAVFile, self).http_GET(request))
2010-02-17 21:44:06+0000 [-] [caldav-0]           File "/home/alexs/Twisted/twisted/web2/resource.py", line 128, in http_GET
2010-02-17 21:44:06+0000 [-] [caldav-0]             return self.render(request)
2010-02-17 21:44:06+0000 [-] [caldav-0]           File "/home/alexs/CalendarServer-trunk/twistedcaldav/extensions.py", line 798, in render
2010-02-17 21:44:06+0000 [-] [caldav-0]             return self.renderDirectory(request)
2010-02-17 21:44:06+0000 [-] [caldav-0]           File "/home/alexs/CalendarServer-trunk/twistedcaldav/extensions.py", line 873, in renderDirectory
2010-02-17 21:44:06+0000 [-] [caldav-0]             d = self.renderDirectoryBody(request)
2010-02-17 21:44:06+0000 [-] [caldav-0]           File "/home/alexs/CalendarServer-trunk/twistedcaldav/util.py", line 102, in wrapper
2010-02-17 21:44:06+0000 [-] [caldav-0]             return f(*args, **kwargs)
2010-02-17 21:44:06+0000 [-] [caldav-0]           File "/home/alexs/CalendarServer-trunk/twistedcaldav/extensions.py", line 893, in renderDirectoryBody
2010-02-17 21:44:06+0000 [-] [caldav-0]             url, name, size, lastModified, contentType = self.getChildDirectoryEntry(child, name)
2010-02-17 21:44:06+0000 [-] [caldav-0]           File "/home/alexs/CalendarServer-trunk/twistedcaldav/extensions.py", line 1019, in getChildDirectoryEntry
2010-02-17 21:44:06+0000 [-] [caldav-0]             contentType = child.contentType()
2010-02-17 21:44:06+0000 [-] [caldav-0]           File "/home/alexs/Twisted/twisted/web2/dav/resource.py", line 521, in contentType
2010-02-17 21:44:06+0000 [-] [caldav-0]             if self.hasDeadProperty((davxml.dav_namespace, "getcontenttype")):
2010-02-17 21:44:06+0000 [-] [caldav-0]           File "/home/alexs/Twisted/twisted/web2/dav/resource.py", line 476, in hasDeadProperty
2010-02-17 21:44:07+0000 [-] [caldav-0]             return self.deadProperties().contains(qname)
2010-02-17 21:44:07+0000 [-] [caldav-0]           File "/home/alexs/Twisted/twisted/web2/dav/xattrprops.py", line 237, in contains2010-02-17 21:44:07+0000 [-] [caldav-0]             statusForFailure(Failure()),
2010-02-17 21:44:07+0000 [-] [caldav-0]           File "/home/alexs/Twisted/twisted/web2/dav/http.py", line 310, in statusForFailure2010-02-17 21:44:07+0000 [-] [caldav-0]             failure.raiseException()
2010-02-17 21:44:07+0000 [-] [caldav-0]           File "/home/alexs/Twisted/twisted/web2/dav/xattrprops.py", line 229, in contains2010-02-17 21:44:07+0000 [-] [caldav-0]             self.attrs.get(key)2010-02-17 21:44:07+0000 [-] [caldav-0]           File "/home/alexs/xattr/build/lib.linux-i686-2.5/xattr/__init__.py", line 73, in get
2010-02-17 21:44:07+0000 [-] [caldav-0]             return self._get(name, 0, 0, options | self.options)2010-02-17 21:44:07+0000 [-] [caldav-0]           File "/home/alexs/xattr/build/lib.linux-i686-2.5/xattr/__init__.py", line 17, in _func
2010-02-17 21:44:07+0000 [-] [caldav-0]             return func(first, *args)2010-02-17 21:44:07+0000 [-] [caldav-0]         exceptions.IOError: [Errno 95] Operation not supported: '/home/alexs/CalendarServer-trunk/data/Documents/calendars'

I have reduced this somewhat by instrumenting the xattr library.

import xattr
xattr.getxattr("data/Documents/calendars","user.{DAV:}getcontenttype")

Will throw the same IOError.

Running caldav as root gets around this xattr problem but memcached doesn't run. (Which also breaks the server. No pages load.)

macosforgebot commented 14 years ago

Marcus.Ilgner@… originally submitted this as comment:1:⁠ticket:362


This seems to work correctly if I add user_xattr to the mount options of the corresponding partition.

macosforgebot commented 13 years ago

@wsanchez originally submitted this as comment:2:⁠ticket:362


Now that we use a database, there are no xattrs to worry about.