[Question][Critical] java.lang.IllegalArgumentException: illegal packet [magic]72
encountered the same issue, how to fix
version: 1.3.4
[ERROR] 2021-04-07 00:01:14.406 org.apache.dolphinscheduler.remote.handler.NettyClientHandler:[184] - exceptionCaught : {}
io.netty.handler.codec.DecoderException: java.lang.IllegalArgumentException: illegal packet [magic]72
at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:421)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:278)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1408)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:930)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:677)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:612)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:529)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:491)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:905)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: illegal packet [magic]72
at org.apache.dolphinscheduler.remote.codec.NettyDecoder.checkMagic(NettyDecoder.java:98)
at org.apache.dolphinscheduler.remote.codec.NettyDecoder.decode(NettyDecoder.java:53)
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:502)
at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:366)
... 15 common frames omitted
[ERROR] 2021-04-07 00:01:14.407 org.apache.dolphinscheduler.remote.handler.NettyClientHandler:[184] - exceptionCaught : {}
io.netty.handler.codec.DecoderException: java.lang.IllegalArgumentException: illegal packet [magic]84
at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:421)
at io.netty.handler.codec.ReplayingDecoder.channelInputClosed(ReplayingDecoder.java:329)
at io.netty.handler.codec.ByteToMessageDecoder.channelInputClosed(ByteToMessageDecoder.java:372)
at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:355)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:245)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:231)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:224)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelInactive(DefaultChannelPipeline.java:1403)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:245)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:231)
at io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:912)
at io.netty.channel.AbstractChannel$AbstractUnsafe$8.run(AbstractChannel.java:826)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:495)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:905)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: illegal packet [magic]84
at org.apache.dolphinscheduler.remote.codec.NettyDecoder.checkMagic(NettyDecoder.java:98)
at org.apache.dolphinscheduler.remote.codec.NettyDecoder.decode(NettyDecoder.java:53)
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:502)
at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:366)
... 16 common frames omitted
[ERROR] 2021-04-07 00:38:45.120 org.apache.dolphinscheduler.remote.handler.NettyServerHandler:[153] - exceptionCaught : java.lang.IllegalArgumentException: illegal packet [magic]72
io.netty.handler.codec.DecoderException: java.lang.IllegalArgumentException: illegal packet [magic]72
at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:421)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:278)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1408)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:930)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:677)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:612)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:529)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:491)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:905)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: illegal packet [magic]72
at org.apache.dolphinscheduler.remote.codec.NettyDecoder.checkMagic(NettyDecoder.java:98)
at org.apache.dolphinscheduler.remote.codec.NettyDecoder.decode(NettyDecoder.java:53)
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:502)
at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:366)
... 15 common frames omitted
[ERROR] 2021-04-07 00:38:45.121 org.apache.dolphinscheduler.remote.handler.NettyServerHandler:[153] - exceptionCaught : java.lang.IllegalArgumentException: illegal packet [magic]69
io.netty.handler.codec.DecoderException: java.lang.IllegalArgumentException: illegal packet [magic]69
at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:421)
at io.netty.handler.codec.ReplayingDecoder.channelInputClosed(ReplayingDecoder.java:329)
at io.netty.handler.codec.ByteToMessageDecoder.channelInputClosed(ByteToMessageDecoder.java:372)
at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:355)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:245)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:231)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:224)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelInactive(DefaultChannelPipeline.java:1403)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:245)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:231)
at io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:912)
at io.netty.channel.AbstractChannel$AbstractUnsafe$8.run(AbstractChannel.java:826)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:495)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:905)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: illegal packet [magic]69
at org.apache.dolphinscheduler.remote.codec.NettyDecoder.checkMagic(NettyDecoder.java:98)
at org.apache.dolphinscheduler.remote.codec.NettyDecoder.decode(NettyDecoder.java:53)
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:502)
at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:366)
... 16 common frames omitted
_Originally posted by @wynn45de in https://github.com/apache/incubator-dolphinscheduler/issues/4134
Thanks for your feedback, I need some time to test. btw, please submit the standardized ISSUE according to the ISSUE template
Thank you for your feedback, any progress ?
@wynn45de I can't reproduce this problem on 1.3.4-release, it is better to provide more information, such as what operation was performed, in which module the exception was reported, thanks.
deploy mode : docker the exception was found in master logs, when a process was triggered, one task of the process was stuck at status "Submit Success" and keep this status all the time
@wynn45de What type of the task? :grimacing:
it's not a base task in DS, we do some rebuild and enhancement ,the task is defined by ourself. I don't think the type of task is a key issue
it's not a base task in DS, we do some rebuild and enhancement ,the task is defined by ourself. I don't think the type of task is a key issue
It seems that the task has been submitted to DB success and dispatch to worker failed.
Did you modify the protocol ? Each message sent should start with MAGIC, you can check in the NettyEncoder and NettyDecoder. BTY, Did all tasks fail?
@wynn45de Did you try the latest version 1.3.6 with docker? In 1.3.4 release of docker, there are some problems
2021-06-16 20:33:36.095 INFO org.apache.curator.framework.state.ConnectionStateManager:[251] - State change: CONNECTED 2021-06-16 20:33:47.439 ERROR org.apache.dolphinscheduler.remote.handler.NettyServerHandler:[153] - exceptionCaught : java.lang.IllegalArgumentException: illegal packet [magic]71 io.netty.handler.codec.DecoderException: java.lang.IllegalArgumentException: illegal packet [magic]71 at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:421) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:795) at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:475) at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:378) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.IllegalArgumentException: illegal packet [magic]71 at org.apache.dolphinscheduler.remote.codec.NettyDecoder.checkMagic(NettyDecoder.java:118) at org.apache.dolphinscheduler.remote.codec.NettyDecoder.decode(NettyDecoder.java:54) at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:501) at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:366) ... 14 common frames omitted
2021-06-16 20:33:36.095 INFO org.apache.curator.framework.state.ConnectionStateManager:[251] - State change: CONNECTED 2021-06-16 20:33:47.439 ERROR org.apache.dolphinscheduler.remote.handler.NettyServerHandler:[153] - exceptionCaught : java.lang.IllegalArgumentException: illegal packet [magic]71 io.netty.handler.codec.DecoderException: java.lang.IllegalArgumentException: illegal packet [magic]71 at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:421) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:795) at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:475) at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:378) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.IllegalArgumentException: illegal packet [magic]71 at org.apache.dolphinscheduler.remote.codec.NettyDecoder.checkMagic(NettyDecoder.java:118) at org.apache.dolphinscheduler.remote.codec.NettyDecoder.decode(NettyDecoder.java:54) at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:501) at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:366) ... 14 common frames omitted
1.3.6 version
Can you provide steps to reproduce? At present, I can't determine the problem, it seems that the magic numbers are inconsistent. But I can't determine the specific problem.
I installed 4 workers on 4 machine. I also got this error
[ERROR] 2021-06-26 00:04:10.332 org.apache.dolphinscheduler.remote.handler.NettyServerHandler:[152] - exceptionCaught : java.lang.IllegalArgumentException: illegal packet [magic]-1
io.netty.handler.codec.DecoderException: java.lang.IllegalArgumentException: illegal packet [magic]-1
at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:421)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:795)
at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:475)
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:378)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: illegal packet [magic]-1
at org.apache.dolphinscheduler.remote.codec.NettyDecoder.checkMagic(NettyDecoder.java:125)
at org.apache.dolphinscheduler.remote.codec.NettyDecoder.decode(NettyDecoder.java:57)
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:501)
at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:366)
... 14 common frames omitted
Every worker machine's log has this log.
It would be nice to have specific information, at the moment I don't think it's a DS question. The magic number checksum failure indicates that the sender message format does not match. Maybe you should check if another client has tried to send a message to DS.(I'm just stating a possible scenario)
It is possible that use the other monitoring system , and the health check calls the same port. I just encountered this problem, and fix by changing the health check port .
no update.
2024, i still meeted this bug...........
I just encountered this issue as well and found out that it was caused by a vulnerability scanning tool installed on the cloud server, which periodically scans the 1234 port that the Netty Server is listening on. Therefore, this is not a bug but may be related to your machine and environment. Please check if there are any other applications or tools accessing this port.
If the Java Prometheus JMX (exporter) does not specify a port, it will by default scan all available ports—including DolphinScheduler’s Netty default port 1234—which leads to a protocol mismatch and results in “illegal packet [magic]”. Please check whether any similar monitoring services are scanning host ports.