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

Uncaught exception: AssertionError [ERR_ASSERTION] #43

Open
SergeyFromHell opened this issue Aug 29, 2018 · 8 comments
Open

Uncaught exception: AssertionError [ERR_ASSERTION] #43

SergeyFromHell opened this issue Aug 29, 2018 · 8 comments

Comments

@SergeyFromHell
Copy link

In function onConnect you use assert.equal(head.length,0).
If assertion fails, it leads to uncaught process exception.
Please process this as an error so than exception is not beign thrown to nowhere.

This problem arises when I use request module and working with bad proxies.

@pavelbinar
Copy link

Having same issue while using proxy and "non existing domain" url

const options = {
    uri: url,
    timeout: requestTimeout,
    resolveWithFullResponse: true,
    proxy: `http://${process.env.PROXY_USERNAME}:${process.env.PROXY_PASSWORD}@us.smartproxy.com:10000`
  }

@tnolet
Copy link

tnolet commented Sep 5, 2019

Bumped into exactly the same error in a batch process which killed the whole thing.

@pqvst
Copy link

pqvst commented Oct 23, 2019

Any way to work around this issue?

@jjason685
Copy link

process.on('uncaughtException', err => { if (err.name === 'AssertionError') { console.log('Assertion error', err); } });

Only way to avoid this even though it isn't exactly good practice. Alternatively, you could rebuild the tunnel-agent library, but this is a fast solution if you're being lazy.

@pavelbinar
Copy link

I ended up with own fix fork: remoteorigin@0907b7b

@gsouf
Copy link

gsouf commented Mar 18, 2020

Same here:

2020-03-16T16:36:39.613Z   throw new AssertionError(obj);
2020-03-16T16:36:39.615Z   ^
2020-03-16T16:36:39.617Z 
2020-03-16T16:36:39.620Z AssertionError [ERR_ASSERTION]: 3824 == 0
2020-03-16T16:36:39.622Z     at ClientRequest.onConnect (/home/myuser/node_modules/tunnel-agent/index.js:160:14)
2020-03-16T16:36:39.624Z     at Object.onceWrapper (events.js:286:20)
2020-03-16T16:36:39.626Z     at ClientRequest.emit (events.js:198:13)
2020-03-16T16:36:39.628Z     at Socket.socketOnData (_http_client.js:484:11)
2020-03-16T16:36:39.630Z     at Socket.emit (events.js:198:13)
2020-03-16T16:36:39.632Z     at addChunk (_stream_readable.js:288:12)
2020-03-16T16:36:39.634Z     at readableAddChunk (_stream_readable.js:269:11)
2020-03-16T16:36:39.636Z     at Socket.Readable.push (_stream_readable.js:224:10)
2020-03-16T16:36:39.638Z     at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)

@pavelbinar
Copy link

Fix pending on PR: #51
since Nov 18, 2019

@9178angel
Copy link

hi is anyone merging this issue? I really need to get it fixed... tnx

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

7 participants