Node.js forever module crashes on list - node.js

I'm running node v0.10.5 on Ubuntu 12.04, and I'm able to get processes started using the forever module, but as soon as I try to list the processes out, forever crashes with this error/stack trace:
/usr/local/lib/node_modules/forever/node_modules/nssocket/node_modules/lazy/lazy.js:211
for (var i = 0; i < chunk.length; i++) {
^
TypeError: Cannot read property 'length' of null
at Function.<anonymous> (/usr/local/lib/node_modules/forever/node_modules/nssocket/node_modules/lazy/lazy.js:211:38)
at Lazy.<anonymous> (/usr/local/lib/node_modules/forever/node_modules/nssocket/node_modules/lazy/lazy.js:187:21)
at Lazy.EventEmitter.emit (events.js:95:17)
at Socket.<anonymous> (/usr/local/lib/node_modules/forever/node_modules/nssocket/node_modules/lazy/lazy.js:50:22)
at Socket.EventEmitter.emit (events.js:92:17)
at emitReadable_ (_stream_readable.js:392:10)
at emitReadable (_stream_readable.js:388:5)
at Socket.Readable.read (_stream_readable.js:250:5)
at Socket.onSocketEnd (net.js:256:10)
at Socket.EventEmitter.emit (events.js:117:20)
I've tried upgrading it, and outright reinstalling it.

It's fixed. And i think will be released soon.
https://github.com/nodejitsu/forever/issues/408
or you can patch lazy.js manually
http://cl.ly/code/2k1I3A2r2v0k

Forever is still broken on node.js version 0.10. You install 0.8 via nvm for now

Related

Error invoking chaincode using Node.js SDK [TypeError: Cannot read property 'getConnectivityState' of undefined]

Failed to invoke successfully :: TypeError: Cannot read property 'getConnectivityState' of undefined
/opt/share/hyperledger/node_modules/fabric-client/lib/EventHub.js:355
if(self._stream) state = self.stream.call.channel.getConnectivityState();
^
TypeError: Cannot read property 'getConnectivityState' of undefined
at ClientDuplexStream.<anonymous> (/opt/share/hyperledger/node_modules/fabric-client/lib/EventHub.js:355:56)
at emitOne (events.js:116:13)
at ClientDuplexStream.emit (events.js:211:7)
at ClientDuplexStream._emitStatusIfDone (/opt/share/hyperledger/node_modules/grpc/src/client.js:236:12)
at ClientDuplexStream._readsDone (/opt/share/hyperledger/node_modules/grpc/src/client.js:201:8)
at /opt/share/hyperledger/node_modules/grpc/src/client_interceptors.js:705:15
I am using latest version of pre-requisites as mentioned in below link:
http://hyperledger-fabric.readthedocs.io/en/release-1.1/getting_started.html#install-prerequisites
Can anybody tell me where am i going wrong?
Yes, this is due to a new version of grpc released 3 days ago (v1.11.0). The version is controlled by fabric-client and it takes the latest available. You need to delete the grpc module and reinstall it with npm install grpc#1.9.1. This will fix the issue. Going forward you may need to have grpc fixed at 1.9.1 in your package.json until Hyperledger resolve this issue.
Reference:
https://chat.hyperledger.org/channel/general?msg=FME6aDfnfMexWTm6g
I commented these lines in EventHub.js.
It's required only for state log.
For example:
<br/>
<i> var state = -1;<br/>
//if(self._stream) state = self._stream.call.channel_.getConnectivityState();<br/>
logger.debug('on.data - grpc stream state :%s',state);<br/>
</i><br/><br/>
it works fine now.
I'm still getting below error after commenting the line in EventHub.js
Failed to invoke successfully :: TypeError: Cannot read property 'getConnectivityState' of undefined
Previous detailed error:
TypeError: Cannot read property 'getConnectivityState' of undefined
at ClientDuplexStream. (/fabric-samples/fabcar/node_modules/fabric-client/lib/EventHub.js:308:56)
at emitOne (events.js:116:13)
at ClientDuplexStream.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at ClientDuplexStream.Readable.push (_stream_readable.js:208:10)
at Object.onReceiveMessage (/fabric-samples/fabcar/node_modules/grpc/src/client_interceptors.js:1302:19)
at InterceptingListener.recvMessageWithContext (/fabric-samples/fabcar/node_modules/grpc/src/client_interceptors.js:629:19)
at /fabric-samples/fabcar/node_modules/grpc/src/client_interceptors.js:728:14
Faced the same issue while building the web docker
edit package.json
add the line
"dependencies": {
"grpc" : "1.9.1",
build the docker again
issue the docker compose agin ! it works
I was trying to connect the composer bna to IBM blockchain, and I tried out installing grpc 1.9.1.. and even 1.10.1.. I tried out like everything, and the only thing that worked was doing as Kataus suggested, I commented out the lines relate to the getConnectivity state, and it finally connected to the IBM blockchain network I had.

Fresh meteor 1.3 on win7 not runnning

I am also posting this on stackoverflow as this is suggested by meteor itself :)
I upgraded my meteor project to Meteor 1.3, and after updating all the proper packages I could not get meteor 1.3 to run. Then I created a fresh project and still get this error I posted below. I also tried to create the simple-todos example shown here https://www.meteor.com/tutorials/blaze/creating-an-app in CMD. Same result.
Windows 7 btw :) Also I have not installed meteorhacks:npm or any other extra packages whatsoever.
http.js:733
throw new TypeError('The header content contains invalid characters');
^
TypeError: The header content contains invalid characters
at ClientRequest.OutgoingMessage.setHeader (http.js:733:13)
at new ClientRequest (http.js:1429:14)
at Object.exports.request (http.js:1899:10)
at Array.stream [as 3] (C:\Users\Lightspeed\AppData\Local\.meteor\packages\meteor-tool\1.3.0_3\mt-os.windows.x86_32\dev_bundle\lib\node_modules\http-proxy\lib\http-proxy\passes\web-incoming.js:108:74)
at ProxyServer.<anonymous> (C:\Users\Lightspeed\AppData\Local\.meteor\packages\meteor-tool\1.3.0_3\mt-os.windows.x86_32\dev_bundle\lib\node_modules\http-proxy\lib\http-proxy\index.js:80:21)
at Proxy._tryHandleConnections (C:\tools\runners\run-proxy.js:182:20)
at Server.<anonymous> (C:\tools\runners\run-proxy.js:50:12)
at Server.emit (events.js:98:17)
at HTTPParser.parser.onIncoming (http.js:2164:12)
at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:152:23)
at Socket.socket.ondata (http.js:2022:22)
at TCP.onread (net.js:528:27)
Meteor does startup properly and does not crash until I actually navigate to localhost:3000. The page immediately errors (host not reachable) and meteor crashes with the error shown in my OP.
This problem was related to a specific windows 7 version. Though I don't have specifics anymore, it has been resolved.

