mafintosh / mafintosh/hls-buffer
Cannot read property 'statusCode' of undefined and Error: connect ENOENT /path.m3u8
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 37
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
Hello, I am getting a strange error.
```
TypeError: Cannot read property 'statusCode' of undefined`
at Request._callback (/node-index-page/node_modules/hls-buffer/index.js:30:17)
at self.callback (/node-index-page/node_modules/hls-buffer/node_modules/request/request.js:129:22)
at emitOne (events.js:115:13)
at Request.emit (events.js:210:7)
at ClientRequest.self.clientErrorHandler (/node-index-page/node_modules/hls-buffer/node_modules/request/request.js:239:10)
at emitOne (events.js:120:20)
at ClientRequest.emit (events.js:210:7)
at Socket.socketErrorListener (_http_client.js:385:9)
at emitOne (events.js:115:13)
at Socket.emit (events.js:210:7)
at emitErrorNT (internal/streams/destroy.js:64:8)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickDomainCallback (internal/process/next_tick.js:218:9)
```
Which is caused by this line https://github.com/mafintosh/hls-buffer/blob/master/index.js#L30 because there is no error check. Which I can offer my help. So with a help of a global request logger I have managed to get the actual request and its error which is:
```
{
port: 80,
path: '/tjktv.m3u8',
host: 'tjktv.ercdn.net',
href: 'http://tjktv.ercdn.net/tjktv.m3u8',
method: 'GET',
headers: { host: 'tjktv.ercdn.net' },
error: {
Error: connect ENOENT /tjktv.m3u8
at Object._errnoException (util.js:1021:11)
at _exceptionWithHostPort (util.js:1043:20)
at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1175:14)
code: 'ENOENT',
errno: 'ENOENT',
syscall: 'connect',
address: '/tjktv.m3u8'
}
}
```
When I `curl http://tjktv.ercdn.net/tjktv.m3u8`
```
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1050000,NAME=576p,RESOLUTION=1024x576
tjktv_576p.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=770000,NAME=480p,RESOLUTION=845x480
tjktv_480p.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=520000,NAME=360P,RESOLUTION=640x360
tjktv_360p.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=260000,NAME=240P,RESOLUTION=426x240
tjktv_240p.m3u8
```
My initialization code is same as in the README.md
I can offer my help for the first one but I have no idea why the second one is happening. Project is running on node:8.7.0-slim
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with index.js line 30, which the report identifies as the source of the undefined statusCode error, and compare its request handling with the README.md initialization example. Reproduce the request against the provided HLS URL and inspect the reported ENOENT details. Done means the failure behavior and its expected handling are established for both errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- audio-video-rtc
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100