Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

self.req undefined? - Cannot read property '_reusedSocket' of undefined #417

Closed
edsu opened this Issue · 1 comment

2 participants

@edsu

I'm putting a lot of traffic through request.get to resolve shortened URLs. I noticed that after my program has run for a bit it throws an exception:

/home/ubuntu/node_modules/request/main.js:221
    if (self.req._reusedSocket && error.code === 'ECONNRESET'
                ^
TypeError: Cannot read property '_reusedSocket' of undefined
    at ClientRequest.Request.init.self.clientErrorHandler (/home/ubuntu/node_modules/request/main.js:221:17)
    at ClientRequest.EventEmitter.emit (events.js:96:17)
    at Socket.socketOnData (http.js:1435:9)
    at TCP.onread (net.js:404:27)
ubuntu@ip-10-145-181-135:~$ vi /home/ubuntu/node_modules/request/main.js

which looks like self.req is undefined.

It seems non-deterministic, since it fails after processing a few thousand URLs, when fetching a URL ... but the particular URL changes from run to run, with the exact same input.

Any advice would be welcome.

@mikeal mikeal referenced this issue from a commit
@mikeal mikeal Fix for #417 53c1508
@mikeal
Owner

you're getting an error emitted before that actual request goes out. i can't tell what the error is but i know it's before the request actually goes out so this should resolve the throw you're seeing and now you'll get the real error. the real error may still throw since i doubt any handlers have been added to it this early but at least you'll be able to find and debug the real problem.

@mikeal mikeal closed this
@kppullin kppullin referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@ravi ravi referenced this issue in sylvinus/node-crawler
Closed

Upgrade version of Request #61

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.