You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Christian Stocker (JIRA)" <ji...@apache.org> on 2009/11/30 10:51:20 UTC
[jira] Created: (COUCHDB-584) Remote Replication with HTTP Auth
fails on design docs
Remote Replication with HTTP Auth fails on design docs
------------------------------------------------------
Key: COUCHDB-584
URL: https://issues.apache.org/jira/browse/COUCHDB-584
Project: CouchDB
Issue Type: Bug
Components: Replication
Affects Versions: 0.10
Reporter: Christian Stocker
I try to replicate a database with design documents. It fails on it. Here's the log from the server
[info] [<0.4462.0>] 195.226.16.50 - - 'GET' /mydatabase/_changes?style=all_docs&heartbeat=true&since=0&feed=normal 200
[info] [<0.4463.0>] 195.226.16.50 - - 'GET' /mydatabase/_design%2Fmydesign?open_revs=["3-ce4179d8efd6132c211d95e858619051"]&revs=true&latest=true 301
[info] [<0.4465.0>] 195.226.16.50 - - 'GET' /mydatabase/_design/mydesign?open_revs=["3-ce4179d8efd6132c211d95e858619051"]&revs=true&latest=true_design%2Fmydesign?open_revs=["3-ce4179d8efd6132c211d95e858619051"]&revs=true&latest=true 401
Looks like the redirect doesn't send the auth parameters on the second attempt (and the URL looks fishy too, but it works from the browser with the correct auth parameters)
I start the replication with
curl -X POST http://127.0.0.1:5984/_replicate -d '{"source":"http://admin:*****@example.org:5984/mydatabase/", "target":"mydatabase_rep"}'
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (COUCHDB-584) Remote Replication with HTTP Auth
fails on design docs
Posted by "Adam Kocoloski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-584?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Adam Kocoloski reassigned COUCHDB-584:
--------------------------------------
Assignee: Adam Kocoloski
> Remote Replication with HTTP Auth fails on design docs
> ------------------------------------------------------
>
> Key: COUCHDB-584
> URL: https://issues.apache.org/jira/browse/COUCHDB-584
> Project: CouchDB
> Issue Type: Bug
> Components: Replication
> Affects Versions: 0.10
> Reporter: Christian Stocker
> Assignee: Adam Kocoloski
>
> I try to replicate a database with design documents. It fails on it. Here's the log from the server
> [info] [<0.4462.0>] 195.226.16.50 - - 'GET' /mydatabase/_changes?style=all_docs&heartbeat=true&since=0&feed=normal 200
> [info] [<0.4463.0>] 195.226.16.50 - - 'GET' /mydatabase/_design%2Fmydesign?open_revs=["3-ce4179d8efd6132c211d95e858619051"]&revs=true&latest=true 301
> [info] [<0.4465.0>] 195.226.16.50 - - 'GET' /mydatabase/_design/mydesign?open_revs=["3-ce4179d8efd6132c211d95e858619051"]&revs=true&latest=true_design%2Fmydesign?open_revs=["3-ce4179d8efd6132c211d95e858619051"]&revs=true&latest=true 401
> Looks like the redirect doesn't send the auth parameters on the second attempt (and the URL looks fishy too, but it works from the browser with the correct auth parameters)
> I start the replication with
> curl -X POST http://127.0.0.1:5984/_replicate -d '{"source":"http://admin:*****@example.org:5984/mydatabase/", "target":"mydatabase_rep"}'
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (COUCHDB-584) Remote Replication with HTTP Auth
fails on design docs
Posted by "Adam Kocoloski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12783755#action_12783755 ]
Adam Kocoloski commented on COUCHDB-584:
----------------------------------------
Thanks, Christian. The bit with the mangled query-string parameters on the redirection is fixed in 0.10.1, but I think I now see the problem with the credentials. The replicator simply follows the URL in the Location response header, and that URL won't include the auth info. Patching this will require the replicator to decode http://user:pass@host:port URLs instead of relying on the ibrowse HTTP client library to do that for us.
A temporary workaround would be to construct the Authorization header yourself and include that in the POST to _replicate, for example
{
"source":{
"url":"http://example.org:5984/mydatabase",
"headers":{
"Authorization":"Basic ...="
}
},
"target":"mydatabase_rep"
}
> Remote Replication with HTTP Auth fails on design docs
> ------------------------------------------------------
>
> Key: COUCHDB-584
> URL: https://issues.apache.org/jira/browse/COUCHDB-584
> Project: CouchDB
> Issue Type: Bug
> Components: Replication
> Affects Versions: 0.10
> Reporter: Christian Stocker
>
> I try to replicate a database with design documents. It fails on it. Here's the log from the server
> [info] [<0.4462.0>] 195.226.16.50 - - 'GET' /mydatabase/_changes?style=all_docs&heartbeat=true&since=0&feed=normal 200
> [info] [<0.4463.0>] 195.226.16.50 - - 'GET' /mydatabase/_design%2Fmydesign?open_revs=["3-ce4179d8efd6132c211d95e858619051"]&revs=true&latest=true 301
> [info] [<0.4465.0>] 195.226.16.50 - - 'GET' /mydatabase/_design/mydesign?open_revs=["3-ce4179d8efd6132c211d95e858619051"]&revs=true&latest=true_design%2Fmydesign?open_revs=["3-ce4179d8efd6132c211d95e858619051"]&revs=true&latest=true 401
> Looks like the redirect doesn't send the auth parameters on the second attempt (and the URL looks fishy too, but it works from the browser with the correct auth parameters)
> I start the replication with
> curl -X POST http://127.0.0.1:5984/_replicate -d '{"source":"http://admin:*****@example.org:5984/mydatabase/", "target":"mydatabase_rep"}'
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (COUCHDB-584) Remote Replication with HTTP Auth
fails on design docs
Posted by "Christian Stocker (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12783816#action_12783816 ]
Christian Stocker commented on COUCHDB-584:
-------------------------------------------
Thanks for the prompt answer. The workaround with the header parameter seems to work.
> Remote Replication with HTTP Auth fails on design docs
> ------------------------------------------------------
>
> Key: COUCHDB-584
> URL: https://issues.apache.org/jira/browse/COUCHDB-584
> Project: CouchDB
> Issue Type: Bug
> Components: Replication
> Affects Versions: 0.10
> Reporter: Christian Stocker
> Assignee: Adam Kocoloski
>
> I try to replicate a database with design documents. It fails on it. Here's the log from the server
> [info] [<0.4462.0>] 195.226.16.50 - - 'GET' /mydatabase/_changes?style=all_docs&heartbeat=true&since=0&feed=normal 200
> [info] [<0.4463.0>] 195.226.16.50 - - 'GET' /mydatabase/_design%2Fmydesign?open_revs=["3-ce4179d8efd6132c211d95e858619051"]&revs=true&latest=true 301
> [info] [<0.4465.0>] 195.226.16.50 - - 'GET' /mydatabase/_design/mydesign?open_revs=["3-ce4179d8efd6132c211d95e858619051"]&revs=true&latest=true_design%2Fmydesign?open_revs=["3-ce4179d8efd6132c211d95e858619051"]&revs=true&latest=true 401
> Looks like the redirect doesn't send the auth parameters on the second attempt (and the URL looks fishy too, but it works from the browser with the correct auth parameters)
> I start the replication with
> curl -X POST http://127.0.0.1:5984/_replicate -d '{"source":"http://admin:*****@example.org:5984/mydatabase/", "target":"mydatabase_rep"}'
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (COUCHDB-584) Remote Replication with HTTP Auth
fails on design docs
Posted by "Paul Joseph Davis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-584?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul Joseph Davis updated COUCHDB-584:
--------------------------------------
Skill Level: Regular Contributors Level (Easy to Medium)
> Remote Replication with HTTP Auth fails on design docs
> ------------------------------------------------------
>
> Key: COUCHDB-584
> URL: https://issues.apache.org/jira/browse/COUCHDB-584
> Project: CouchDB
> Issue Type: Bug
> Components: Replication
> Affects Versions: 0.10
> Reporter: Christian Stocker
> Assignee: Adam Kocoloski
>
> I try to replicate a database with design documents. It fails on it. Here's the log from the server
> [info] [<0.4462.0>] 195.226.16.50 - - 'GET' /mydatabase/_changes?style=all_docs&heartbeat=true&since=0&feed=normal 200
> [info] [<0.4463.0>] 195.226.16.50 - - 'GET' /mydatabase/_design%2Fmydesign?open_revs=["3-ce4179d8efd6132c211d95e858619051"]&revs=true&latest=true 301
> [info] [<0.4465.0>] 195.226.16.50 - - 'GET' /mydatabase/_design/mydesign?open_revs=["3-ce4179d8efd6132c211d95e858619051"]&revs=true&latest=true_design%2Fmydesign?open_revs=["3-ce4179d8efd6132c211d95e858619051"]&revs=true&latest=true 401
> Looks like the redirect doesn't send the auth parameters on the second attempt (and the URL looks fishy too, but it works from the browser with the correct auth parameters)
> I start the replication with
> curl -X POST http://127.0.0.1:5984/_replicate -d '{"source":"http://admin:*****@example.org:5984/mydatabase/", "target":"mydatabase_rep"}'
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.