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

Unexpected character ('<') error processing Java SDK response payload #268

Open
mattdonnelly opened this issue Jan 8, 2020 · 11 comments
Open
Labels

Comments

@mattdonnelly
Copy link

mattdonnelly commented Jan 8, 2020

This error does not occur consistently but there have been multiple reports of it. It possibly happens when the API times out and we try to parse the response. We should handle this case more gracefully.

Logs

[81da96743b246a37] could not parse error response: [Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
at [Source: (sun.net.www.protocol.http.HttpURLConnection$HttpInputStream); line: 1, column: 2]] com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') at [Source: (sun.net.www.protocol.http.HttpURLConnection$HttpInputStream); line: 1, column: 2] at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1804) ~[jackson-core-2.9.6.jar:2.9.6]
@PatrickDugan42
Copy link

I'm experiencing the same issue. This is happening on user update calls. Had several occur at 6:20, 6:29, and 6:34 pm CST on Jan 09, 2020. It seems to be very intermittent issue but I can't identify a cause.

com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
at [Source: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@5d32eec6; line: 1, column: 2]
at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1702)
at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:558)
at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:456)
at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._handleUnexpectedValue(UTF8StreamJsonParser.java:2689)
at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._nextTokenNotInObject(UTF8StreamJsonParser.java:878)
at com.fasterxml.jackson.core.json.UTF8StreamJsonParser.nextToken(UTF8StreamJsonParser.java:772)
at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:3850)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3799)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2924)
at io.intercom.api.HttpClient.handleError(HttpClient.java:162)
at io.intercom.api.HttpClient.runRequest(HttpClient.java:155)
at io.intercom.api.HttpClient.executeHttpMethod(HttpClient.java:110)
at io.intercom.api.HttpClient.post(HttpClient.java:100)
at io.intercom.api.DataResource.update(DataResource.java:35)
at io.intercom.api.User.update(User.java:55)

@gabrielbreshears
Copy link

gabrielbreshears commented Jan 10, 2020

customer's error message:

2020-01-08 10:56:52,447 [blendernetworks] [173.230.149.47] [pool-3-thread-2660] WARN SsaIntercomEventTask:e= error{code='unprocessable_entity', message='could not parse error response: [Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') at [Source: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@338c1002; line: 1, column: 2]] logged with code [ee6a7dd7b27107b3]'} io.intercom.api.Error@76200492

@gabrielbreshears
Copy link

gabrielbreshears commented Feb 4, 2020

Customer wrote in again looking for updates

"Please don't forget to keep me posted regarding the intermittent API issue . It's important because requests are not being handled and data integrity is damaged."

@AdamRaken
Copy link

I am seeing this as well - I think that occasionally we get an error page with HTML, which starts with a '<' rather than JSON characters. There were 4 events in the latest <storm, 2 at 2020-02-19T01:00:48.521Z and 2 at 2020-02-19T01:00:41.426Z. It would be awesome to cut these off my list of alerts.

@nootherday
Copy link

It also happened to me as well.

Handling JsonParseException by myself is quiet strange to me, (code readability point of view)
Please make error response as json format. At least handle JsonParseException inside Intercom lib and convert it into something like IntercomException.

@lukashruby
Copy link

Happens to me as well.
[ERROR] [pool-30-thread-1] [2020-Oct-21 13:00:19 PM] [intercom-java] - [2d139b11bddf109c] could not parse error response: [Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')

@JialieY
Copy link

JialieY commented Mar 5, 2021

Anyone has solution?
I met the same error, kinda of blocked here.

@sanketkhandekar86
Copy link

@JialieY you need to use restTemplate.getInterceptors()

@bettercallavi
Copy link

getting error

com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
at [Source: (byte[])"<TITLE>Request on loopback from external IP</TITLE>

@Bolajiadesina
Copy link

Has anyone found a fix to this error?

@tesfai-optum
Copy link

Any solution for this issue???

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

No branches or pull requests