Skip to content
This repository has been archived by the owner on Feb 13, 2020. It is now read-only.

Error running carddav server in Linux #285

Closed
macosforgebot opened this issue Jan 13, 2010 · 13 comments
Closed

Error running carddav server in Linux #285

macosforgebot opened this issue Jan 13, 2010 · 13 comments

Comments

@macosforgebot
Copy link

dave@… originally submitted this as ticket:358

  • Cc: dennis@…, rene@…, alexis@…

When trying to launch the carddav server on a Debian Etch machine with ./run, I get the error:

ImportError: No module named open directory

I've tried commenting out all opendirectory-related resources in carddavd-dev.plist, but still get the error. I understand that there is no opendirectory on Linux, but there doesn't seem to be a way of keeping the server from trying to load that module.

Full traceback below.

exec python /home/dave/Twisted/bin/twistd  -n carddav -f /home/dave/ContactsServer/conf/carddavd-dev.plist -o ProcessType=Combined 
Traceback (most recent call last):
  File "/home/dave/Twisted/bin/twistd", line 21, in <module>
    run()
  File "/home/dave/Twisted/twisted/scripts/twistd.py", line 27, in run
    app.run(runApp, ServerOptions)
  File "/home/dave/Twisted/twisted/application/app.py", line 374, in run
    config.parseOptions()
  File "/home/dave/Twisted/twisted/application/app.py", line 354, in parseOptions
    usage.Options.parseOptions(self, options)
  File "/home/dave/Twisted/twisted/python/usage.py", line 184, in parseOptions
    for (cmd, short, parser, doc) in self.subCommands:
  File "/home/dave/Twisted/twisted/application/app.py", line 365, in subCommands
    self.loadedPlugins[plug.tapname] = plug
  File "/home/dave/ContactsServer/twisted/plugins/carddav.py", line 13, in getProperty
    return getattr(reflect.namedClass(self.serviceMakerClass), propname)
  File "/home/dave/Twisted/twisted/python/reflect.py", line 347, in namedObject
    module = namedModule(string.join(classSplit[:-1], '.'))
  File "/home/dave/Twisted/twisted/python/reflect.py", line 335, in namedModule
    topLevel = __import__(name)
  File "/home/dave/ContactsServer/addressbookserver/tap/carddav.py", line 84, in <module>
    from twistedcaldav.static import AddressBookHomeProvisioningFile, DirectoryBackedAddressBookFile
  File "/home/dave/ContactsServer/twistedcaldav/static.py", line 78, in <module>
    from twistedcaldav.directory.addressbook import uidsResourceName as uidsResourceNameAddressBook
  File "/home/dave/ContactsServer/twistedcaldav/directory/addressbook.py", line 45, in <module>
    from twistedcaldav.report_addressbook_findshared import getReadWriteSharedAddressBookGroups, getReadOnlySharedAddressBookGroups, getWritersGroupForSharedAddressBookGroup
  File "/home/dave/ContactsServer/twistedcaldav/report_addressbook_findshared.py", line 30, in <module>
    import opendirectory
ImportError: No module named open directory
@macosforgebot
Copy link
Author

dennis@… originally submitted this as comment:1:⁠ticket:358

  • Cc dennis@… added

@macosforgebot
Copy link
Author

dennis@… originally submitted this as comment:2:⁠ticket:358


By enabling the build of PyOpenDirectory on linux, I was enable to get the server up.

@macosforgebot
Copy link
Author

guy@… originally submitted this as comment:3:⁠ticket:358


Replying to dennis@…:

By enabling the build of PyOpenDirectory on linux, I was enable to get the server up.

Please can you provide some simple steps for this?

@macosforgebot
Copy link
Author

dennis@… originally submitted this as comment:4:⁠ticket:358


By editing the run script and comment out the check on darwin where PyOpenDirectory is fetched and build.

This makes the server start, but I haven't been able to connect to it using a Address Book client. But this could be a configuration error on my side.

@macosforgebot
Copy link
Author

guy@… originally submitted this as comment:5:⁠ticket:358


which revision did you have checked out? I'm still not getting this work complete. I've checked out the latest:

http://svn.calendarserver.org/repository/calendarserver/ContactsServer Revision: 5050

@macosforgebot
Copy link
Author

dennis@… originally submitted this as comment:6:⁠ticket:358


I checked out trunk, which seems to be revision 4952. But I had no problem doing it with revision 5050 either.

My changes in run is:

