From user-return-13097-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Fri Oct 08 00:55:05 2010 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 44460 invoked from network); 8 Oct 2010 00:55:04 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 8 Oct 2010 00:55:04 -0000 Received: (qmail 73583 invoked by uid 500); 8 Oct 2010 00:55:03 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 73551 invoked by uid 500); 8 Oct 2010 00:55:03 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 73541 invoked by uid 99); 8 Oct 2010 00:55:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Oct 2010 00:55:03 +0000 X-ASF-Spam-Status: No, hits=3.8 required=10.0 tests=FREEMAIL_FROM,GAPPY_SUBJECT,HTML_FONT_FACE_BAD,HTML_MESSAGE,NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of samuelgoto@gmail.com designates 209.85.216.52 as permitted sender) Received: from [209.85.216.52] (HELO mail-qw0-f52.google.com) (209.85.216.52) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Oct 2010 00:54:57 +0000 Received: by qwd7 with SMTP id 7so271492qwd.11 for ; Thu, 07 Oct 2010 17:54:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=tt0T5UpdCn0xubQIKzyXsLV/cWpg0s/gRigaGru36Hk=; b=DYJwB6nuTe2BJABrfpa8u0xLK23S18m4qq0YGBUDAa9tLG8Ka12BR00YRk9YGqqszt tH9t5BKSK06/xCD1mb8aqqWxWelORvbU60FooJYw2BoRPlQ6bDTTvVr7cnI9MUw9wzqX Dncl33v7AJW18p03V6Hg07ZSkWwhCAqy+M3/o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=ZBRnz9hHaWGorBUYSOdSdhNy1FDYQsp9qHchl6dd1qhHeZoRtaDxkyGVYG8TiP6Of0 8kS16hwlnMZXA3Apnag0+8PpWIRfrjt9MnkIxP+uyL9hOuiyPsMqysGWrADjhXamramX s4Zuc+Jsr8oyxxh9pxdBsKNv/FfguGbYfLgeI= MIME-Version: 1.0 Received: by 10.224.214.197 with SMTP id hb5mr947808qab.30.1286499276441; Thu, 07 Oct 2010 17:54:36 -0700 (PDT) Received: by 10.229.93.14 with HTTP; Thu, 7 Oct 2010 17:54:36 -0700 (PDT) Date: Thu, 7 Oct 2010 17:54:36 -0700 Message-ID: Subject: r.e.p.l.i.c.a.t.i.o.n through proxy problems From: sgoto To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=20cf300fb29f60475504921074b8 --20cf300fb29f60475504921074b8 Content-Type: text/plain; charset=ISO-8859-1 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 ! --20cf300fb29f60475504921074b8--