Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on node.js 4.0 / socket.io 1.3.6 (unexpected disconnect?) #2236

Closed
chisleu opened this issue Sep 10, 2015 · 18 comments
Closed

Crash on node.js 4.0 / socket.io 1.3.6 (unexpected disconnect?) #2236

chisleu opened this issue Sep 10, 2015 · 18 comments

Comments

@chisleu
Copy link

chisleu commented Sep 10, 2015

Today I got socket.io going great for a simple chat setup. However, if I refresh the screen rapidly, it crashes my node instance. Here is the error:

assert.js:89
  throw new assert.AssertionError({
  ^
AssertionError: false == true
    at ServerResponse.resOnFinish (_http_server.js:473:7)
    at emitNone (events.js:67:13)
    at ServerResponse.emit (events.js:166:7)
    at finish (_http_outgoing.js:526:10)
    at doNTCallback0 (node.js:407:9)
    at process._tickDomainCallback (node.js:377:13)

Google has been unhelpful. I'm hoping someone else solved this.

Unfortunately, I also upgraded to node 4.0 today because I am a huge fan of => functions.

It could be related to that, although it only happens when I have the socket.io code loaded. The code I'm using is very simple:

var server = http.createServer(app);
var io = require('socket.io')(server);
io.on('connection', function (socket) {
    socket.emit('juxtami.com', { hello: 'world' });
};
server.listen(8888);

I'm using express.js 4.13 and followed the information from the website.

I want to stress that it works fine unless I force disconnects by refreshing the client page (causing the JS to disconnect abruptly, I'm guessing.)

I found several comments about similar issues in earlier versions of node. It seems there was a bug fix that kept disconnects from throwing an error, but maybe there was reversion? Or maybe it is just similar?

@chisleu
Copy link
Author

chisleu commented Sep 10, 2015

Update: doesn't seem to break on 0.12.7 so I guess I'll revert. It's a shame because I wrote a good bit of code with arrow functions.

@lepture
Copy link

lepture commented Sep 12, 2015

socket.io, please don't pin your dependencies. Use ^, ~ etc.

@ChALkeR
Copy link

ChALkeR commented Sep 12, 2015

@chisleu, did you rebuild all dependencies (including socket.io) after an Node.js upgrade? Native addons compiled for 0.12 won't work with 4.0.0 until you rebuild them.

Atm, when you will try to build socket.io with Node.js 4.0.0, you will experience this bug: #2228.

@chisleu
Copy link
Author

chisleu commented Sep 12, 2015

I deleted node_modules and did npm install.
I didn't notice that output. I did find that it worked until I refreshed the browser over and over.

@kesgri
Copy link

kesgri commented Sep 16, 2015

Same for me. 0.12 was fine, just after upgrade to node 4 I started to see these errors.
On a separate box I did fresh install of node and all depending modules - same thing.

AssertionError: false == true
at ServerResponse.resOnFinish (_http_server.js:473:7)
at emitNone (events.js:67:13)
at ServerResponse.emit (events.js:166:7)
at finish (_http_outgoing.js:526:10)
at doNTCallback0 (node.js:407:9)
at process._tickDomainCallback (node.js:377:13)

@kleinph
Copy link

kleinph commented Sep 16, 2015

I can confirm this with node 4.0 and socket.io 1.3.6 on Linux. I also did a clean install of the node modules (deleted node_modules and did a npm install).

I also got the same stacktrace:

assert.js:89
  throw new assert.AssertionError({
  ^
AssertionError: false == true
    at ServerResponse.resOnFinish (_http_server.js:473:7)
    at emitNone (events.js:67:13)
    at ServerResponse.emit (events.js:166:7)
    at finish (_http_outgoing.js:526:10)
    at doNTCallback0 (node.js:407:9)
    at process._tickCallback (node.js:336:13)

@vandernorth
Copy link
Contributor

@chisleu why dont you use the --harmony flag in node 0.12 to use your arrow functions?

I've got the same error on node 4.1, after removing and reinstalling with npm install the issue still exists but happens later. At first I only needed 2 refreshes of the page, now it takes me about 20 refreshes.

@chisleu
Copy link
Author

chisleu commented Sep 17, 2015

@vandernorth The scope in 0.12's arrow functions isn't lexical. That is the only reason I'm using them. They can keep my prototype function code more simple, if I don't have to set the class' this to something else.

@ivaylopivanov
Copy link

Segmentation fault (core dumped),
ubuntu 14.04,
node 4.0.0,
socket.io 1.3.5

@laggingreflex
Copy link

1.3.7 is out. I think it solves this?

@youth7
Copy link

youth7 commented Sep 22, 2015

same to me , but it happen more frequently while the client is IOS. it rarely happen on Android

@chisleu
Copy link
Author

chisleu commented Sep 22, 2015

I upgraded to socket.io 1.3.7 and node 4.1.

It now builds without errors and doesn't seem to crash like it did before!!

👍

@ivaylopivanov
Copy link

Yep, 1.3.7 is okay

@vandernorth
Copy link
Contributor

I've upgraded to 1.3.7 with node 4.1 but after refreshing 4 pages at the same time I still seem to get this error. I'm testing on windows this time, not sure if that makes any difference. I did not see any error in the build/install process.

assert.js:89
throw new assert.AssertionError({
^
AssertionError: false == true
at ServerResponse.resOnFinish (_http_server.js:473:7)
at emitNone (events.js:67:13)
at ServerResponse.emit (events.js:166:7)
at finish (_http_outgoing.js:526:10)
at doNTCallback0 (node.js:407:9)
at process._tickCallback (node.js:336:13)

@laggingreflex
Copy link

Have you tried deleting all node_modules and doing a fresh install?

@vandernorth
Copy link
Contributor

@laggingreflex Yes I did, but I can no longer trace my current issue back to socket.io.
What I'm experiencing now looks more like nodejs/node#2639
Ill start searching from there, thanks anyway!

@chisleu
Copy link
Author

chisleu commented Sep 23, 2015

Closing as it no longer appears linked to just socket.io

assert.js:89
  throw new assert.AssertionError({
  ^
AssertionError: false == true
    at ServerResponse.resOnFinish (_http_server.js:473:7)
    at emitNone (events.js:67:13)
    at ServerResponse.emit (events.js:166:7)
    at finish (_http_outgoing.js:526:10)
    at doNTCallback0 (node.js:407:9)
    at process._tickDomainCallback (node.js:377:13)

@chisleu chisleu closed this as completed Sep 23, 2015
@ghost
Copy link

ghost commented Sep 25, 2015

it happens to me, But I only use express...

var express = require('express');
var https = require('https');
var fs = require('fs');
var app = express();
app.get('/', function (req, res) {
     res.sendFile(__dirname + '/static/index.html');
});
app.use(express.static('static'))
var options = {
    key: fs.readFileSync('ssl/private.key'),
    cert: fs.readFileSync('ssl/certificate.pem')
};
https.createServer(options,app).listen(443);

assert.js:89
throw new assert.AssertionError({
^
AssertionError: false == true
at ServerResponse.resOnFinish (_http_server.js:474:7)
at emitNone (events.js:67:13)
at ServerResponse.emit (events.js:166:7)
at finish (_http_outgoing.js:529:10)
at doNTCallback0 (node.js:407:9)
at process._tickCallback (node.js:336:13)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants