You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2022/01/09 23:56:51 UTC

[GitHub] [couchdb] JakeHillion opened a new issue #3887: Replication - url_parsing_failed/nx_domain on IPv6

JakeHillion opened a new issue #3887:
URL: https://github.com/apache/couchdb/issues/3887


   [NOTE]: # ( ^^ Provide a general summary of the issue in the title above. ^^ )
   
   ## Description
   
   I am attempting to schedule replication between two instances which only have IPv6 connectivity between them. The failure in the logs suggests that this parser cannot accept IPv6 addresses.
   
   ## Steps to Reproduce
   
   - `curl -X PUT 'http://[fd19:ca4f:1891:0:c77d:21c3:80b1:47d5]:5984/a'`
   - `curl -X PUT 'http://[fd19:ca4f:1891:0:c77d:21c3:80b1:47d5]:5984/a/a' -d '{}'`
   - `curl -X PUT 'http://[fd19:ca4f:1891:0:5d59:4c52:1d67:4f85]:5984/b'`
   
   ### Replicate Endpoint
   
   - `curl -X POST  -H 'Content-Type: application/json' 'http://[fd19:ca4f:1891:0:5d59:4c52:1d67:4f85]:5984/_replicate' -d '{"source":"http://[fd19:ca4f:1891:0:c77d:21c3:80b1:47d5]:5984/a","target":"http://[fd19:ca4f:1891:0:5d59:4c52:1d67:4f85]:5984/b"}'`
     - `{"error":"nxdomain","reason":"could not resolve http://[fd19:ca4f:1891:0:c77d:21c3:80b1:47d5]:5984/a/"}`
   
   ### Fauxton
   
   This one is trickier to replicate via curl IMO, so instead I've included an image of the configuration and then the output logs.
   
   ![image](https://user-images.githubusercontent.com/5712856/148706302-9c8f64e3-85a2-4199-bfea-06138b9de674.png)
   
   Logs:
   - `[error] 2022-01-09T23:52:44.193423Z couchdb@127.0.0.1 <0.9118.0> -------- couch_replicator_httpc: auth plugin initialization failed "http://[fd19:ca4f:1891:0:c77d:21c3:80b1:47d5]:5984/a/" {session_request_failed,"http://fd19:ca4f:1891:0:c77d:21c3:80b1:47d5/_session","admin",{url_parsing_failed,{error,invalid_uri}}}`
   - `[error] 2022-01-09T23:52:44.193636Z couchdb@127.0.0.1 <0.9118.0> -------- throw:{replication_auth_error,{session_request_failed,"http://fd19:ca4f:1891:0:c77d:21c3:80b1:47d5/_session","admin",{url_parsing_failed,{error,invalid_uri}}}}: Replication 0d172815abcfddb7ae70200408d7f6b8 failed to start "http://[fd19:ca4f:1891:0:c77d:21c3:80b1:47d5]:5984/a/" -> "http://[fd19:ca4f:1891:0:5d59:4c52:1d67:4f85]:5984/b/" doc <<"shards/00000000-7fffffff/_replicator.1641770003">>:<<"52b362d49d9b3f9b57b03fed76000352">> 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}]}]`
   
   ## Expected Behaviour
   
   - Replication to occur as with IPv4.
   - More specifically, the URLs are in (I believe) the correct format for a directly specified IPv6 address, yet it seems for the `_replicate` endpoint these are parsed as domains, and the `_replicator` databases treats them as invalid addresses.
   
   ## Your Environment
   
   CouchdbTest1 (fd19:ca4f:1891:0:c77d:21c3:80b1:47d5/64):
   `{"couchdb":"Welcome","version":"3.2.1","git_sha":"244d428af","uuid":"7e9872dd6737bc29302be23caf5294c1","features":["access-ready","partitioned","pluggable-storage-engines","reshard","scheduler"],"vendor":{"name":"The Apache Software Foundation"}}`
   
   CouchdbTest2 (fd19:ca4f:1891:0:5d59:4c52:1d67:4f85/64):
   `{"couchdb":"Welcome","version":"3.2.1","git_sha":"244d428af","uuid":"b6a91ada70259942daf27bc5fbad8f4a","features":["access-ready","partitioned","pluggable-storage-engines","reshard","scheduler"],"vendor":{"name":"The Apache Software Foundation"}}`
   
   * CouchDB version used:
   * curl 7.74.0
   * Debian 11 Bullseye.
   
   ## Additional Context
   
   I found https://issues.apache.org/jira/browse/COUCHDB-665 when searching, which suggests that this bug may be a regression. I used similar commands to them, with the difference being that I created two separate virtual machines for testing, rather than using a single host.
   
   I haven't replicated this in this bug report, but I also tried on some other systems allocating a DNS name with a AAAA record to the same IPv6 addresses. This also did not immediately solve the problem, but I have left it out of this bug report as it might be a confounding variable.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb] nickva commented on issue #3887: Replication - url_parsing_failed/nx_domain on IPv6

Posted by GitBox <gi...@apache.org>.
nickva commented on issue #3887:
URL: https://github.com/apache/couchdb/issues/3887#issuecomment-1009616621


   This looks like a bug with url parsing. Specifically, it looks like it's in the _session (cookie) auth plugin in replicator. 
   
   If you're willing to try an experiment, see if disabling the session auth plugin would make it behave differently.  Try this config setting:
   
   ```ini
   [replicator]
   auth_plugins = couch_replicator_auth_noop
   ```
   
   This bypasses the session plugin and switches to sending basic auth credentials with every request. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb] nickva commented on issue #3887: Replication - url_parsing_failed/nx_domain on IPv6

