com.google.gson.stream.MalformedJsonException: Invalid escape sequence at line #7858
Unanswered
ProgramCareer
asked this question in
Q&A
Replies: 1 comment 7 replies
-
You are using newer agent to send data old backend? Read our compatibility document. |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
2021-09-28 09:58:28,087 - org.apache.skywalking.oap.server.analyzer.agent.kafka.provider.handler.LogHandler - 83 [KafkaConsumer-1-thread-2] ERROR [] - com.google.gson.stream.MalformedJsonException: Invalid escape sequence at line 1 column 685 path $.body.text.text
com.google.protobuf.InvalidProtocolBufferException: com.google.gson.stream.MalformedJsonException: Invalid escape sequence at line 1 column 685 path $.body.text.text
at com.google.protobuf.util.JsonFormat$ParserImpl.merge(JsonFormat.java:1347) ~[protobuf-java-util-3.12.4.jar:?]
at com.google.protobuf.util.JsonFormat$Parser.merge(JsonFormat.java:477) ~[protobuf-java-util-3.12.4.jar:?]
at org.apache.skywalking.oap.server.library.util.ProtoBufJsonUtils.fromJSON(ProtoBufJsonUtils.java:54) ~[library-util-8.6.0.jar:8.6.0]
Source code
private static String toString(byte[] b, int off, int len) {
StringBuilder result = new StringBuilder();
if (b == null) {
return result.toString();
} else if (off >= b.length) {
return result.toString();
} else {
if (off + len > b.length) {
len = b.length - off;
}
for(int i = off; i < off + len; ++i) {
int ch = b[i] & 255;
if (ch >= 32 && ch <= 126 && ch != 92) {
result.append((char)ch);
} else {
//The following processing results in an error**
result.append("\x");
result.append(HEX_CHARS_UPPER[ch / 16]);
result.append(HEX_CHARS_UPPER[ch % 16]);
}
}
return result.toString();
}
}
Beta Was this translation helpful? Give feedback.
All reactions