[jira] [Updated] (COUCHDB-1340) Replication: Invalid JSON reported

2011-11-17 Thread Filipe Manana (Updated) (JIRA)

 [ 
https://issues.apache.org/jira/browse/COUCHDB-1340?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Filipe Manana updated COUCHDB-1340:
---

Attachment: old_rep_qs_encoding.patch

One thing I noticed, is that couch_rep_httpc:full_url/1 is not percent encoding 
values in query string.
It should, specially for those which are JSON like ?open_revs.

RFC 3986 says so:
http://tools.ietf.org/html/rfc3986#section-2.2

This won't fix Alex's problem however. But proxies and other middleware might 
have trouble with this, it's better to follow the spec. Patch attached to 
address this.

For Alex's problem, perhaps it's just better to lower the limit from 8192 to 
something significantly lower (6000, 7000).

> Replication: Invalid JSON reported
> --
>
> Key: COUCHDB-1340
> URL: https://issues.apache.org/jira/browse/COUCHDB-1340
> Project: CouchDB
>  Issue Type: Bug
>  Components: Replication
>Affects Versions: 1.1.1
> Environment: CentOS 5.6 x86_64, Couchdb 1.1.1 (Patched for 
> COUCHDB-1333), spidermonkey 1.8.5, curl 7.21, erlang 14b03
>Reporter: Alex Markham
>  Labels: invalid, json
> Fix For: 1.2, 1.1.2
>
> Attachments: 9c94ed0e23508f4ec3d18f8949c06a5b replicaton from 
> wireshark cut.txt, old_rep_qs_encoding.patch, replication error 
> wireshark.txt, source couch error.log, target couch error.log
>
>
> It seems our replication has stopped, reporting an error
> [emulator] Error in process <0.21599.306> {{nocatch,{invalid_json,<<0 
> bytes>>}},[{couch_util,json_decode,1},{couch_rep_reader,'-open_doc_revs/3-lc$^1/1-1-',1},{couch_rep_reader,'-open_doc_revs/3-lc$^1/1-1-',1},{couch_rep_reader,open_doc_revs,3},{couch_rep_reader,'-spawn_document_request/4-fun-0-'...
>  
> It was all working until we upgraded some other couches in our replication 
> "web" from couch 1.0.3 to couch 1.1.1. We then set of database and view 
> compactions, and sometime overnight some of the replication links stopped.
> I have curled the command myself, both as a multipart message and a single 
> json response (with header "Accept:application/json" ) and it can be parsed 
> correctly by Python simplejson - I have attached it here aswell - called 
> "troublecurl-redacted.txt" - though it is 18.8mb. The request takes about 6 
> seconds.
> I don't quite understand why it is reported as invalid JSON? Other reports 
> similar to this that I googled mentioned blank document ids, but I can't see 
> any of these.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Updated] (COUCHDB-1340) Replication: Invalid JSON reported

2011-11-16 Thread Alex Markham (Updated) (JIRA)

 [ 
https://issues.apache.org/jira/browse/COUCHDB-1340?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alex Markham updated COUCHDB-1340:
--

Attachment: 9c94ed0e23508f4ec3d18f8949c06a5b replicaton from wireshark 
cut.txt

Also attached "9c94ed0e23508f4ec3d18f8949c06a5b replicaton from wireshark 
cut.txt" which looks like the last replication transfer before the mochiweb 400 
error. It is a large 19mb request, but I've snipped out the middle bit.

This request is ~3 seconds before the stack trace. Could the 2x blank lines at 
the bottom, after the json close, but before the 0 be the zero bytes to look 
for?

1
]
1


0

> Replication: Invalid JSON reported
> --
>
> Key: COUCHDB-1340
> URL: https://issues.apache.org/jira/browse/COUCHDB-1340
> Project: CouchDB
>  Issue Type: Bug
>  Components: Replication
>Affects Versions: 1.1.1
> Environment: CentOS 5.6 x86_64, Couchdb 1.1.1 (Patched for 
> COUCHDB-1333), spidermonkey 1.8.5, curl 7.21, erlang 14b03
>Reporter: Alex Markham
>  Labels: invalid, json
> Attachments: 9c94ed0e23508f4ec3d18f8949c06a5b replicaton from 
> wireshark cut.txt, replication error wireshark.txt, source couch error.log, 
> target couch error.log
>
>
> It seems our replication has stopped, reporting an error
> [emulator] Error in process <0.21599.306> {{nocatch,{invalid_json,<<0 
> bytes>>}},[{couch_util,json_decode,1},{couch_rep_reader,'-open_doc_revs/3-lc$^1/1-1-',1},{couch_rep_reader,'-open_doc_revs/3-lc$^1/1-1-',1},{couch_rep_reader,open_doc_revs,3},{couch_rep_reader,'-spawn_document_request/4-fun-0-'...
>  
> It was all working until we upgraded some other couches in our replication 
> "web" from couch 1.0.3 to couch 1.1.1. We then set of database and view 
> compactions, and sometime overnight some of the replication links stopped.
> I have curled the command myself, both as a multipart message and a single 
> json response (with header "Accept:application/json" ) and it can be parsed 
> correctly by Python simplejson - I have attached it here aswell - called 
> "troublecurl-redacted.txt" - though it is 18.8mb. The request takes about 6 
> seconds.
> I don't quite understand why it is reported as invalid JSON? Other reports 
> similar to this that I googled mentioned blank document ids, but I can't see 
> any of these.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Updated] (COUCHDB-1340) Replication: Invalid JSON reported

2011-11-16 Thread Alex Markham (Updated) (JIRA)

 [ 
https://issues.apache.org/jira/browse/COUCHDB-1340?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alex Markham updated COUCHDB-1340:
--

Attachment: replication error wireshark.txt

I did a tcp dump while the crash happened and at the time of the stack trace, 
this tcp call is the only one at that time, it seems mochiweb responds with 
this:

HTTP/1.1 400 Bad Request
Server: MochiWeb/1.0 (Any of you quaids got a smint?)
Date: Wed, 16 Nov 2011 11:20:27 GMT
Content-Length: 0

Then there is a TCP reset

But I can't see any 400 responses listed in the log of the source couch

> Replication: Invalid JSON reported
> --
>
> Key: COUCHDB-1340
> URL: https://issues.apache.org/jira/browse/COUCHDB-1340
> Project: CouchDB
>  Issue Type: Bug
>  Components: Replication
>Affects Versions: 1.1.1
> Environment: CentOS 5.6 x86_64, Couchdb 1.1.1 (Patched for 
> COUCHDB-1333), spidermonkey 1.8.5, curl 7.21, erlang 14b03
>Reporter: Alex Markham
>  Labels: invalid, json
> Attachments: replication error wireshark.txt, source couch error.log, 
> target couch error.log
>
>
> It seems our replication has stopped, reporting an error
> [emulator] Error in process <0.21599.306> {{nocatch,{invalid_json,<<0 
> bytes>>}},[{couch_util,json_decode,1},{couch_rep_reader,'-open_doc_revs/3-lc$^1/1-1-',1},{couch_rep_reader,'-open_doc_revs/3-lc$^1/1-1-',1},{couch_rep_reader,open_doc_revs,3},{couch_rep_reader,'-spawn_document_request/4-fun-0-'...
>  
> It was all working until we upgraded some other couches in our replication 
> "web" from couch 1.0.3 to couch 1.1.1. We then set of database and view 
> compactions, and sometime overnight some of the replication links stopped.
> I have curled the command myself, both as a multipart message and a single 
> json response (with header "Accept:application/json" ) and it can be parsed 
> correctly by Python simplejson - I have attached it here aswell - called 
> "troublecurl-redacted.txt" - though it is 18.8mb. The request takes about 6 
> seconds.
> I don't quite understand why it is reported as invalid JSON? Other reports 
> similar to this that I googled mentioned blank document ids, but I can't see 
> any of these.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Updated] (COUCHDB-1340) Replication: Invalid JSON reported

2011-11-15 Thread Alex Markham (Updated) (JIRA)

 [ 
https://issues.apache.org/jira/browse/COUCHDB-1340?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alex Markham updated COUCHDB-1340:
--

Attachment: source couch error.log
target couch error.log

> Replication: Invalid JSON reported
> --
>
> Key: COUCHDB-1340
> URL: https://issues.apache.org/jira/browse/COUCHDB-1340
> Project: CouchDB
>  Issue Type: Bug
>  Components: Replication
>Affects Versions: 1.1.1
> Environment: CentOS 5.6 x86_64, Couchdb 1.1.1 (Patched for 
> COUCHDB-1333), spidermonkey 1.8.5, curl 7.21, erlang 14b03
>Reporter: Alex Markham
>  Labels: invalid, json
> Attachments: source couch error.log, target couch error.log
>
>
> It seems our replication has stopped, reporting an error
> [emulator] Error in process <0.21599.306> {{nocatch,{invalid_json,<<0 
> bytes>>}},[{couch_util,json_decode,1},{couch_rep_reader,'-open_doc_revs/3-lc$^1/1-1-',1},{couch_rep_reader,'-open_doc_revs/3-lc$^1/1-1-',1},{couch_rep_reader,open_doc_revs,3},{couch_rep_reader,'-spawn_document_request/4-fun-0-'...
>  
> It was all working until we upgraded some other couches in our replication 
> "web" from couch 1.0.3 to couch 1.1.1. We then set of database and view 
> compactions, and sometime overnight some of the replication links stopped.
> I have curled the command myself, both as a multipart message and a single 
> json response (with header "Accept:application/json" ) and it can be parsed 
> correctly by Python simplejson - I have attached it here aswell - called 
> "troublecurl-redacted.txt" - though it is 18.8mb. The request takes about 6 
> seconds.
> I don't quite understand why it is reported as invalid JSON? Other reports 
> similar to this that I googled mentioned blank document ids, but I can't see 
> any of these.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira