I have good news and bad news.

The Good News: I successfully upgraded to 1.0.2. All of my JavaScript code still appears to work.

The Bad News: Pull replication from a remote machine to the local machine still fails on the design document -- maybe. Here is a transcript of the new session

############
C:\MyStuff\MyCodeProjects\CouchReplication>type drugbase-from-gani-to-here
{
  "target" : "http://testonly:deleteme@bcbwfl6sjn1:5984/drugbase";,
  "source" : "http://10.105.43.35:5984/drugbase";,
  "user_ctx": {
     "name": "testonly",
     "roles": ["_admin"]
  }
}
C:\MyStuff\MyCodeProjects\CouchReplication>curl
 -H "Content-Type: application/json" -X POST -d @drugbase-from-gani-to-here
 http://testonly:deleteme@bcbwfl6sjn1:5984/_replicate
{"error":"json_encode","reason":"{bad_term,{couch_doc,fold_streamed_data,\n
                [#Fun<couch_rep_att.0.90652905>,-1140,\n
#Fun<couch_doc.13.28980337>,ok]}}"}
############

And here is the relevant portion of the error log:

############
[Tue, 03 Jan 2012 19:43:43 GMT] [error] [<0.619.0>] streaming att. ended but 
more data requested {1325,619823,339311}

[Tue, 03 Jan 2012 19:43:43 GMT] [info] [<0.619.0>] request for 
"_design%2Fbasic/docs.html" timed out, retrying in 0.5 seconds

[Tue, 03 Jan 2012 19:43:43 GMT] [info] [<0.621.0>] 10.105.35.136 - - 'POST' 
/drugbase/_ensure_full_commit 201

[Tue, 03 Jan 2012 19:43:43 GMT] [info] [<0.572.0>] recording a checkpoint for 
http://10.105.43.35:5984/drugbase/ ->  
http://testonly:*****@bcbwfl6sjn1:5984/drugbase/ at source update_seq 16479

[Tue, 03 Jan 2012 19:43:43 GMT] [info] [<0.649.0>] 10.105.35.136 - - 'PUT' 
/drugbase/_local%2Fa4413563817bd705ab727a8ab1643a28 201

[Tue, 03 Jan 2012 19:43:43 GMT] [error] [emulator] Error in process<0.619.0>  with exit 
value: 
{function_clause,[{couch_doc,fold_streamed_data,[#Fun<couch_rep_att.0.90652905>,-1140,#Fun<couch_doc.13.28980337>,ok]},{couch_doc,atts_to_mp,4},{couch_rep_writer,streamer_fun,3}]}
############

I will note that the error log has one more entry that intervenes, namely the 'PUT' to the /_local database. I do't know how relevant that is.

Thanks again.
    Kevin

On 1/3/2012 12:22 PM, Dave Cottlehuber wrote:
On 3 January 2012 18:45, Kevin R. Coombes<[email protected]>  wrote:
Thanks for all the advice.  I haven't upgraded yet; instead, inspired by the
claim that "it works for me", I decided to poke around some more into the
replication issue. I'm now going to report that replication of design docs
*sometimes* fails on version 1.0.1, which is probably the worse kind of bug
to report....

First, here is a transcript of the (64-bit Windows 7) cmd window:

#############
C:\MyStuff\MyCodeProjects\CouchReplication>curl
http://bcbwfl6sjn1:5984/testrepl/_all_docs
{"total_rows":2,"offset":0,"rows":[
{"id":"43567c4d142e9d03f6e966a50400089b","key":"43567c4d142e9d03f6e966a50400089b",
"value":{"rev":"1-711a20fc5975380c99726b4da845d277"}},
{"id":"_design/basic","key":"_design/basic","value":{"rev":
"1-dddcf8b46c73b0102f86047765ab9284"}}
]}

C:\MyStuff\MyCodeProjects\CouchReplication>curl
http://bcbwfl6sjn1:5984/reptarget/_all_docs
{"total_rows":0,"offset":0,"rows":[]}

C:\MyStuff\MyCodeProjects\CouchReplication>type testrepl.json
{
  "target" : "http://testonly:deleteme@bcbwfl6sjn1:5984/reptarget";,
  "source" : "http://bcbwfl6sjn1:5984/testrepl";,
  "user_ctx": {
     "name": "testonly",
     "roles": ["_admin"]
  }
}

C:\MyStuff\MyCodeProjects\CouchReplication>curl
  -H "Content-Type: application/json" -X POST -d @testrepl.json
  http://testonly:deleteme@bcbwfl6sjn1:5984/_replicate
{"ok":true,"session_id":"d432de689e42bf1a983b8640b6835794","source_last_seq":2,
"history":[{"session_id":"d432de689e42bf1a983b8640b6835794","start_time":
"Tue, 03 Jan 2012 17:22:52 GMT","end_time":"Tue, 03 Jan 2012 17:22:52 GMT",
"start_last_seq":0,"end_last_seq":2,"recorded_seq":2,"missing_checked":0,
"missing_found":2,"docs_read":2,"docs_written":2,"doc_write_failures":0}]}

C:\MyStuff\MyCodeProjects\CouchReplication>type drugbase-from-gani-to-here
{
  "target" : "http://testonly:deleteme@bcbwfl6sjn1:5984/drugbase";,
  "source" : "http://10.105.43.35:5984/drugbase";,
  "user_ctx": {
     "name": "testonly",
     "roles": ["_admin"]
  }
}

C:\MyStuff\MyCodeProjects\CouchReplication>curl
  -H "Content-Type: application/json" -X POST -d @drugbase-from-gani-to-here
  http://testonly:deleteme@bcbwfl6sjn1:5984/_replicate
{"error":"json_encode","reason":"{bad_term,{couch_doc,fold_streamed_data,\n
                [#Fun<couch_rep_att.0.90652905>,-1140,\n
#Fun<couch_doc.13.28980337>,ok]}}"}
#############

Note that the first replication attempt (which works) goes from one database
to another on the same machine. This attempt uses a small test database that
has the usual sorts of design document attachments for a CouchApp along with
only one ordinary document.

The second attempt is a pull replication from a remote machine to the local
machine.  This has the same kind of CouchApp design documents, and has about
16000 ordinary documents. All 16000+ ordinary documents get replicated
without a problem.  Only yte design document fails.  Here is the start of
the error message from the log file,to confirm that it is (an attachment to)
the design document that fails:

#############
[Tue, 03 Jan 2012 17:25:25 GMT] [error] [<0.650.0>] streaming att. ended but
more data requested {1325,611525,197841}

[Tue, 03 Jan 2012 17:25:25 GMT] [info] [<0.650.0>] request for
"_design%2Fbasic/docs.html" timed out, retrying in 0.5 seconds

[Tue, 03 Jan 2012 17:25:25 GMT] [error] [<0.650.0>] streaming att. ended but
more data requested {1325,611525,712841}

[Tue, 03 Jan 2012 17:25:25 GMT] [info] [<0.650.0>] request for
"_design%2Fbasic/docs.html" timed out, retrying in 0.5 seconds

[Tue, 03 Jan 2012 17:25:26 GMT] [error] [emulator] Error in process
<0.650.0>  with exit value:
{function_clause,[{couch_doc,fold_streamed_data,[#Fun<couch_rep_att.0.90652905>,-1140,#Fun<couch_doc.13.28980337>,ok]},{couch_doc,atts_to_mp,4},{couch_rep_writer,streamer_fun,3}]}
#############

Any suggestions? (I am open to the suggestion that "upgrading to Version X
will solve the problem" for a specific value of X....)

Thanks,
    Kevin

Hi Kevin,

Thanks, those logs helped a lot. There are a number of fixes that
could be related;

https://issues.apache.org/jira/browse/COUCHDB-868 and
https://issues.apache.org/jira/browse/COUCHDB-1021 which if I read my
repo history right, are both in 1.0.2.

I suggest you try that first which might avoid you needing to update
your JS stuff, and keep us posted.

A+
Dave

Reply via email to