[ContactServer]$ svn diff run 
Index: run
===================================================================
--- run (revision 5050)
+++ run (working copy)
@@ -30,7 +30,7 @@
 ##

 set -e
-set -u
+#set -u

 wd="$(cd "$(dirname "$0")" && pwd)";

@@ -558,7 +558,7 @@
 # PyOpenDirectory
 #

-if [ "$(uname -s)" == "Darwin" ]; then
+#if [ "$(uname -s)" == "Darwin" ]; then
 #  if ! py_have_module opendirectory; then
     opendirectory="${top}/PyOpenDirectory";

@@ -568,7 +568,7 @@

     export PYTHONPATH="${PYTHONPATH}:${opendirectory}/build/${py_platform_libdir}";
 #  fi;
-fi;
+#fi;

 #
 # xattr

@macosforgebot
Copy link
Author

dennis@… originally submitted this as comment:7:⁠ticket:358


Trying again with code block:

[dennis@blackbox3 ContactServer]$ svn diff run 
Index: run
===================================================================
--- run (revision 5050)
+++ run (working copy)
@@ -30,7 +30,7 @@
 ##

 set -e
-set -u
+#set -u

 wd="$(cd "$(dirname "$0")" && pwd)";

@@ -558,7 +558,7 @@
 # PyOpenDirectory
 #

-if [ "$(uname -s)" == "Darwin" ]; then
+#if [ "$(uname -s)" == "Darwin" ]; then
 #  if ! py_have_module opendirectory; then
     opendirectory="${top}/PyOpenDirectory";

@@ -568,7 +568,7 @@

     export PYTHONPATH="${PYTHONPATH}:${opendirectory}/build/${py_platform_libdir}";
 #  fi;
-fi;
+#fi;

 #
 # xattr

@macosforgebot
Copy link
Author

guy@… originally submitted this as comment:8:⁠ticket:358


ok well it seems to compile now... however when it starts the server:

Starting server...
exec python /root/Twisted/bin/twistd  -n carddav -f /root/ContactServer2/conf/carddavd-dev.plist -o ProcessType=Combined 
Traceback (most recent call last):
  File "/root/Twisted/bin/twistd", line 21, in <module>
    run()
  File "/root/Twisted/twisted/scripts/twistd.py", line 27, in run
    app.run(runApp, ServerOptions)
  File "/root/Twisted/twisted/application/app.py", line 374, in run
    config.parseOptions()
  File "/root/Twisted/twisted/application/app.py", line 354, in parseOptions
    usage.Options.parseOptions(self, options)
  File "/root/Twisted/twisted/python/usage.py", line 184, in parseOptions
    for (cmd, short, parser, doc) in self.subCommands:
  File "/root/Twisted/twisted/application/app.py", line 365, in subCommands
    self.loadedPlugins[plug.tapname] = plug
  File "/root/ContactServer2/twisted/plugins/carddav.py", line 13, in getProperty
    return getattr(reflect.namedClass(self.serviceMakerClass), propname)
  File "/root/Twisted/twisted/python/reflect.py", line 347, in namedObject
    module = namedModule(string.join(classSplit[:-1], '.'))
  File "/root/Twisted/twisted/python/reflect.py", line 335, in namedModule
    topLevel = __import__(name)
  File "/root/ContactServer2/addressbookserver/tap/carddav.py", line 71, in <module>
    from twistedcaldav.resource import CalDAVResource
  File "/root/ContactServer2/twistedcaldav/resource.py", line 42, in <module>
    from twisted.web2.dav.idav import IDAVPrincipalCollectionResource
ImportError: cannot import name IDAVPrincipalCollectionResource

@macosforgebot
Copy link
Author

rene@… originally submitted this as comment:9:⁠ticket:358

  • Cc rene@… added

@macosforgebot
Copy link
Author

rene@… originally submitted this as comment:10:⁠ticket:358


I can confirm the error, and also the workaround.

@macosforgebot
Copy link
Author

alexis@… originally submitted this as comment:11:⁠ticket:358

  • Cc alexis@… added

@macosforgebot
Copy link
Author

@wsanchez originally submitted this as comment:12:⁠ticket:358

  • Radar deleted
  • Description modified

@macosforgebot
Copy link
Author

@wsanchez originally submitted this as comment:13:⁠ticket:358

  • Status changed from new to closed
  • Milestone set to CalendarServer-3.1
  • Resolution changed from to Software changed

It should no longer be necessary to try to force build PyOpenDirectory. Try again with trunk.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants