molnarg / node-http2

An HTTP/2 client and server implementation for node.js
MIT License
1.79k stars 187 forks source link

AssertionError: false == true #228

Open dinfyru opened 7 years ago

dinfyru commented 7 years ago

node -v 6.9.2 http2@3.3.6

Debug: internal, implementation, error
    AssertionError: false == true
    at Connection._send (/var/www/revizor-game.ru/node_modules/http2/lib/protocol/connection.js:326:9)
    at runCallback (timers.js:637:20)
    at tryOnImmediate (timers.js:610:5)
    at processImmediate [as _immediateCallback] (timers.js:582:5)

My server.js

$lib.s = new Hapi.Server();
var listener = http2.createServer({
    key: fs.readFileSync('/var/www/revizor-game.ru.key', 'utf8'),
    cert: fs.readFileSync('/var/www/ca.crt', 'utf8'),
    pfx: fs.readFileSync('/var/www/pfx.pfx')
});

$lib.s.connection({
    listener: listener,
    host: 'revizor-game.ru',
    port: 443,
    tls: true
});

and boot.js (clustering) - http://pastebin.com/YzGsJVUk

mutaphore commented 7 years ago

Getting the same issue: Node v6.7.0 http2@3.3.6

assert.js:85
  throw new assert.AssertionError({
  ^
AssertionError: false == true
    at Connection._send (/Users/dchen/Workbench/poc.http2-client-server/node_modules/http2/lib/protocol/connection.js:326:9)
    at runCallback (timers.js:574:20)
    at tryOnImmediate (timers.js:554:5)
    at processImmediate [as _immediateCallback] (timers.js:533:5)

My server:

const server = http2.createServer({
  key: fs.readFileSync(path.join(__dirname, '/server.key')),
  cert: fs.readFileSync(path.join(__dirname, '/server.crt')),
}, onRequest);

My client:

const options = {
    hostname: config.get("http2.hostname"),
    port: config.get("http2.port"),
    path: '/twolargeframes',
    method: 'GET',
    key: fs.readFileSync('./server.key'),
    ca: fs.readFileSync('./server.crt'),
};
http2.request(options)
mattisx commented 7 years ago

Getting this as well with node-apn:

Node version: 6.9.1

AssertionError: false == true
at Connection._send (.../node_modules/http2/lib/protocol/connection.js:343:9)
taina0407 commented 7 years ago

+1

sbeff commented 7 years ago

+1

IsaiahJTurner commented 7 years ago

+1

davidbnk commented 7 years ago

+1

mihai-iorga commented 7 years ago

+1

zliebersbach commented 7 years ago

@molnarg Pls.

mihai-iorga commented 7 years ago

+1

axmav commented 7 years ago

+1

divydeep commented 7 years ago

+1

virgafox commented 7 years ago

+1

thughes commented 7 years ago

@nwgh Also have seen this assert when running node-http2 with node-apn: https://github.com/molnarg/node-http2/blob/master/lib/protocol/connection.js#L326

Looking at the call to this.push where moreNeeded is set, I'm not sure that the assert makes sense as written:

var moreNeeded = this.push(frame);

Here's the code for push: https://github.com/molnarg/node-http2/blob/master/lib/protocol/flow.js#L277

In the case where this._push(frame) returns null (i.e., the frame is too large for the window and split or the window size is <=0), moreNeeded will be set to null. Then this._queue.push(frame) is called, but moreNeeded is still null. Thus, any time the window is <=0 or the frame is split we'll hit this assert.

  var moreNeeded = null;
  if (this._queue.length === 0) {
    moreNeeded = this._push(frame);
  }

  if (moreNeeded === null) {
    this._queue.push(frame);
  }

  return moreNeeded;
AppleTechy commented 7 years ago

+1

bbcelly commented 7 years ago

+1

raviten commented 7 years ago

+1

Arpita commented 7 years ago

+1

5nyper commented 7 years ago

+1

Nick-Hu1993 commented 6 years ago

same problem.