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 · 6 comments
Open

Uncaught exception: AssertionError [ERR_ASSERTION] #43

SergeyFromHell opened this issue Aug 29, 2018 · 6 comments

Comments

@SergeyFromHell
Copy link

@SergeyFromHell SergeyFromHell commented Aug 29, 2018

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

This comment has been minimized.

Copy link

@pavelbinar pavelbinar commented Jun 27, 2019

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

This comment has been minimized.

Copy link

@tnolet tnolet commented Sep 5, 2019

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

@pqvst

This comment has been minimized.

Copy link

@pqvst pqvst commented Oct 23, 2019

Any way to work around this issue?

@jjason685

This comment has been minimized.

Copy link

@jjason685 jjason685 commented Nov 17, 2019

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

This comment has been minimized.

Copy link

@pavelbinar pavelbinar commented Nov 18, 2019

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

@gsouf

This comment has been minimized.

Copy link

@gsouf 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.