Posted by GitBox <gi...@apache.org>.
nickva commented on issue #3887:
URL: https://github.com/apache/couchdb/issues/3887#issuecomment-1012533209


   @JakeHillion thank you for checking.
   
   `nxdomain` is the error from failing to resolve the host with DNS. In this case it's an IP already just in the IPv6 format. So this looks like a bug.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb] JakeHillion commented on issue #3887: Replication - url_parsing_failed/nx_domain on IPv6

Posted by GitBox <gi...@apache.org>.
JakeHillion commented on issue #3887:
URL: https://github.com/apache/couchdb/issues/3887#issuecomment-1009896718


   Happy to try extra tests now I've got the machines setup.
   
   ## My Environment
   
   Added to each machine:
   
   ```
   cat > /opt/couchdb/etc/local.d/20-replicator.ini
   [replicator]
   auth_plugins = couch_replicator_auth_noop
   ```
   
   Otherwise same as initial post.
   
   ## Replicate Endpoint
   
   - `curl -X POST -H 'Content-Type: application/json' 'http://[fd19:ca4f:1891:0:5d59:4c52:1d67:4f85]:5984/_replicate' -d '{"source":"http://[fd19:ca4f:1891:0:c77d:21c3:80b1:47d5]:5984/a","target":"http://[fd19:ca4f:1891:0:5d59:4c52:1d67:4f85]:5984/b"}'`
     - `{"error":"nxdomain","reason":"could not resolve http://[fd19:ca4f:1891:0:c77d:21c3:80b1:47d5]:5984/a/"}`
   
   ## Fauxton
   
   Configured in the UI as above.
   
   Logs:
   - `[notice] 2022-01-11T11:58:34.347861Z couchdb@127.0.0.1 <0.3873.0> -------- Retrying GET request to http://[fd19:ca4f:1891:0:c77d:21c3:80b1:47d5]:5984/a/ in 4.0 seconds due to error {conn_failed,{error,nxdomain}}`
   - `[error] 2022-01-11T11:58:34.348737Z couchdb@127.0.0.1 <0.3873.0> -------- Replicator, request GET to "http://[fd19:ca4f:1891:0:c77d:21c3:80b1:47d5]:5984/a/" failed due to error {error,{conn_failed,{error,nxdomain}}}`
   - `[error] 2022-01-11T11:58:34.349091Z couchdb@127.0.0.1 <0.3873.0> -------- exit:{nxdomain,<<"could not resolve http://[fd19:ca4f:1891:0:c77d:21c3:80b1:47d5]:5984/a/">>}: Replication 0d172815abcfddb7ae70200408d7f6b8 failed to start "http://[fd19:ca4f:1891:0:c77d:21c3:80b1:47d5]:5984/a/" -> "http://[fd19:ca4f:1891:0:5d59:4c52:1d67:4f85]:5984/b/" doc <<"shards/00000000-7fffffff/_replicator.1641770003">>:<<"16c76a702836504eee392149ab000b38">> stack:[{couch_replicator_api_wrap,db_open,3,[{file,"src/couch_replicator_api_wrap.erl"},{line,120}]},{couch_replicator_scheduler_job,init_state,1,[{file,"src/couch_replicator_scheduler_job.erl"},{line,571}]}]`
   
   ## Summary
   
   This seems to align the two methods of replication. Whereas before they were getting different errors, they're now the same, but I'm still experiencing problems in my testing.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org