Starting node-huxley with example tests

I'm struggling to get node-huxley to run. Having installed it globally, I then installed the node-selenium driver, cloned the repo and tried to run Huxley on the examples. However I'm seeing this error.
It seems to suggest that the server isn't running, but I've verified it as running on localhost:8000 correctly. Any ideas how to debug this?
firefox opening.
At 1 type and toggle.hux
/usr/local/lib/node_modules/huxley/node_modules/selenium-webdriver/lib/webdriver/promise.js:1549
throw error;
^
Error: ECONNREFUSED connect ECONNREFUSED
at ClientRequest.<anonymous> (/usr/local/lib/node_modules/huxley/node_modules/selenium-webdriver/http/index.js:127:16)
at ClientRequest.EventEmitter.emit (events.js:95:17)
at Socket.socketErrorListener (http.js:1547:9)
at Socket.EventEmitter.emit (events.js:95:17)
at net.js:440:14
at process._tickCallback (node.js:415:13)
==== async task ====
WebDriver.createSession()
at Function.webdriver.WebDriver.acquireSession_ (/usr/local/lib/node_modules/huxley/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:131:49)
at Function.webdriver.WebDriver.createSession (/usr/local/lib/node_modules/huxley/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:111:30)
at Builder.build (/usr/local/lib/node_modules/huxley/node_modules/selenium-webdriver/builder.js:105:20)
at _open (/usr/local/lib/node_modules/huxley/source/browser/driver.js:28:6)
at Object.open (/usr/local/lib/node_modules/huxley/source/browser/driver.js:49:3)
at _openRunAndClose (/usr/local/lib/node_modules/huxley/index.js:76:11)
at /usr/local/lib/node_modules/huxley/index.js:169:5
at /usr/local/lib/node_modules/huxley/index.js:217:5
at /usr/local/lib/node_modules/huxley/source/playback/getPlaybackInfos.js:121:5
Have you started selenium? (https://github.com/chenglou/node-huxley#installation)

Node.js Jsdom returning [Error: socket hang up] code: 'ECONNRESET' }

