Logan icon indicating copy to clipboard operation
Logan copied to clipboard

日志解析报错

Open dlclover opened this issue 4 years ago • 8 comments

2020-12-18 16:06:59,732 ERROR [com.meituan.logan.web.parser.LoganProtocol] - java.io.EOFException: Unexpected end of ZLIB input stream, 2020-12-18 16:06:59,734 ERROR [com.meituan.logan.web.service.impl.LoganLogFileServiceDefaultImpl] - java.nio.BufferUnderflowException

安卓,ios上传的日志解析的时候都有一定概率,报该错误,问题出在哪里,有人遇到了吗

dlclover avatar Dec 18 '20 08:12 dlclover

有一定概率压缩结束符没写入,建议在app到前后台切换的时候调一下flush

Richard-Cao avatar Dec 21 '20 07:12 Richard-Cao

即使调用flush,理论上也无法从根本上杜绝结束符未写入问题吧?例如写入过程中app crash或者被系统回收。

是否可以考虑在Server的parser类中遇到开始符和结束符缺失的情况发生时,自动查找下一个开始或结束符? 或者是本地上传时进行一下开始符和结束符缺失检查。

rigortek avatar Jan 06 '21 09:01 rigortek

private static byte[] decompress(byte[] contentBytes) { try (ByteArrayOutputStream out = new ByteArrayOutputStream()) { IOUtils.copy(new GZIPInputStream(new ByteArrayInputStream(contentBytes)), out); return out.toByteArray(); } catch (IOException e) { LOGGER.error(e.toString()); } return new byte[0]; }

2021-01-19 22:12:02.627 ERROR 9066 --- [nio-9903-exec-1] c.m.l.w.s.impl.LoganTaskServiceImpl : java.io.EOFException: Unexpected end of ZLIB input stream

断点这个解析异常,有遇到吗?

wanggq654321 avatar Jan 19 '21 14:01 wanggq654321

报的就是这个错误,安卓端修改了就正常了

在 2021-01-19 22:52:17,"强哥" [email protected] 写道:

private static byte[] decompress(byte[] contentBytes) { try (ByteArrayOutputStream out = new ByteArrayOutputStream()) { IOUtils.copy(new GZIPInputStream(new ByteArrayInputStream(contentBytes)), out); return out.toByteArray(); } catch (IOException e) { LOGGER.error(e.toString()); } return new byte[0]; }

2021-01-19 22:12:02.627 ERROR 9066 --- [nio-9903-exec-1] c.m.l.w.s.impl.LoganTaskServiceImpl : java.io.EOFException: Unexpected end of ZLIB input stream

断点这个解析异常,有遇到吗?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

yishunli avatar Jan 22 '21 02:01 yishunli

我也遇到了这个错误,困扰了我好久了,跪求大神给出解决方案

luogengxian avatar Feb 26 '21 10:02 luogengxian

我也遇到了这个错误,困扰了我好久了,跪求大神给出解决方案

app切到后台的时候调一下flush

Richard-Cao avatar Mar 01 '21 02:03 Richard-Cao

这个错误客户端flush感觉没有解决根本原因,应该后端catch住,能解析多少解析多少.

@Richard-Cao 你好,请问有Logan相关的微信群吗?

zhuyangyang-lingoace avatar Sep 09 '21 11:09 zhuyangyang-lingoace

这个错误客户端flush感觉没有解决根本原因,应该后端catch住,能解析多少解析多少.

@Richard-Cao 你好,请问有Logan相关的微信群吗?

有的,你加我我拉你一下

Richard-Cao avatar Sep 10 '21 06:09 Richard-Cao

#466 服务端做了兜底,可以升级下服务端最新代码

wsxyeah avatar Mar 02 '23 03:03 wsxyeah