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

Unspecified error from Loggly: SyntaxError: Unexpected token < in JSON at position 0 #70

Open
NickMihaiu91 opened this issue Aug 4, 2017 · 2 comments

Comments

@NickMihaiu91
Copy link

NickMihaiu91 commented Aug 4, 2017

Hello,
In the last few days, we got quite a few errors that seem to be from inside the node loggly library.

The error looks like this:

json: level:error message:Unhandled promise rejection: Unspecified error from Loggly: SyntaxError: Unexpected token < in JSON at position 0 stack:Error: Unspecified error from Loggly: SyntaxError: Unexpected token < in JSON at position 0 at /root/fstg-service-monolith/node_modules/loggly/lib/loggly/client.js:161:18 at Request._callback (/root/fstg-service-monolith/node_modules/loggly/lib/loggly/common.js:139:7) at Request.self.callback (/root/fstg-service-monolith/node_modules/loggly/node_modules/request/request.js:187:22) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7) at Request.<anonymous> (/root/fstg-service-monolith/node_modules/loggly/node_modules/request/request.js:1048:10) at emitOne (events.js:96:13) at Request.emit (events.js:188:7) at IncomingMessage.<anonymous> (/root/fstg-service-monolith/node_modules/loggly/node_modules/request/request.js:969:12) at emitNone (events.js:91:20) at IncomingMessage.emit (events.js:185:7) at endReadableNT (_stream_readable.js:974:12) at _combinedTickCallback (internal/process/next_tick.js:80:11) at process._tickDomainCallback (internal/process/next_tick.js:128:9)

It's occurring quite a lot on our part. We wrote to the Loggly support and they suggested also opening an issue here: "This is the first report of this kind we received. I also suggest to report it to the GitHub page of the library that you are using for a wider visibility to the community.".

It seems that we get an error response that is probably HTML and not JSON so node-loggly breaks because it can't handle this. Any idea on why this happens?

Thank you,
Nick

@mostlyjason
Copy link

Nick this is not an officially supported Loggly library. It was created by someone in the community. The official library is here https://github.com/loggly/node-loggly-bulk/

@NickMihaiu91
Copy link
Author

Thank you for pointing this out @mostlyjason, but we're using this library not the official library and the problem seems to be in the library so it made sense to open the issue here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants