couchdb icon indicating copy to clipboard operation
couchdb copied to clipboard

Couch DB | Replication Error | replication_auth_error

Open sbagati opened this issue 3 years ago • 4 comments

We are encountering below error in replicating "services" database Version Details :

[[email protected] tmp]# curl http://admin:[email protected]:5984 {"couchdb":"Welcome","version":"3.1.1","git_sha":"ce596c65d","uuid":"xxxxxxxxxxxxxxxxxxx","features":["access-ready","partitioned","pluggable-storage-engines","reshard","scheduler"],"vendor":{"name":"The Apache Software Foundation"}}

Source standalone : couchstagedb1.bmi.expertcity.com Target cluster: couchstagedb.aor.expertcity.com

[[email protected] ~]# /opt/ec/couchdb/couchdb_replication_restart.rb -u admin -p xxxxxx -t couchstagedb.aor.expertcity.com -c services -s Replication is in error state the error is: {replication_auth_error, {session_request_failed, "http://couchstagedb1.bmi.expertcity.com:5984/_session","admin", req_timedout}} Replication already running on couchstagedb.aor.expertcity.com for services from couchstagedb1.las.expertcity.com Replication already running on couchstagedb.aor.expertcity.com for services from couchstagedb.ava.expertcity.com

Debug mode logs :

[error] 2022-04-04T10:21:59.915084Z [email protected] <0.1089.0> -------- couch_replicator_httpc: auth plugin initialization failed "http://admin:@couchstagedb1.bmi.expertcity.com:5984/services/" {session_request_failed,"http://couchstagedb1.bmi.expertcity.com:5984/_session","admin",req_timedout} [error] 2022-04-04T10:21:59.915268Z [email protected] <0.1089.0> -------- throw:{replication_auth_error,{session_request_failed,"http://couchstagedb1.bmi.expertcity.com:5984/_session","admin",req_timedout}}: Replication bba30bcc7ff2d1566ee7413473142bce+continuous failed to start "http://admin:@couchstagedb1.bmi.expertcity.com:5984/services/" -> "http://admin:*****@couchstagedb.aor.expertcity.com:5984/services/" doc <<"shards/00000000-7fffffff/_replicator.1605555927">>:<<"services_couchstagedb1_bmi_expertcity_com">> stack:[{couch_replicator_httpc,setup,1,[{file,"src/couch_replicator_httpc.erl"},{line,59}]},{couch_replicator_api_wrap,db_open,3,[{file,"src/couch_replicator_api_wrap.erl"},{line,74}]}]

Please help

sbagati avatar Apr 05 '22 10:04 sbagati

@sbagati it looks like the replicator cannot make requests to the _session endpoint. It's getting a timeout. Can try logging in on that node and use curl to perform the same request and see if it works. It could be a firewall or proxy in between.

Sometimes proxies can alter or prevent cookie headers from being set properly. In that case could try disabling the session auth and revert to using basic auth for replication:

[replicator]
auth_plugins = couch_replicator_auth_noop

nickva avatar Apr 06 '22 03:04 nickva

Thanks a lot @nickva for the help and support after introducing the parameter in local.ini, issue got resolved and replication process is up now [replicator] auth_plugins = couch_replicator_auth_noop

sbagati avatar Apr 06 '22 13:04 sbagati

@nickva : Now the error we are getting is below: [[email protected] ~]# /opt/ec/couchdb/couchdb_replication_restart.rb -u admin -p xxxxxxxx -t couchstagedb.aor.expertcity.com -c services -s Replication is in error state the error is: {http_request_failed,"GET", "http://admin:*****@couchstagedb1.bmi.expertcity.com:5984/services/", {error,{error,{conn_failed,{error,etimedout}}}}} [[email protected] ~]# /opt/ec/couchdb/couchdb_replication_check.rb -u admin -p xxxxxxx couchstagedb1.bmi.expertcity.com couchstagedb.aor.expertcity.com services process_status:0 document_mismatches:-1

Please help

sbagati avatar Apr 06 '22 13:04 sbagati

@sbagati It looks like the the connection failed with a timeout {error,{error,{conn_failed,{error,etimedout}}}}}. It's hard to say why it failed beyond that. Could be a proxy/firewall issue, invalid port, or a resource limitation somewhere perhaps.

nickva avatar Apr 08 '22 14:04 nickva