From user-return-19206-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Fri Dec 23 18:59:02 2011 Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AE96973C0 for ; Fri, 23 Dec 2011 18:59:02 +0000 (UTC) Received: (qmail 68714 invoked by uid 500); 23 Dec 2011 18:59:00 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 68674 invoked by uid 500); 23 Dec 2011 18:59:00 -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 68666 invoked by uid 99); 23 Dec 2011 18:59:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Dec 2011 18:59:00 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of fdmanana@gmail.com designates 209.85.210.52 as permitted sender) Received: from [209.85.210.52] (HELO mail-pz0-f52.google.com) (209.85.210.52) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Dec 2011 18:58:56 +0000 Received: by dadp15 with SMTP id p15so9428614dad.11 for ; Fri, 23 Dec 2011 10:58:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=egId9vV3i92RzxdYmoffrhBl8vub0yKu48Mg/KVo1AY=; b=CWB2kJBfuM/VG7SnU1RvuYqH1JoDR7MkVEOf+sWnvTDYAmHM9kK1Krp4ZReGBQIRSw RvPOztvWSV4UiXGdYpu4VBGMPOYgGSOtwVl29UAVuUs4BhkTAd4NkuL3Dxc9oKJ86J9e RmPvbwiFF4ZV9jHKiNpQQLersR/aQeWLsfxVk= MIME-Version: 1.0 Received: by 10.68.74.4 with SMTP id p4mr32892679pbv.123.1324666715944; Fri, 23 Dec 2011 10:58:35 -0800 (PST) Sender: fdmanana@gmail.com Received: by 10.143.92.19 with HTTP; Fri, 23 Dec 2011 10:58:35 -0800 (PST) In-Reply-To: <4B1E8576-B614-4783-B600-99385444A023@osndok.com> References: <92084595-AF07-4F3F-B047-28B218C24B7A@osndok.com> <4B1E8576-B614-4783-B600-99385444A023@osndok.com> Date: Fri, 23 Dec 2011 18:58:35 +0000 X-Google-Sender-Auth: Skg3h8N4qeYnMRAFSpnfErlFmmU Message-ID: Subject: Re: Failure on source commit: {error,undefined} From: Filipe David Manana To: "user@couchdb.apache.org" Content-Type: multipart/alternative; boundary=f46d0413911d0cb6e304b4c70196 --f46d0413911d0cb6e304b4c70196 Content-Type: text/plain; charset=UTF-8 On Friday, December 23, 2011, Robert Hailey wrote: > > On 2011/12/21 (Dec), at 3:52 PM, Marty Schoch wrote: > >> Hi Robert, > > Hey Marty, thanks for you reply. > >> If your issue only affects Couchbase Mobile, you may get better >> support discussing the issues here: >> >> https://groups.google.com/forum/#!forum/mobile-couchbase > > I've isolated it to couchdb, and am positive it will (or would have) effected future releases too; the complicating factor is that couchbase uses pre-release versions of couchdb. > >> 2. If you access the root URL of the Couchbase Mobile you should see >> a response like: >> >> { >> "couchdb": "Welcome", >> "version": "1.2.0a-7b47329-git" >> } > > I tried doing this, but I think couchbase is substituting it's own version number here; with ios I get: > > { > "couchdb":"Welcome", > "version":"2.0.0-beta" > } > > Which to me is non-sensical, because there are no tags resembling "2.0.0" in couchdb, and not very helpful (because there is no hash like in your example)... > >> 3. Couchbase Mobile is completely open source. The binaries we ship >> are built from the source on github. Some of the confusion may be >> that Couchbase Mobile includes more than just CouchDB. > > I think that is much of the confusion, along with unfamiliarity with the build system in use. > >> 4. At the moment I'm not aware of any other implementations. > > I've found some references to others doing what I am: > > http://stackoverflow.com/questions/8309521/using-couchdb-pull-replication-from-a-read-only-server > http://mail-archives.apache.org/mod_mbox/couchdb-user/201106.mbox/%3C4DFFB8BD.2010508%40gmail.com%3E > http://thanksmister.com/2009/03/28/http-status-201-causing-flex-2032-error-in-ie-only/ > > And.... after several hours of reading erlang how-tos & trying to "decode" two functions, I found my error. > > In: > > src/couch_replicator/src/couch_replicator_api_wrap.erl (about line 126) > > ensure_full_commit(#httpdb{} = Db) -> > send_req( > Db, > [{method, post}, {path, "_ensure_full_commit"}, > {headers, [{"Content-Type", "application/json"}]}], > fun(201, _, {Props}) -> > {ok, get_value(<<"instance_start_time">>, Props)}; > (_, _, {Props}) -> > {error, get_value(<<"error">>, Props)} > end); > > I found that the couchdb source expects a 201 http status, whereas the docs I was following indicate a 200 status: > > http://www.couchbase.org/sites/default/files/uploads/all/documentation/couchbase-api-db.html#couchbase-api-db_db-ensure-full-commit_post The documentation is wrong, the success response code is 201 for _ensure_full_commit > > So (if I understand the symptom of the "terrible error message") the 'undefined' was coming from a helper-function trying to extract a non-existant error message (because it was successful, but did not match the 201 code). > > I'm not sure what (if any) change needs to occur, but "undefined" is a poor error message IMO. :) Normally error responses have a json top level property named "error". I don't recall seeing many for _ensure_full_commit. If it's easy for you to reproduce it, can you tell what the server is sending by using a sniffer? Thanks > > -- > Robert Hailey > > -- Filipe David Manana, "Reasonable men adapt themselves to the world. Unreasonable men adapt the world to themselves. That's why all progress depends on unreasonable men." --f46d0413911d0cb6e304b4c70196--