2014-06-05 102 views
1

升级我的服务器小牛和Server.app 3版之后(的CalDAV服务器工具OSX Server上小牛更新后断),这些工具停止正常工作:找不到符号:_PQclear

calendarserver_export
calendarserver_manage_principals
...

当我输入这个命令,例如:

sudo calendarserver_export -u <account_name> 

则显示此错误:

Traceback (most recent call last): 
    File "/Applications/Server.app/Contents/ServerRoot/usr/sbin/calendarserver_export", line 32, in <module> 
    from calendarserver.tools.export import main 
    File "/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/calendarserver/tools/export.py", line 50, in <module> 
    from calendarserver.tools.cmdline import utilityMain, WorkerService 
    File "/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/calendarserver/tools/cmdline.py", line 21, in <module> 
    from calendarserver.tap.caldav import CalDAVServiceMaker, CalDAVOptions 
    File "/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/calendarserver/tap/caldav.py", line 87, in <module> 
    from twistedcaldav.upgrade import UpgradeFileSystemFormatStep, PostDBImportStep 
    File "/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/twistedcaldav/upgrade.py", line 63, in <module> 
    from calendarserver.tap.util import getRootResource, FakeRequest, directoryFromConfig 
    File "/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/calendarserver/tap/util.py", line 87, in <module> 
    from txdav.base.datastore.subpostgres import PostgresService 
    File "/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/txdav/base/datastore/subpostgres.py", line 35, in <module> 
    import pgdb 
    File "/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/pgdb.py", line 66, in <module> 
    from _pg import * 
ImportError: dlopen(/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/_pg.so, 2): Symbol not found: _PQclear 
    Referenced from: /Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/_pg.so 
    Expected in: flat namespace 
in /Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/_pg.so 

所有这些工具的共同点通过Python访问CalDAV的数据,通过PyGreSQL(CalDAV的数据是在Postgres数据库托管)。 我设法重现很干脆这个问题:

#login with root 
bob $ sudo -i 
#launch python and import pg (postgres module for python) 
root $ python 
Python 2.7.5 (default, Mar 9 2014, 22:15:05) 
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import pg 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
    File "/Library/Python/2.7/site-packages/PyGreSQL-4.1.1-py2.7-macosx-10.9-intel.egg/pg.py", line 31, in <module> 
    from _pg import * 
ImportError: dlopen(/Library/Python/2.7/site-packages/PyGreSQL-4.1.1-py2.7-macosx-10.9-intel.egg/_pg.so, 2): Symbol not found: _PQclear 
    Referenced from: /Library/Python/2.7/site-packages/PyGreSQL-4.1.1-py2.7-macosx-10.9-intel.egg/_pg.so 
    Expected in: flat namespace 
in /Library/Python/2.7/site-packages/PyGreSQL-4.1.1-py2.7-macosx-10.9-intel.egg/_pg.so 

,如果我从我的用户帐户运行Python(不是root),我没有得到错误
我认为有一些错误的路径,或类似的东西,但我不能找到什么... ...
我需要有根凭据才能使用** ** calendarserver_export

任何线索?

回答

0

由于某些原因,在小牛队中,您必须使用“calendar”用户(别名为_calendar)启动这些命令。

所以命令应该是: 须藤-u日历 calendarserver_export -u