Android-Couchbase icon indicating copy to clipboard operation
Android-Couchbase copied to clipboard

Error while replication on Android device

Open NandishAndDev opened this issue 12 years ago • 0 comments

Hi,

We use cloudantdata and replicate the same on android device. We have android device contacting nodejs proxy on heroku and that routes to cloudant. This is all through ssl. It works fine. However when I move the proxy from heroku to other machines on S3 or in our local environment, and start working without ssl, we get the following error on client side while replication through _changes feed. Can you please throw some light on this.

05-06 12:47:55.474: ERROR/CouchDB(1025): [error] [<0.115.0>] Error in replication 54f5314f299f1bb808b560584eafe1b6+continuous (triggered by document cloud2airline): {worker_died,<0.2716.0>, {process_died,<0.2731.0>, {function_clause, [{string,tokens1,[undefined,";",[]]}, {mochiweb_util,parse_header,1}, {couch_httpd,get_boundary,1}, {couch_httpd,parse_multipart_request,3}, {couch_api_wrap,'-open_doc_revs/6-fun-1-',4}, {couch_api_wrap_httpc,process_stream_response,5}, {couch_api_wrap,'-open_doc_revs/6-fun-2-',4}]}}} Restarting replication in 5 seconds.

This is our proxy code 'use strict'; /*!

  • Middleware for forwarding a request to CouchDB. */

/**

  • Module dependencies. */

var httpProxy = require('http-proxy'), util = require('./util');

module.exports = function(couch) { var proxy = new httpProxy.HttpProxy(couch), couchTarget = couch.target; httpProxy.setMaxSockets(200);

return function(req, res, next) { req.headers['host'] = couchTarget.host + ':' + couchTarget.port; req.headers['authorization'] = couch.credentials; req.headers['x-forwarded-ssl'] = util.isSecureForwardedRequest(req); var forwardedFor = req.headers['x-forwarded-for']; req.headers['x-real-ip'] = forwardedFor ? forwardedFor.split(',',1)[0] : req.connection.remoteAddress; req.url = couch.path + req.url; console.log(req.headers['x-forwarded-for']); console.log(req.headers['x-real-ip']); console.log(couchTarget.host + ":" + couchTarget.port + req.url); return proxy.proxyRequest(req, res); } }

Nandish

NandishAndDev avatar May 06 '13 14:05 NandishAndDev