logdna / logdna-agent

LogDNA Agent streams from log files to your LogDNA account. Works with Linux, Windows, and macOS Servers
https://logdna.com
MIT License
138 stars 55 forks source link

Cannot read property 'statusCode' of undefined #148

Closed kevincennis closed 4 years ago

kevincennis commented 4 years ago

As far as I can tell, this error was introduced in this commit.

On line 73 of linebuffer.js, there's a check to see if res.statusCode === 207 – but this occurs before checking to see if there was an error.

2019-12-09 20:33:05 0000 [error] uncaught error: TypeError: Cannot read property 'statusCode' of undefined
    at Request.posthandler [as _callback] (/usr/bin/lib/linebuffer.js:73:17)
    at self.callback (/usr/bin/node_modules/request/request.js:185:22)
    at Request.emit (events.js:210:5)
    at Request.onRequestError (/usr/bin/node_modules/request/request.js:881:8)
    at ClientRequest.emit (events.js:210:5)
    at TLSSocket.socketErrorListener (_http_client.js:406:9)
    at TLSSocket.emit (events.js:210:5)
    at emitErrorNT (internal/streams/destroy.js:92:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
smusali commented 4 years ago

Hi @kevincennis,

Thanks for reporting this!

It should be fixed now - can you purge and reinstall the agent with the same instructions?

Please, let us know how it goes!

kevincennis commented 4 years ago

All set. Thanks!