apify / proxy-chain

Node.js implementation of a proxy server (think Squid) with support for SSL, authentication and upstream proxy chaining.

Home Page:https://www.npmjs.com/package/proxy-chain

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: Cannot read property 'pipe' of null

sapiensmalti opened this issue · comments

Null trgSocket breaks Apify Actor run (see attached log for more details).

2020-02-04T14:32:40.741Z /home/myuser/node_modules/proxy-chain/build/handler_tunnel_chain.js:110
2020-02-04T14:32:40.743Z             this.trgSocket.pipe(this.srcSocket);
2020-02-04T14:32:40.745Z                            ^
2020-02-04T14:32:40.747Z 
2020-02-04T14:32:40.749Z TypeError: Cannot read property 'pipe' of null
2020-02-04T14:32:40.751Z     at HandlerTunnelChain.onTrgRequestConnect (/home/myuser/node_modules/proxy-chain/build/handler_tunnel_chain.js:110:28)
2020-02-04T14:32:40.753Z     at Object.onceWrapper (events.js:313:26)
2020-02-04T14:32:40.755Z     at ClientRequest.emit (events.js:223:5)
2020-02-04T14:32:40.758Z     at Socket.socketOnData (_http_client.js:490:11)
2020-02-04T14:32:40.760Z     at Socket.emit (events.js:223:5)
2020-02-04T14:32:40.762Z     at addChunk (_stream_readable.js:309:12)
2020-02-04T14:32:40.764Z     at readableAddChunk (_stream_readable.js:290:11)
2020-02-04T14:32:40.766Z     at Socket.Readable.push (_stream_readable.js:224:10)
2020-02-04T14:32:40.768Z     at TCP.onStreamRead (internal/stream_base_commons.js:181:23)

On Apify platform, Node.js v12.14.1, NPM version 6.13.4.

Apparently, the apify package was using an old version of proxy-chain package, which might have caused this issue. Fixing this in apify/crawlee@9cf05dc

Closing this now, please re-open the issue if it appears again with the new version.