Trying to use jsdom under nodejs and receiving this error:
[Error: socket hang up] code: 'ECONNRESET' }
Using NodeJs v0.8.20, Ubuntu 12.04
var jsdom = require("jsdom");
jsdom.env({
html: 'http://www.google.com',
scripts: ['http://code.jquery.com/jquery.js'],
done: function (errors, window) { console.log(errors); }
});
http://clock.co.uk/tech-blogs/preventing-http-raise-hangup-error-on-destroyed-socket-write-from-crashing-your-nodejs-server
basically there was a bug where socket hang up errors were suppressed, but in node 0.8.20 it is no longer suppressed. however, most modules don't listen for that error event yet.
so... downgrade your node.js version and wait until jsdom fixes it, or use domains. pretty sure the issue is with jsdom using an older version of request. or you can just not use the HTTP parts of JSDOM.
It means that the other side unexpectedly shut down the connection.
When I try to run your script, I get this:
/Users/isaacs/dev/js/x/node_modules/jsdom/lib/jsdom.js:178
features = JSON.parse(JSON.stringify(window.document.implementation._fea
^
TypeError: Cannot read property 'implementation' of undefined
at exports.env.exports.jsdom.env.processHTML (/Users/isaacs/dev/js/x/node_modules/jsdom/lib/jsdom.js:178:59)
at Request.exports.env.exports.jsdom.env [as _callback] (/Users/isaacs/dev/js/x/node_modules/jsdom/lib/jsdom.js:283:9)
at Request.init.self.callback (/Users/isaacs/dev/js/x/node_modules/jsdom/node_modules/request/main.js:127:22)
at Request.EventEmitter.emit (events.js:99:17)
at Request.<anonymous> (/Users/isaacs/dev/js/x/node_modules/jsdom/node_modules/request/main.js:767:16)
at Request.EventEmitter.emit (events.js:126:20)
at IncomingMessage.Request.start.self.req.self.httpModule.request.buffer (/Users/isaacs/dev/js/x/node_modules/jsdom/node_modules/request/main.js:729:14)
at IncomingMessage.EventEmitter.emit (events.js:126:20)
at IncomingMessage._emitEnd (http.js:366:10)
at HTTPParser.parserOnMessageComplete [as onMessageComplete] (http.js:149:23)

Error starting Juggernaut

When I try to start Juggernaut I get this error :
1 Apr 20:21:01 - socket.io ready - accepting connections
node_redis: no callback to send error: ERR unknown command 'subscribe'
node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: ERR unknown command 'subscribe'
at RedisReplyParser.<anonymous> (/usr/local/lib/node/.npm/redis/0.5.9/packag
e/index.js:84:27)
at RedisReplyParser.emit (events.js:64:17)
at RedisReplyParser.send_error (/usr/local/lib/node/.npm/redis/0.5.9/package
/lib/parser/javascript.js:251:14)
at RedisReplyParser.execute (/usr/local/lib/node/.npm/redis/0.5.9/package/li
b/parser/javascript.js:110:22)
at RedisClient.on_data (/usr/local/lib/node/.npm/redis/0.5.9/package/index.j
s:328:27)
at Socket.<anonymous> (/usr/local/lib/node/.npm/redis/0.5.9/package/index.js
:99:14)
at Socket.emit (events.js:64:17)
at Socket._onReadable (net.js:672:14)
at IOWatcher.onReadable [as callback] (net.js:177:10)
I didnt find anything to help me!
Try upgrading Redis.
It happened to me, and that's what solved it. I'm using Ubuntu, and the one in the package manager isn't an updated version. It needs to be at least version 2.2.1.
Source: From one of the issues posted on the juggernaut github repo.
EDIT: Upon closer inspection, it looks like you were the one who posted the issue on the github repo. I'll just leave this answer here just in case anyone else has the same problem.

Resources