incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sgoto <samuelg...@gmail.com>
Subject r.e.p.l.i.c.a.t.i.o.n through proxy problems
Date Fri, 08 Oct 2010 00:54:36 GMT
hey everyone,

     i'm stuck at a r.e.p.l.i.c.a.t.i.o.n problem and i thought i should ask
before debugging more.

     context: i have a couchdb instance that i would like to put behind a
proxy. the couchdb instance runs on the default port :5984 and i have a
Jetty proxy on front of it on another port 9093. My servlet container
proxies all requests coming from http://localhost:9093/replicate/* to
http://localhost:5984/*. Hitting http://localhost:9093/replicate responds to
most commands but i'm having problems replicating dbs with the proxy.

     problem: i have to trigger a r.e.p.l.i.c.a.t.i.o.n between a local db
and a db that is proxied. i use this:

goto@goto-laptop:~/Workspace/couchdb/kumbaya$ curl -X POST --header
"Content-Type: application/json" -d
'{"source":"test","target":"http://admin:mypassword@localhost:9093/replicate/test2","continuous":true}'
 http://localhost:5984/_replicate

     where test is my local db and test2 is a db on the same couchdb
instance but proxied. couchdb kindly replies:

*{"ok":true,"_local_id":"900f0e46186175a5a31314ea5ad24857"}*

     however, r.e.p.l.i.c.a.t.i.o.n doesn't really work (saving docs in one
db doesn't replicate to the other).

     after replication starts, my proxy keeps getting these requests (which
are forwarded to the couchdb instance) ...

POST /replicate/test2/_missing_revs HTTP/1.1
Accept-Encoding: gzip
Accept: application/json
User-Agent: CouchDB/1.0.1
Authorization: Basic YWRtaW46bXlwYXNzd29yZA==
Host: localhost:9093
Content-Length: 75

    ...  which the couchdb instance fails to respond as you can see at the
ends of this log  ...

[Thu, 07 Oct 2010 07:22:34 GMT] [debug] [<0.447.0>] 'POST'
/test2/_missing_revs {1,1}
Headers: [{'Accept',"application/json"},
          {'Accept-Encoding',"gzip"},
          {'Authorization',"Basic YWRtaW46bXlwYXNzd29yZA=="},
          {'Connection',"keep-alive"},
          {'Content-Length',"75"},
          {'Host',"localhost:9093"},
          {'User-Agent',"CouchDB/1.0.1"},
          {'Via',"1.1 (jetty)"},
          {'X-Forwarded-For',"127.0.0.1"}]

[Thu, 07 Oct 2010 07:22:34 GMT] [debug] [<0.447.0>] OAuth Params: []

    this is the full log from the couchdb instance's perspective. it all
starts with a /_r.e.p.l.i.c.a.t.e and it gets stuck at a sending
/test2/_missing_revs requests.

[Thu, 07 Oct 2010 07:18:47 GMT] [debug] [<0.219.0>] 'POST' /_replicate {1,1}
Headers: [{'Accept',"*/*"},
          {'Content-Length',"101"},
          {'Content-Type',"application/json"},
          {'Host',"localhost:5984"},
          {'User-Agent',"curl/7.19.7 (x86_64-pc-linux-gnu) libcurl/7.19.7
OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15"}]

[Thu, 07 Oct 2010 07:18:47 GMT] [debug] [<0.219.0>] OAuth Params: []

[Thu, 07 Oct 2010 07:18:59 GMT] [debug] [<0.229.0>] 'HEAD' /test2/ {1,1}
Headers: [{'Accept',"application/json"},
          {'Accept-Encoding',"gzip"},
          {'Authorization',"Basic YWRtaW46bXlwYXNzd29yZA=="},
          {'Connection',"keep-alive"},
          {'Host',"localhost:9093"},
          {'User-Agent',"CouchDB/1.0.1"},
          {'Via',"1.1 (jetty)"},
          {'X-Forwarded-For',"127.0.0.1"}]

[Thu, 07 Oct 2010 07:18:59 GMT] [debug] [<0.229.0>] OAuth Params: []

[Thu, 07 Oct 2010 07:18:59 GMT] [info] [<0.229.0>] 127.0.0.1 - - 'HEAD'
/test2/ 200

[Thu, 07 Oct 2010 07:18:59 GMT] [debug] [<0.229.0>] 'GET' /test2/ {1,1}
Headers: [{'Accept',"application/json"},
          {'Accept-Encoding',"gzip"},
          {'Authorization',"Basic YWRtaW46bXlwYXNzd29yZA=="},
          {'Connection',"keep-alive"},
          {'Host',"localhost:9093"},
          {'User-Agent',"CouchDB/1.0.1"},
          {'Via',"1.1 (jetty)"},
          {'X-Forwarded-For',"127.0.0.1"}]

[Thu, 07 Oct 2010 07:18:59 GMT] [debug] [<0.229.0>] OAuth Params: []

[Thu, 07 Oct 2010 07:18:59 GMT] [info] [<0.229.0>] 127.0.0.1 - - 'GET'
/test2/ 200

[Thu, 07 Oct 2010 07:18:59 GMT] [debug] [<0.230.0>] didn't find a
r.e.p.l.i.c.a.t.i.o.n log for test

[Thu, 07 Oct 2010 07:18:59 GMT] [debug] [<0.229.0>] 'GET'
/test2/_local%2F900f0e46186175a5a31314ea5ad24857 {1,1}
Headers: [{'Accept',"application/json"},
          {'Accept-Encoding',"gzip"},
          {'Authorization',"Basic YWRtaW46bXlwYXNzd29yZA=="},
          {'Connection',"keep-alive"},
          {'Host',"localhost:9093"},
          {'User-Agent',"CouchDB/1.0.1"},
          {'Via',"1.1 (jetty)"},
          {'X-Forwarded-For',"127.0.0.1"}]

[Thu, 07 Oct 2010 07:18:59 GMT] [debug] [<0.229.0>] OAuth Params: []

[Thu, 07 Oct 2010 07:18:59 GMT] [debug] [<0.229.0>] Minor error in HTTP
request: {not_found,missing}

[Thu, 07 Oct 2010 07:18:59 GMT] [debug] [<0.229.0>] Stacktrace:
[{couch_httpd_db,couch_doc_open,4},
             {couch_httpd_db,db_doc_req,3},
             {couch_httpd_db,do_db_req,2},
             {couch_httpd,handle_request_int,5},
             {mochiweb_http,headers,5},
             {proc_lib,init_p_do_apply,3}]

[Thu, 07 Oct 2010 07:18:59 GMT] [info] [<0.229.0>] 127.0.0.1 - - 'GET'
/test2/_local%2F900f0e46186175a5a31314ea5ad24857 404

[Thu, 07 Oct 2010 07:18:59 GMT] [debug] [<0.229.0>] httpd 404 error
response:
 {"error":"not_found","reason":"missing"}


[Thu, 07 Oct 2010 07:18:59 GMT] [debug] [<0.230.0>] didn't find a
r.e.p.l.i.c.a..t.i.o.n log for http://admin:mypassword@localhost
:9093/replicate/test2/

[Thu, 07 Oct 2010 07:18:59 GMT] [info] [<0.219.0>] starting new replication
"900f0e46186175a5a31314ea5ad24857+continuous" at <0.230.0>

[Thu, 07 Oct 2010 07:18:59 GMT] [info] [<0.219.0>] 127.0.0.1 - - 'POST'
/_replicate 202

    ideas ?

    sam


-- 
f u cn rd ths u cn b a gd prgmr !

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message