added a comment - - edited
Looks to me root cause is couchdb/src/couchdb/couch_httpd:unquote() is unable to parse the "Host" from token if the password contains '@'
Suppose we have a cluster with admin passord "asdas@",
In xdc_rep_utils:get_master_db(), the input url is
"
http://Administrator:asdas%40@127.0.0.1:9501/default%2f0%3b6f2220d6e34f4a4c4de0697a3f9821dc/"
which is correct since it translate '@' to '%40' in the URL
However, after couch_httpd:unquote(Token) parse the token
[Scheme, Host, DbName0] = [couch_httpd:unquote(Token) || Token <- string:tokens(DbUrl0, "/")],
The username:password in Host becomes "Administrator:asdas@@127.0.0.1:9501", which fails all subsequent HTTP request to remote cluster.
[xdcr:debug,2013-03-08T16:31:31.532,
n_0@127.0.0.1:<0.1236.0>:xdc_rep_utils:get_master_db:288]xdcr-junyi: scheme: "http:", host: "Administrator:asdas@@127.0.0.1:9501", DbName0: "default/0;6f2220d6e34f4a4c4de0697a3f9821dc"
Hand over to couchdb guys to look at it further.
Hi Chris,
I am not sure who owns couch_httpd module, please assign to right person if necessary. Thanks!
<Phibs> so replication definitely fails when the password has special chars such as @ in it
<Phibs> you guys need to escape/encode that stuff
<Phibs> http://www.bsd-unix.net/seitz/jing/2013-03-08_1406.png
<scalabl3> i was just clarifying that you saw that bug appear again in the right place, meaning it was XDCR, not just "in-cluster" replica's
<Phibs> it was under 'create replication'
<Phibs> the last 10 errors button showed up under 'status'
<Phibs> vs 'replicating'
<Phibs> and it had my password listed (minus the @) as ["Firstpart","Secondpart"] and failures
he solved it by changing his password...