You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Martin Castellanos (Created) (JIRA)" <ji...@apache.org> on 2011/10/22 18:17:32 UTC

[jira] [Created] (COUCHDB-1315) Remote pull replication with filter and params fails with reason: invalid UTF-8 JSON

Remote pull replication with filter and params fails with reason: invalid UTF-8 JSON
------------------------------------------------------------------------------------

                 Key: COUCHDB-1315
                 URL: https://issues.apache.org/jira/browse/COUCHDB-1315
             Project: CouchDB
          Issue Type: Bug
          Components: Replication
    Affects Versions: 1.1
         Environment: - Windows 7 x64 on target machine
- Windows 7 x32 on source machine

            Reporter: Martin Castellanos


I'm posting the following to: http://localhost:5984/_replicate
    {"source":"http://MARTIN-LT:5984/pdlib","target":"pdlib", "filter":"replication/SINGLE_COLLECTION", "query_params": {"key":"ffedddf1-da9e-47a8-b41c-2ac8e48bf7a8"}}


This is the output from the remote machine log:

[Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] 'GET' /pdlib/_changes?key=bb579347-9bfb-4dda-84eb-622b43108872&filter=replication/SINGLE_COLLECTION&style=all_docs&heartbeat=10000&since=0&feed=normal {1,
                                                                                                                                                        1}
Headers: [{'Accept',"application/json"},
          {'Content-Length',"0"},
          {'Host',"MARTIN-NEWPC:5984"},
          {'User-Agent',"CouchDB/1.0.2"}]

[Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] OAuth Params: [{"key","bb579347-9bfb-4dda-84eb-622b43108872"},
               {"filter","replication/SINGLE_COLLECTION"},
               {"style","all_docs"},
               {"heartbeat","10000"},
               {"since","0"},
               {"feed","normal"}]

[Mon, 17 Oct 2011 01:20:48 GMT] [info] [<0.476.0>] 192.168.2.3 - - 'GET' /pdlib/_changes?key=bb579347-9bfb-4dda-84eb-622b43108872&filter=replication/SINGLE_COLLECTION&style=all_docs&heartbeat=10000&since=0&feed=normal 200

[Mon, 17 Oct 2011 01:20:48 GMT] [error] [<0.476.0>] attempted upload of invalid JSON (set log_level to debug to log it)

[Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] Invalid JSON: <<"bb579347-9bfb-4dda-84eb-622b43108872">>

[Mon, 17 Oct 2011 01:20:48 GMT] [info] [<0.476.0>] 192.168.2.3 - - 'GET' /pdlib/_changes?key=bb579347-9bfb-4dda-84eb-622b43108872&filter=replication/SINGLE_COLLECTION&style=all_docs&heartbeat=10000&since=0&feed=normal 400

[Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] httpd 400 error response:
 {"error":"bad_request","reason":"invalid UTF-8 JSON"}



This only happens on a pull replication, if I switch source and target values it works correctly.

--
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] [Commented] (COUCHDB-1315) Remote pull replication with filter and params fails with reason: invalid UTF-8 JSON

Posted by "Martin Castellanos (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-1315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13133570#comment-13133570 ] 

Martin Castellanos commented on COUCHDB-1315:
---------------------------------------------

This is the contents of the manifest.txt file:
couchdb_couchbase_1.1.2-MINGW32_NT-6.0.i686.tar.gz
geocouch_couchbase_1.1.2_geo.tar.gz
pthreads-w64-2-8-0-release.tar.gz
wallace_1.1.2-MINGW32_NT-6.0.i686-201107262109

