couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Marca <jma...@translab.its.uci.edu>
Subject Re: Couchdb replication issue (badmatch)
Date Wed, 02 Oct 2013 16:53:39 GMT
On Mon, Sep 30, 2013 at 10:08:41AM +0200, Pieter van der Eems wrote:
>  Two couchdb 1.3.0 servers linked via an ssh tunnel.
> 
> Server A (the big server).
> Couchdb 1.3.0 Ubuntu 11.10
> 
> Server B (the server behind firewalls)
> Couchdb 1.3.0 Ubuntu 12.10
> 
> Database named "repme" on Server B, 52 documents of which 8 are design
> documents.
> Futon reports the size as being 200.7MB.
> 
> Server B is located at a clients datacenter. There are firewalls and
> security systems in place. We don't know how the security is
> configured. We have ssh access to server B via an external ip address.
> 
> What I did (all on server A):
>  * Create an ssh tunnel (/usr/bin/ssh -f -N -L 5555:<server B
> ipv4-addr>:5984 <user>@<server B ipv4 external ipv4-addr>
>  * Create an empty "repme" database on sever A
>  * Create a replication document in _replicator on server A.
> 
> replication document:
> {
>    "_id": "pull_repme",
>    "_rev": "26-a2ac9b567db0fc33e083475f0a4e260b",
>    "source": "http://localhost:5555/repme",
>    "target": "http://admin:********@server A:5984/repme",
>    "continuous": true,
>    "owner": "admin",
>    "_replication_state": "triggered",
>    "_replication_state_time": "2013-09-30T09:09:41+02:00",
>    "_replication_id": "5d32dd7db36baeacf01b3098ff4570ef"
> }
> 

This probably isn't relevant to your problem, but...  the way you are
creating replication docs is different from how I do it.
Specifically, your target has an http address, whereas I usually just
have the actual database on the local machine, and you don't have a
user context.  What I have is something like:

...
   "target": "repme"
   "create_target": true,
   "continuous": true,
   "user_ctx": {
       "name": "james",
       "roles": [
           "_admin"
       ]
   },
...

I never *type* in the owner field, I find couchdb will fill that in
for me, along with the _replication_state, etc fields.

As to the error statement, whenever I get "badmatch" type errors, it
often means there is a library mismatch, for example when I upgraded
my laptop with a whole raft of patches recently, CouchDB stopped
working right and I had to recompile it.  That said, you appear to be
using the Ubuntu standard package, so those packages are usually
maintained properly and you shouldn't run into those problems.  

One other idea, perhaps there is an old install of couch hiding out
on your system causing conflicts somehow.  I recall at some point
there were issues with Ubuntu shipping with one version of CouchDB
that was difficult to upgrade.

Regards,

James Marca


> 
> This was done on friday.
> On monday the database on server A had only 10 documents.
> I removed the replication document. Then I created a new replication
> document with the exact same content (without _rev, and _replcation*
> fields). Within a few seconds I saw the database on server A now had
> 45 documents and futon reports it's size as 255.3Mb. Then no more
> activity as far as I can see.
> 
> In the couch.log file on server A I see this cryptic error twice (only
> difference is in process id):
> [Mon, 30 Sep 2013 07:09:41 GMT] [error] [emulator] Error in process
> <0.10141.295> with exit value:
> {{badmatch,{[137,80,78,71],[]}},[{couch_httpd,split_header,1,[{file,"/opt/couchdb_browserid/dependencies/couchdb/src/couchdb/couch_httpd.erl"},{line,998}]},{couch_httpd,'-parse_part_header/1-fun-1-',2,[{file,"/opt/couchdb_brows...
> 
> I don't know what that error means or why the replication is not working.
> 
> 
> Searching with google on the error I saw this conversation on the
> couchdb user mailinglist:
> http://mail-archives.apache.org/mod_mbox/couchdb-user/201301.mbox/%3CCABvT1DFD5tqAmGjUBvZAvpXgg1_5bDaUnn5JFGCg3CMQyEV9Tg@mail.gmail.com%3E
> 
> In it Robert Newson refers to "the mime preamble thing".
> I cannot find anything with "mime preamble" so I don't know what is
> meant there and neither if it related to my problem.
> 
> I hope anyone can help.
> 
> 
> Regards
> Pieter van der Eems


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


Mime
View raw message