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: this.newStreams.length != 0 #546

Closed
jwalton opened this issue Nov 19, 2019 · 8 comments
Closed

AssertionError: this.newStreams.length != 0 #546

jwalton opened this issue Nov 19, 2019 · 8 comments

Comments

@jwalton
Copy link

jwalton commented Nov 19, 2019

In the past couple of weeks, I've started seeing this assert:

https://github.com/squaremo/amqp.node/blob/v0.5.5/lib/mux.js#L92

being raised on my production servers a few times a day. Whenever it's raised, this.newStreams.length is always 28:

AssertionError [ERR_ASSERTION]: 0 == 28

at Mux._readIncoming (./node_modules/amqplib/lib/mux.js:92:12)
at Immediate._onImmediate (./node_modules/amqplib/lib/mux.js:112:12)
at processImmediate (internal/timers.js:439:21)
@squaremo
Copy link
Collaborator

I think this assertion firing was the motivation behind #503. Do you have the capacity to try master?

@squaremo
Copy link
Collaborator

Do you have the capacity to try master?

Ah, production server, probably not. Maybe you could try to produce the problem locally. But failing that, I should do a release soon.

@jwalton
Copy link
Author

jwalton commented Nov 20, 2019

I'm adventurous, and it looks like a simple enough change. I can try this on master for a day. :)

@jwalton
Copy link
Author

jwalton commented Nov 20, 2019

Hmm... I tried adding:

    "amqplib": "git://github.com/squaremo/amqp.node.git#90e0dc081b0f57aa6eff4e24ae3f56da12aa57eb",

to my package.json, but I'm getting this error:

Error: Cannot find module './defs'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/home/runner/work/loop/loop/node_modules/amqplib/lib/connection.js:7:12)
    at Module._compile (internal/modules/cjs/loader.js:778:30)

I'm guessing this is something generated? Any easy way to run master? :P

@cressie176
Copy link
Collaborator

Hi @jwalton,

It think you'll need to run prepare to generate the defs. I suspect it hasn't worked due to the git dependency, although the the docs imply otherwise...

prepare: Run both BEFORE the package is packed and published, on local npm install without any arguments, and when installing git dependencies (See below). This is run AFTER prepublish, but BEFORE prepublishOnly.

You might find running npm install locally with no arguments does the trick too.

@jwalton
Copy link
Author

jwalton commented Nov 22, 2019

Ok, I took a little hackery to get my ci pipeline to run npm prepare (if you run npm prune --production npm overwrites the amqplib package, so I have to run it quite late in my Dockerfile, and at that point I'm in an image without make or curl -_-), but I got it going. I also realized this was failing quite a bit on my staging environment, too, so I don't even have to push this to production. :)

@jwalton
Copy link
Author

jwalton commented Nov 25, 2019

This does seem to have fixed the assert issue for me in my staging environment (one of my processes was restarting about 5 times an hour, and it hasn't restarted at all since I upgrade amqplib to master). I guess we need a new release @squaremo. :D

@cressie176
Copy link
Collaborator

Believe the fix was released.

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

3 participants