These are the logs:
Local machine: http://dl.dropbox.com/u/2684383/local.couch.log
Remote machine: http://dl.dropbox.com/u/2684383/remote.couch.log

                
> Remote pull replication with filter and params fails with reason: invalid UTF-8 JSON
> ------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-1315
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1315
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Replication
>    Affects Versions: 1.1
>         Environment: - Windows 7 x64 on target machine
> - Windows 7 x32 on source machine
>            Reporter: Martin Castellanos
>              Labels: pull, replication
>
> I'm posting the following to: http://localhost:5984/_replicate
>     {"source":"http://MARTIN-LT:5984/pdlib","target":"pdlib", "filter":"replication/SINGLE_COLLECTION", "query_params": {"key":"bb579347-9bfb-4dda-84eb-622b43108872"}}
> This is the output from the remote machine log:
> [Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] 'GET' /pdlib/_changes?key=bb579347-9bfb-4dda-84eb-622b43108872&filter=replication/SINGLE_COLLECTION&style=all_docs&heartbeat=10000&since=0&feed=normal {1,
>                                                                                                                                                         1}
> Headers: [{'Accept',"application/json"},
>           {'Content-Length',"0"},
>           {'Host',"MARTIN-NEWPC:5984"},
>           {'User-Agent',"CouchDB/1.0.2"}]
> [Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] OAuth Params: [{"key","bb579347-9bfb-4dda-84eb-622b43108872"},
>                {"filter","replication/SINGLE_COLLECTION"},
>                {"style","all_docs"},
>                {"heartbeat","10000"},
>                {"since","0"},
>                {"feed","normal"}]
> [Mon, 17 Oct 2011 01:20:48 GMT] [info] [<0.476.0>] 192.168.2.3 - - 'GET' /pdlib/_changes?key=bb579347-9bfb-4dda-84eb-622b43108872&filter=replication/SINGLE_COLLECTION&style=all_docs&heartbeat=10000&since=0&feed=normal 200
> [Mon, 17 Oct 2011 01:20:48 GMT] [error] [<0.476.0>] attempted upload of invalid JSON (set log_level to debug to log it)
> [Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] Invalid JSON: <<"bb579347-9bfb-4dda-84eb-622b43108872">>
> [Mon, 17 Oct 2011 01:20:48 GMT] [info] [<0.476.0>] 192.168.2.3 - - 'GET' /pdlib/_changes?key=bb579347-9bfb-4dda-84eb-622b43108872&filter=replication/SINGLE_COLLECTION&style=all_docs&heartbeat=10000&since=0&feed=normal 400
> [Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] httpd 400 error response:
>  {"error":"bad_request","reason":"invalid UTF-8 JSON"}
> This only happens on a pull replication, if I switch source and target values it works correctly.

--
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] [Commented] (COUCHDB-1315) Remote pull replication with filter and params fails with reason: invalid UTF-8 JSON

Posted by "Dave Cottlehuber (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-1315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13133752#comment-13133752 ] 

Dave Cottlehuber commented on COUCHDB-1315:
-------------------------------------------

Thanks Martin.

Sanity check - does the filter ddoc exist on the target? I can successfully pull replicate from Apache CouchDB 1.1.0, with a basic filter - see below. Can you produce a simple test case where this doesn't work, using Apache CouchDB 1.1.0 please? For CouchBase support please use their product forums.

Unfortunately for the logs to be useful it also needs to include the setup of the replication itself. 

// replication request
{
    "source": "http://172.16.40.128:5985/testy",
    "target": "testy",
    "filter": "replication_filter/just_say_yes"
}

// ensure filter ddoc exists on target
{
    "_id": "_design/replication_filter",
    "filters": {
        "just_say_yes": "function(doc, req) { return true; }"
    }
}

                
> Remote pull replication with filter and params fails with reason: invalid UTF-8 JSON
> ------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-1315
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1315
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Replication
>    Affects Versions: 1.1
>         Environment: - Windows 7 x64 on target machine
> - Windows 7 x32 on source machine
>            Reporter: Martin Castellanos
>              Labels: pull, replication
>
> I'm posting the following to: http://localhost:5984/_replicate
>     {"source":"http://MARTIN-LT:5984/pdlib","target":"pdlib", "filter":"replication/SINGLE_COLLECTION", "query_params": {"key":"bb579347-9bfb-4dda-84eb-622b43108872"}}
> This is the output from the remote machine log:
> [Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] 'GET' /pdlib/_changes?key=bb579347-9bfb-4dda-84eb-622b43108872&filter=replication/SINGLE_COLLECTION&style=all_docs&heartbeat=10000&since=0&feed=normal {1,
>                                                                                                                                                         1}
> Headers: [{'Accept',"application/json"},
>           {'Content-Length',"0"},
>           {'Host',"MARTIN-NEWPC:5984"},
>           {'User-Agent',"CouchDB/1.0.2"}]
> [Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] OAuth Params: [{"key","bb579347-9bfb-4dda-84eb-622b43108872"},
>                {"filter","replication/SINGLE_COLLECTION"},
>                {"style","all_docs"},
>                {"heartbeat","10000"},
>                {"since","0"},
>                {"feed","normal"}]
> [Mon, 17 Oct 2011 01:20:48 GMT] [info] [<0.476.0>] 192.168.2.3 - - 'GET' /pdlib/_changes?key=bb579347-9bfb-4dda-84eb-622b43108872&filter=replication/SINGLE_COLLECTION&style=all_docs&heartbeat=10000&since=0&feed=normal 200
> [Mon, 17 Oct 2011 01:20:48 GMT] [error] [<0.476.0>] attempted upload of invalid JSON (set log_level to debug to log it)
> [Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] Invalid JSON: <<"bb579347-9bfb-4dda-84eb-622b43108872">>
> [Mon, 17 Oct 2011 01:20:48 GMT] [info] [<0.476.0>] 192.168.2.3 - - 'GET' /pdlib/_changes?key=bb579347-9bfb-4dda-84eb-622b43108872&filter=replication/SINGLE_COLLECTION&style=all_docs&heartbeat=10000&since=0&feed=normal 400
> [Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] httpd 400 error response:
>  {"error":"bad_request","reason":"invalid UTF-8 JSON"}
> This only happens on a pull replication, if I switch source and target values it works correctly.

--
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] [Commented] (COUCHDB-1315) Remote pull replication with filter and params fails with reason: invalid UTF-8 JSON

Posted by "Dave Cottlehuber (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-1315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13161951#comment-13161951 ] 

Dave Cottlehuber commented on COUCHDB-1315:
-------------------------------------------

Hi Martin,

If you have admin party on your local laptop, then you'll get this error message; I don't believe its a bug however. Please refer to "8. The user_ctx property and delegations" in https://gist.github.com/832610

Otherwise I'm unable to replicate this on Apache CouchDB 1.1.1 using filter query parameters and admins set up both locally & remotely.

{
    "_id": "_design/rf",
    "filters": {
        "yes": "function(doc, req) { return true; }",
        "maybe": "function(doc, req) { if (req.query.copy && req.query.copy==true) {return true;} else {return false;}}",
        "no": "function(doc, req) { return false; }",
        "log": "function(doc, req) { log(req); return false; }"
    }
}


// curly stuff
alias curly='curl --silent -H "Content-Type: application/json" '
source=http://admin:passwd@192.168.2.103:5984
target=http://admin:passwd@192.168.2.103:5985

curly -X POST $source/_replicate -d '{"source": "http://admin:passwd@192.168.2.103:5985/testy", "target": "testy", "filter": "rf/maybe", "query_params": {"copy": false}}' | json_xs
curly -X POST $source/_replicate -d '{"source": "http://admin:passwd@192.168.2.103:5985/testy", "target": "testy", "filter": "rf/maybe", "query_params": {"copy": true}}' | json_xs

@fdmanana - would you mind a quick check please & if you agree, close as "Won't Fix".

                
> Remote pull replication with filter and params fails with reason: invalid UTF-8 JSON
> ------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-1315
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1315
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Replication
>    Affects Versions: 1.1
>         Environment: - Windows 7 x64 on target machine
> - Windows 7 x32 on source machine
>            Reporter: Martin Castellanos
>              Labels: pull, replication
>
> I'm posting the following to: http://localhost:5984/_replicate
>     {"source":"http://MARTIN-LT:5984/pdlib","target":"pdlib", "filter":"replication/SINGLE_COLLECTION", "query_params": {"key":"bb579347-9bfb-4dda-84eb-622b43108872"}}
> This is the output from the remote machine log:
> [Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] 'GET' /pdlib/_changes?key=bb579347-9bfb-4dda-84eb-622b43108872&filter=replication/SINGLE_COLLECTION&style=all_docs&heartbeat=10000&since=0&feed=normal {1,
>                                                                                                                                                         1}
> Headers: [{'Accept',"application/json"},
>           {'Content-Length',"0"},
>           {'Host',"MARTIN-NEWPC:5984"},
>           {'User-Agent',"CouchDB/1.0.2"}]
> [Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] OAuth Params: [{"key","bb579347-9bfb-4dda-84eb-622b43108872"},
>                {"filter","replication/SINGLE_COLLECTION"},
>                {"style","all_docs"},
>                {"heartbeat","10000"},
>                {"since","0"},
>                {"feed","normal"}]
> [Mon, 17 Oct 2011 01:20:48 GMT] [info] [<0.476.0>] 192.168.2.3 - - 'GET' /pdlib/_changes?key=bb579347-9bfb-4dda-84eb-622b43108872&filter=replication/SINGLE_COLLECTION&style=all_docs&heartbeat=10000&since=0&feed=normal 200
> [Mon, 17 Oct 2011 01:20:48 GMT] [error] [<0.476.0>] attempted upload of invalid JSON (set log_level to debug to log it)
> [Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] Invalid JSON: <<"bb579347-9bfb-4dda-84eb-622b43108872">>
> [Mon, 17 Oct 2011 01:20:48 GMT] [info] [<0.476.0>] 192.168.2.3 - - 'GET' /pdlib/_changes?key=bb579347-9bfb-4dda-84eb-622b43108872&filter=replication/SINGLE_COLLECTION&style=all_docs&heartbeat=10000&since=0&feed=normal 400
> [Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] httpd 400 error response:
>  {"error":"bad_request","reason":"invalid UTF-8 JSON"}
> This only happens on a pull replication, if I switch source and target values it works correctly.

--
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] [Commented] (COUCHDB-1315) Remote pull replication with filter and params fails with reason: invalid UTF-8 JSON

Posted by "Dave Cottlehuber (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-1315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13133450#comment-13133450 ] 

Dave Cottlehuber commented on COUCHDB-1315:
-------------------------------------------

which build are you using?
can you re-run the replication with level=debug in the [log] section in local.ini at both ends, and provide a url to the logs please?
                
> Remote pull replication with filter and params fails with reason: invalid UTF-8 JSON
> ------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-1315
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1315
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Replication
>    Affects Versions: 1.1
>         Environment: - Windows 7 x64 on target machine
> - Windows 7 x32 on source machine
>            Reporter: Martin Castellanos
>              Labels: pull, replication
>
> I'm posting the following to: http://localhost:5984/_replicate
>     {"source":"http://MARTIN-LT:5984/pdlib","target":"pdlib", "filter":"replication/SINGLE_COLLECTION", "query_params": {"key":"bb579347-9bfb-4dda-84eb-622b43108872"}}
> This is the output from the remote machine log:
> [Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] 'GET' /pdlib/_changes?key=bb579347-9bfb-4dda-84eb-622b43108872&filter=replication/SINGLE_COLLECTION&style=all_docs&heartbeat=10000&since=0&feed=normal {1,
>                                                                                                                                                         1}
> Headers: [{'Accept',"application/json"},
>           {'Content-Length',"0"},
>           {'Host',"MARTIN-NEWPC:5984"},
>           {'User-Agent',"CouchDB/1.0.2"}]
> [Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] OAuth Params: [{"key","bb579347-9bfb-4dda-84eb-622b43108872"},
>                {"filter","replication/SINGLE_COLLECTION"},
>                {"style","all_docs"},
>                {"heartbeat","10000"},
>                {"since","0"},
>                {"feed","normal"}]
> [Mon, 17 Oct 2011 01:20:48 GMT] [info] [<0.476.0>] 192.168.2.3 - - 'GET' /pdlib/_changes?key=bb579347-9bfb-4dda-84eb-622b43108872&filter=replication/SINGLE_COLLECTION&style=all_docs&heartbeat=10000&since=0&feed=normal 200
> [Mon, 17 Oct 2011 01:20:48 GMT] [error] [<0.476.0>] attempted upload of invalid JSON (set log_level to debug to log it)
> [Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] Invalid JSON: <<"bb579347-9bfb-4dda-84eb-622b43108872">>
> [Mon, 17 Oct 2011 01:20:48 GMT] [info] [<0.476.0>] 192.168.2.3 - - 'GET' /pdlib/_changes?key=bb579347-9bfb-4dda-84eb-622b43108872&filter=replication/SINGLE_COLLECTION&style=all_docs&heartbeat=10000&since=0&feed=normal 400
> [Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] httpd 400 error response:
>  {"error":"bad_request","reason":"invalid UTF-8 JSON"}
> This only happens on a pull replication, if I switch source and target values it works correctly.

--
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] [Commented] (COUCHDB-1315) Remote pull replication with filter and params fails with reason: invalid UTF-8 JSON

Posted by "Martin Castellanos (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-1315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13133774#comment-13133774 ] 

Martin Castellanos commented on COUCHDB-1315:
---------------------------------------------

Hi Dave,

Yes, the filter exists on both machines and this is the definition:
{
   "_id": "_design/replication",
   "_rev": "2-7cba5bd3cfdf66ea859821eccba060b4",
   "filters": {
       "SINGLE_COLLECTION": "function(doc, req){ if(doc.type && (doc.type == 'collection' || doc.type == 'document')) { for (var i in doc.path) { if (doc.path[i] == req.query.key) { return true; } } } return false; }",
       "SERVERS": "function(doc, req){ return (doc.type && doc.type === 'server'); }"
   }
}

Please note that the problem doesn't happen with a regular pull replication but with a pull replication *with parameters*. 

About the CouchDB/CouchBase version, you are completely right, I'm very sorry, didn't realize it was Couchbase that I had, I'll try to install Apache CouchDB and try.

Thank you very much for your help.
                
> Remote pull replication with filter and params fails with reason: invalid UTF-8 JSON
> ------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-1315
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1315
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Replication
>    Affects Versions: 1.1
>         Environment: - Windows 7 x64 on target machine
> - Windows 7 x32 on source machine
>            Reporter: Martin Castellanos
>              Labels: pull, replication
>
> I'm posting the following to: http://localhost:5984/_replicate
>     {"source":"http://MARTIN-LT:5984/pdlib","target":"pdlib", "filter":"replication/SINGLE_COLLECTION", "query_params": {"key":"bb579347-9bfb-4dda-84eb-622b43108872"}}
> This is the output from the remote machine log:
> [Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] 'GET' /pdlib/_changes?key=bb579347-9bfb-4dda-84eb-622b43108872&filter=replication/SINGLE_COLLECTION&style=all_docs&heartbeat=10000&since=0&feed=normal {1,
>                                                                                                                                                         1}
> Headers: [{'Accept',"application/json"},
>           {'Content-Length',"0"},
>           {'Host',"MARTIN-NEWPC:5984"},
>           {'User-Agent',"CouchDB/1.0.2"}]
> [Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] OAuth Params: [{"key","bb579347-9bfb-4dda-84eb-622b43108872"},
>                {"filter","replication/SINGLE_COLLECTION"},
>                {"style","all_docs"},
>                {"heartbeat","10000"},
>                {"since","0"},
>                {"feed","normal"}]
> [Mon, 17 Oct 2011 01:20:48 GMT] [info] [<0.476.0>] 192.168.2.3 - - 'GET' /pdlib/_changes?key=bb579347-9bfb-4dda-84eb-622b43108872&filter=replication/SINGLE_COLLECTION&style=all_docs&heartbeat=10000&since=0&feed=normal 200
> [Mon, 17 Oct 2011 01:20:48 GMT] [error] [<0.476.0>] attempted upload of invalid JSON (set log_level to debug to log it)
> [Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] Invalid JSON: <<"bb579347-9bfb-4dda-84eb-622b43108872">>
> [Mon, 17 Oct 2011 01:20:48 GMT] [info] [<0.476.0>] 192.168.2.3 - - 'GET' /pdlib/_changes?key=bb579347-9bfb-4dda-84eb-622b43108872&filter=replication/SINGLE_COLLECTION&style=all_docs&heartbeat=10000&since=0&feed=normal 400
> [Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] httpd 400 error response:
>  {"error":"bad_request","reason":"invalid UTF-8 JSON"}
> This only happens on a pull replication, if I switch source and target values it works correctly.

