Restaging of application in Bluemix failed - node.js

Created a LoopBack application with CloudantDB as data source. Running fine when tested locally. Published the application and product successfully on Bluemix leveraging API designer.
But when I bind CloudantDB service with app on Bluemix and try to re-stage it, getting following error.can anyone help me resolve this issue? Any help in this context will be much appreciated. Thanks.
{ code: 'ESOCKETTIMEDOUT', connect: false, name: 'Error', message: 'ESOCKETTIMEDOUT', stack: 'Error: ESOCKETTIMEDOUT\n at ClientRequest. (/home/vcap/app/node_modules/request/request.js:778:19)\n at ClientRequest.g (events.js:291:16)\n at emitNone (events.js:86:13)\n at ClientRequest.emit (events.js:185:7)\n at TLSSocket.emitTimeout (_http_client.js:620:10)\n at TLSSocket.g (events.js:291:16)\n at emitNone (events.js:86:13)\n at TLSSocket.emit (events.js:185:7)\n at TLSSocket.Socket._onTimeout (net.js:339:8)\n at ontimeout (timers.js:365:14)\n at tryOnTimeout (timers.js:237:5)\n at Timer.listOnTimeout (timers.js:207:5)' }

Related

WARN: Write to InfluxDB failed [[RequestTimedOutError]]

