2014-06-05 135 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