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

AssertionError: false == true #228

Open
dinfyru opened this issue Dec 23, 2016 · 19 comments
Open

AssertionError: false == true #228

dinfyru opened this issue Dec 23, 2016 · 19 comments

Comments

@dinfyru
Copy link

dinfyru commented Dec 23, 2016

node -v 6.9.2
[email protected]

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

@dinfyru dinfyru changed the title Sending illegal frame (DATA) in CLOSED state. and AssertionError: false == true AssertionError: false == true Dec 23, 2016
@mutaphore
Copy link

Getting the same issue:
Node v6.7.0
[email protected]

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
Copy link

mattisx commented Jan 10, 2017

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
Copy link

+1

@sbeff
Copy link

sbeff commented Feb 5, 2017

+1

3 similar comments
@IsaiahJTurner
Copy link

+1

@davidbnk
Copy link

davidbnk commented Feb 8, 2017

+1

@mihai-iorga
Copy link

+1

@zliebersbach
Copy link

@molnarg Pls.

@mihai-iorga
Copy link

+1

3 similar comments
@axmav
Copy link

axmav commented Feb 19, 2017

+1

@divydeep
Copy link

+1

@virgafox
Copy link

+1

@thughes
Copy link

thughes commented Feb 22, 2017

@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
Copy link

+1

1 similar comment
@bbcelly
Copy link

bbcelly commented Mar 6, 2017

+1

thughes added a commit to airtimemedia/node-http2 that referenced this issue Mar 7, 2017
Fixes molnarg#228

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 the assert:

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

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

  return moreNeeded;

Credit goes to @jrabek for original version of this patch
florianreinhart pushed a commit to node-apn/node-http2 that referenced this issue Mar 15, 2017
Fixes molnarg#228

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 the assert:

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

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

  return moreNeeded;

Credit goes to @jrabek for original version of this patch
@raviten
Copy link

raviten commented Apr 4, 2017

+1

2 similar comments
@Arpita
Copy link

Arpita commented Apr 14, 2017

+1

@5nyper
Copy link

5nyper commented May 2, 2017

+1

@Nick-Hu1993
Copy link

same problem.

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