WARN: Write to InfluxDB failed (attempt: 1). Error:
at S.<anonymous> (/Users/sathish/Documents/sample/raviAPI/node_modules/core-js/internals/wrap-error-constructor-with-cause.js:37:62)
at new super (/Users/sathish/Documents/sample/raviAPI/node_modules/core-js/modules/es.error.cause.js:28:43)
at new S (/Users/sathish/Documents/sample/raviAPI/node_modules/#influxdata/influxdb-client/src/errors.ts:163:5)
at ClientRequest.<anonymous> (/Users/sathish/Documents/sample/raviAPI/node_modules/#influxdata/influxdb-client/src/impl/node/NodeHttpTransport.ts:346:23)
at ClientRequest.emit (events.js:314:20)
at ClientRequest.EventEmitter.emit (domain.js:483:12)
at Socket.emitRequestTimeout (_http_client.js:715:9)
at Object.onceWrapper (events.js:420:28)
at Socket.emit (events.js:326:22)
at Socket.EventEmitter.emit (domain.js:483:12)
at Socket._onTimeout (net.js:483:8)
at listOnTimeout (internal/timers.js:554:17)
at processTimers (internal/timers.js:497:7)
name: 'RequestTimedOutError',
message: 'Request timed out'
I am facing this issue while writing data for each second in influxdb.
This is the influxdb client i am using from nodejs #influxdata/influxdb-client
It would be easier to answer this if you would post some of the code here.
looks like classing http request timeout
https://github.com/influxdata/influxdb-client-js/blob/558b3b4f6a5fd1e94c1579bd894cb0ce5e126368/packages/core/src/impl/node/NodeHttpTransport.ts#L345
which comes from regular nodejs http.IncomingMessage
https://github.com/influxdata/influxdb-client-js/blob/558b3b4f6a5fd1e94c1579bd894cb0ce5e126368/packages/core/src/impl/node/NodeHttpTransport.ts#L47
you can read more about timeouts here https://nodejs.org/api/http.html#event-timeout
Whatever timeout setting you are using is too low for the server to respond.
Default Agent has timeout options in milliseconds, probably there is a way to configure that in this node module as well.
https://nodejs.org/api/http.html#new-agentoptions
https://github.com/influxdata/influxdb-client-js/blob/558b3b4f6a5fd1e94c1579bd894cb0ce5e126368/packages/core/src/impl/node/NodeHttpTransport.ts#L62

Getting read ECONNRESET at TCP.onStreamRead error, while making connection with AZURE server

Hi all I am learning Nodejs. I am uploading file to AZURE server, but getting the below error after every 3-4 minutes. Anyone have the solution for this?
The error is ->
Error: read ECONNRESET
at TCP.onStreamRead (internal/stream_base_commons.js:111:27)
Emitted 'error' event at:
at Connection._handleProtocolError
(/Data/core/node_modules/mysql/lib/Connection.js:425:8)
at Protocol.emit (events.js:198:13)
at Protocol.EventEmitter.emit (domain.js:448:20)
at Protocol._delegateError
(/Data/core/node_modules/mysql/lib/protocol/Protocol.js:390:10)
at Protocol.handleNetworkError
(/Data/core/node_modules/mysql/lib/protocol/Protocol.js:363:10)
at Connection._handleNetworkError
(/Data/core/node_modules/mysql/lib/Connection.js:420:18)
at Socket.emit (events.js:198:13)
at Socket.EventEmitter.emit (domain.js:448:20)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
"ECONNRESET" means the other side of the TCP conversation abruptly closed its end of the connection. This is most probably due to one or more application protocol errors. You could look at the API server logs to see if it complains about something.
Glad #RakeshSaini that you identified the error which was in the connection waiting limit in the MySQL and for fixing the issue.

MongoError : command createIndexes requires authentication - mongodb npm

I have a project that I recently put in a production server (not live, but different from my development environment). I configured a mongoDB server with a password authentication.
When I start my Nodejs Application, my usual code retrieve correctly my mongoDB server, returning a client.db object successfully.
But I also have an error popping-in. Something that is not called inside my Nodejs application apparently.
[ERROR] { MongoError: command createIndexes requires authentication
at Connection.<anonymous> (/home/myaccount/myapp/node_modules/mongodb/lib/core/connection/pool.js:460:61)
at Connection.emit (events.js:189:13)
at processMessage (/home/myaccount/myapp/node_modules/mongodb/lib/core/connection/connection.js:368:10)
at Socket.<anonymous> (/home/myaccount/myapp/node_modules/mongodb/lib/core/connection/connection.js:537:15)
at Socket.emit (events.js:189:13)
at addChunk (_stream_readable.js:284:12)
at readableAddChunk (_stream_readable.js:265:11)
at Socket.Readable.push (_stream_readable.js:220:10)
at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
ok: 0,
errmsg: 'command createIndexes requires authentication',
code: 13,
codeName: 'Unauthorized',
name: 'MongoError',
[Symbol(mongoErrorContextSymbol)]: {} }
nothing in the error is pointing toward something I created, it's only about the mongodb npm library. It also giving this error even if a delete every MongoDB connexion related code (but not the mongodb library load).
Do you have any idea how to fix this ?
Okay it's my fault. I had another connexion point that I didn't changed from my express sessions. It's fixed now.
It's just weird the error didn't point toward that module..

How to fix RequestError: Error: connect ETIMEDOUT while running Mocha JS/NodeJS test from behind proxy

I am getting the below error while trying to run Mocha JS test case which runs npm request-promise to call a REST service. I was able to connect to the REST URI endpoint through ARC client bur it failed with below error while running through organization's proxy-
RequestError: Error: connect ETIMEDOUT SERVER_IP:SERVER_PORT
at new RequestError (<Some_Path>\errors.js:14:15)
at Request.plumbing.callback (<Some_Path>\plumbing.js:87:29)
at Request.RP$callback [as _callback] (<Some_Path>\plumbing.js:46:31)
at self.callback (<Some_Path>\request.js:188:22)
at Request.onRequestError (<Some_Path>\request\request.js:884:8)
at TLSSocket.socketErrorListener (_http_client.js:309:9)
at emitErrorNT (net.js:1277:8)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
I fixed this issue with adding the following in the request-promise options-
proxy:'http://PROXY_SERVER_IP:PORT#'
I hope this helps.
Cheers,
Kunal
This worked for me
var request = require('request-promise').defaults({
proxy:'http://username:password#host:port',
strictSSL :false
});

Upload a file to Autodesk Forge - ESOCKETTIMEDOUT error

I am new to Autodesk-Forge API and I am trying to use the sample dmSample.js, included in the node.js SDK.
The example works well for very small files (up to 500 Kb)
However, when I try to upload larger files, (even just 1 Mb), the execution stops after few seconds with the following error message :
Error: { Error: ESOCKETTIMEDOUT
at ClientRequest.<anonymous> (C:\node.js dev\forge-api-nodejs-client node_mo dules\request\request.js:819:19)
at ClientRequest.g (events.js:292:16)
at emitNone (events.js:86:13)
at ClientRequest.emit (events.js:185:7)
at TLSSocket.emitTimeout (_http_client.js:629:10)
at TLSSocket.g (events.js:292:16)
at emitNone (events.js:86:13)
at TLSSocket.emit (events.js:185:7)
at TLSSocket.Socket._onTimeout (net.js:338:8)
at ontimeout (timers.js:386:14) code: 'ESOCKETTIMEDOUT', connect: false
}
The file I am trying to upload is 30 Mb and is on my local post.
Any idea ?
I was able to fix it by increasing the value of the timeout of the request module.
Forge uses a wrapper that it is located in
/src/ApiClient.js
Search for this.timeout and set it to something like.
this.timeout = 600000;

Resources