如何修复CouchDB复制上的身份验证错误

问题描述

我已经设置了本地/远程CouchDB服务器,我想在它们之间复制。

在每个数据库上都可以卷曲,所以我知道两个数据库都可以正常运行:

curl -u admin:password https://remote.host.net/db_name-有效

curl -u admin:password http://localhost:5984/db_name-有效

但是,当我尝试设置复制时,它很麻烦。这是用于设置复制的命令:

curl -u admin:password -X POST http://localhost:5984/_replicate -d '{"source":"https://admin:password@remote.host.net/db_name","target":"http://admin:password@localhost:5984/db_name"}' -H "Content-Type: application/json"

错误消息:

{"error":"replication_auth_error","reason":"{session_request_failed,\"https://remote.host.net/_session\",\n\"admin\",\n{conn_failed,{error,nxdomain}}}"}

任何人都知道这里出了什么问题吗?

解决方法

我遇到了同样的问题,将 "continuous": true 添加到请求正文,返回一个 "ok":true

从文档来看,continuous 应该只在您希望复制总是被触发时源更改时才使用,我不知道为什么不包含它时会出现错误。

[编辑]

即使响应成功,数据也不会被复制。所以我们用这个脚本来实现复制https://gist.github.com/Aybee5/fba07b06b94442a529ebae5465b77737

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...