--
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-1315) Remote pull replication with filter and params fails with reason: invalid UTF-8 JSON

Posted by "Martin Castellanos (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-1315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Castellanos updated COUCHDB-1315:
----------------------------------------

    Description: 
I'm posting the following to: http://localhost:5984/_replicate
    {"source":"http://MARTIN-LT:5984/pdlib","target":"pdlib", "filter":"replication/SINGLE_COLLECTION", "query_params": {"key":"bb579347-9bfb-4dda-84eb-622b43108872"}}


This is the output from the remote machine log:

[Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] 'GET' /pdlib/_changes?key=bb579347-9bfb-4dda-84eb-622b43108872&filter=replication/SINGLE_COLLECTION&style=all_docs&heartbeat=10000&since=0&feed=normal {1,
                                                                                                                                                        1}
Headers: [{'Accept',"application/json"},
          {'Content-Length',"0"},
          {'Host',"MARTIN-NEWPC:5984"},
          {'User-Agent',"CouchDB/1.0.2"}]

[Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] OAuth Params: [{"key","bb579347-9bfb-4dda-84eb-622b43108872"},
               {"filter","replication/SINGLE_COLLECTION"},
               {"style","all_docs"},
               {"heartbeat","10000"},
               {"since","0"},
               {"feed","normal"}]

[Mon, 17 Oct 2011 01:20:48 GMT] [info] [<0.476.0>] 192.168.2.3 - - 'GET' /pdlib/_changes?key=bb579347-9bfb-4dda-84eb-622b43108872&filter=replication/SINGLE_COLLECTION&style=all_docs&heartbeat=10000&since=0&feed=normal 200

[Mon, 17 Oct 2011 01:20:48 GMT] [error] [<0.476.0>] attempted upload of invalid JSON (set log_level to debug to log it)

[Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] Invalid JSON: <<"bb579347-9bfb-4dda-84eb-622b43108872">>

[Mon, 17 Oct 2011 01:20:48 GMT] [info] [<0.476.0>] 192.168.2.3 - - 'GET' /pdlib/_changes?key=bb579347-9bfb-4dda-84eb-622b43108872&filter=replication/SINGLE_COLLECTION&style=all_docs&heartbeat=10000&since=0&feed=normal 400

[Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] httpd 400 error response:
 {"error":"bad_request","reason":"invalid UTF-8 JSON"}



This only happens on a pull replication, if I switch source and target values it works correctly.

  was:
I'm posting the following to: http://localhost:5984/_replicate
    {"source":"http://MARTIN-LT:5984/pdlib","target":"pdlib", "filter":"replication/SINGLE_COLLECTION", "query_params": {"key":"ffedddf1-da9e-47a8-b41c-2ac8e48bf7a8"}}


This is the output from the remote machine log:

[Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] 'GET' /pdlib/_changes?key=bb579347-9bfb-4dda-84eb-622b43108872&filter=replication/SINGLE_COLLECTION&style=all_docs&heartbeat=10000&since=0&feed=normal {1,
                                                                                                                                                        1}
Headers: [{'Accept',"application/json"},
          {'Content-Length',"0"},
          {'Host',"MARTIN-NEWPC:5984"},
          {'User-Agent',"CouchDB/1.0.2"}]

[Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] OAuth Params: [{"key","bb579347-9bfb-4dda-84eb-622b43108872"},
               {"filter","replication/SINGLE_COLLECTION"},
               {"style","all_docs"},
               {"heartbeat","10000"},
               {"since","0"},
               {"feed","normal"}]

[Mon, 17 Oct 2011 01:20:48 GMT] [info] [<0.476.0>] 192.168.2.3 - - 'GET' /pdlib/_changes?key=bb579347-9bfb-4dda-84eb-622b43108872&filter=replication/SINGLE_COLLECTION&style=all_docs&heartbeat=10000&since=0&feed=normal 200

[Mon, 17 Oct 2011 01:20:48 GMT] [error] [<0.476.0>] attempted upload of invalid JSON (set log_level to debug to log it)

[Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] Invalid JSON: <<"bb579347-9bfb-4dda-84eb-622b43108872">>

[Mon, 17 Oct 2011 01:20:48 GMT] [info] [<0.476.0>] 192.168.2.3 - - 'GET' /pdlib/_changes?key=bb579347-9bfb-4dda-84eb-622b43108872&filter=replication/SINGLE_COLLECTION&style=all_docs&heartbeat=10000&since=0&feed=normal 400

[Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] httpd 400 error response:
 {"error":"bad_request","reason":"invalid UTF-8 JSON"}



This only happens on a pull replication, if I switch source and target values it works correctly.

    
> Remote pull replication with filter and params fails with reason: invalid UTF-8 JSON
> ------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-1315
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1315
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Replication
>    Affects Versions: 1.1
>         Environment: - Windows 7 x64 on target machine
> - Windows 7 x32 on source machine
>            Reporter: Martin Castellanos
>              Labels: pull, replication
>
> I'm posting the following to: http://localhost:5984/_replicate
>     {"source":"http://MARTIN-LT:5984/pdlib","target":"pdlib", "filter":"replication/SINGLE_COLLECTION", "query_params": {"key":"bb579347-9bfb-4dda-84eb-622b43108872"}}
> This is the output from the remote machine log:
> [Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] 'GET' /pdlib/_changes?key=bb579347-9bfb-4dda-84eb-622b43108872&filter=replication/SINGLE_COLLECTION&style=all_docs&heartbeat=10000&since=0&feed=normal {1,
>                                                                                                                                                         1}
> Headers: [{'Accept',"application/json"},
>           {'Content-Length',"0"},
>           {'Host',"MARTIN-NEWPC:5984"},
>           {'User-Agent',"CouchDB/1.0.2"}]
> [Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] OAuth Params: [{"key","bb579347-9bfb-4dda-84eb-622b43108872"},
>                {"filter","replication/SINGLE_COLLECTION"},
>                {"style","all_docs"},
>                {"heartbeat","10000"},
>                {"since","0"},
>                {"feed","normal"}]
> [Mon, 17 Oct 2011 01:20:48 GMT] [info] [<0.476.0>] 192.168.2.3 - - 'GET' /pdlib/_changes?key=bb579347-9bfb-4dda-84eb-622b43108872&filter=replication/SINGLE_COLLECTION&style=all_docs&heartbeat=10000&since=0&feed=normal 200
> [Mon, 17 Oct 2011 01:20:48 GMT] [error] [<0.476.0>] attempted upload of invalid JSON (set log_level to debug to log it)
> [Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] Invalid JSON: <<"bb579347-9bfb-4dda-84eb-622b43108872">>
> [Mon, 17 Oct 2011 01:20:48 GMT] [info] [<0.476.0>] 192.168.2.3 - - 'GET' /pdlib/_changes?key=bb579347-9bfb-4dda-84eb-622b43108872&filter=replication/SINGLE_COLLECTION&style=all_docs&heartbeat=10000&since=0&feed=normal 400
> [Mon, 17 Oct 2011 01:20:48 GMT] [debug] [<0.476.0>] httpd 400 error response:
>  {"error":"bad_request","reason":"invalid UTF-8 JSON"}
> This only happens on a pull replication, if I switch source and target values it works correctly.

--
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