Skip to content

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

Closed

Description

@chisleu

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?

Activity

  1. chisleu commented on Sep 10, 2015

    @chisleu
    Author

    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.

  2. lepture commented on Sep 12, 2015

    @lepture

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

  3. ChALkeR commented on Sep 12, 2015

    @ChALkeR

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

  4. chisleu commented on Sep 12, 2015

    @chisleu
    Author

    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.

  5. kesgri commented on Sep 16, 2015

    @kesgri

    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)

  6. kleinph commented on Sep 16, 2015

    @kleinph

    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)
    
  7. vandernorth commented on Sep 17, 2015

    @vandernorth
    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.

  8. chisleu commented on Sep 17, 2015

    @chisleu
    Author

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

  9. ivaylopivanov commented on Sep 19, 2015

    @ivaylopivanov

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

  10. laggingreflex commented on Sep 21, 2015

    @laggingreflex

    1.3.7 is out. I think it solves this?

  11. youth7 commented on Sep 22, 2015

    @youth7

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

  12. chisleu commented on Sep 22, 2015

    @chisleu
    Author

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

    👍

  13. ivaylopivanov commented on Sep 22, 2015

    @ivaylopivanov

    Yep, 1.3.7 is okay

  14. vandernorth commented on Sep 22, 2015

    @vandernorth
    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)

  15. laggingreflex commented on Sep 22, 2015

    @laggingreflex

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

  16. vandernorth commented on Sep 23, 2015

    @vandernorth
    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!

  17. chisleu commented on Sep 23, 2015

    @chisleu
    Author

    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)
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions