python Desktopcouch 仅适用于 root 帐户

python Desktopcouch 仅适用于 root 帐户

我正在尝试在 Python 中使用这个简单的例子:

    >>> from desktopcouch.records.server import CouchDatabase
    >>> from desktopcouch.records.record import Record
    >>> db = CouchDatabase('testing', create=True)
    >>>

但只在 root 账户下有效,普通用户可以使用:

    >>> from desktopcouch.records.server import CouchDatabase
    >>> from desktopcouch.records.record import Record
    >>> db = CouchDatabase('testing', create=True)
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/lib/pymodules/python2.7/desktopcouch/application/server.py", line 101, in __init__
    oauth_tokens=oauth_tokens, ctx=ctx)
    File "/usr/lib/pymodules/python2.7/desktopcouch/application/server.py", line 75, in __init__
    oauth_tokens=oauth_tokens, ctx=ctx, views_factory=views_factory)
    File "/usr/lib/pymodules/python2.7/desktopcouch/records/database.py", line 123, in __init__
    self._reconnect()
    File "/usr/lib/pymodules/python2.7/desktopcouch/application/server.py", line 81, in _reconnect
    port = find_port(ctx=self.ctx)
    File "/usr/lib/pymodules/python2.7/desktopcouch/application/platform/__init__.py", line 48, in find_port
    return platform_find_port(pid, ctx)
    File "/usr/lib/pymodules/python2.7/desktopcouch/application/platform/linux/__init__.py", line 100, in platform_find_port
    proxy = bus.get_object('org.desktopcouch.CouchDB', '/')
    File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 241, in get_object
    follow_name_owner_changes=follow_name_owner_changes)
    File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 248, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
    File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 180, in activate_name_owner
    self.start_service_by_name(bus_name)
    File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 278, in start_service_by_name
    'su', (bus_name, flags)))
    File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
    dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken

答案1

你使用的 Ubuntu 版本是什么?只能以 root 身份启动 Desktopcouch 听起来像是这个错误:一行“uri_file=”配置修复,兼容 CouchDB 1.1.1

我提出了一个修复方案,但看起来单元测试存在一些问题(我认为与我的修复无关)。

无论如何,desktopcouch 现在已经无人维护,我建议不是在其上构建任何新软件。如果你对 Ubuntu 同步即服务感兴趣,请查看U1DB,Canonical 的 Desktopcouch 替代品。

如果你有兴趣在桌面应用中使用 CouchDB,请查看用户Couch超细纤维(免责声明:我是这两个工具的作者和维护者)。这两个工具都是作为 Novacut 项目的一部分开发的。我们最初使用的是 Desktopcouch,但后来不再使用它了。

相关内容