breaking functionality with netty-handler upgrade | 5.0.0.Alpha2

458 views
Skip to first unread message

vivek Baranwal

unread,
Aug 30, 2022, 3:28:35 AM8/30/22
to grpc.io
Hi Team,

I have upgraded netty-handler jar version recently from 4.1.77.Final to 5.0.0.Alpha2 but looks like my GRPC call is getting failed in between because of this upgrade.

After upgrading the above jar below is flow where it is getting failed. Issue is with the method  toInternalLevel present in LogLevel class under netty-handler jar. In earlier version(4.1.77.Final) of this jar this method had access modifier as public but in current version(5.0.0.Alpha2) public access modifier has been removed and because of that I am getting below exception.

"stackTrace": "java.lang.IllegalAccessError: tried to access method io.netty.handler.logging.LogLevel.toInternalLevel()Lio/netty/util/internal/logging/InternalLogLevel; from class io.netty.handler.codec.http2.Http2FrameLogger\n\tat io.netty.handler.codec.http2.Http2FrameLogger.checkAndConvertLevel(Http2FrameLogger.java:63)\n\tat io.netty.handler.codec.http2.Http2FrameLogger.<init>(Http2FrameLogger.java:54)\n\tat io.grpc.netty.NettyClientHandler.newHandler(NettyClientHandler.java:201)\n\tat io.grpc.netty.NettyClientHandler.newHandler(NettyClientHandler.java:158)\n\tat io.grpc.netty.NettyClientTransport.start(NettyClientTransport.java:217)\n\t... 9 frames truncated\n\t... 3 common frames omitted\nWrapped by: io.grpc.StatusRuntimeException: INTERNAL: Panic! This is a bug!\n\tat io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:271)\n\tat io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:252)\n\tat 


Code Flow:

NettyClientHandler(grpc-netty : 1.47.0):
Http2FrameLogger frameLogger = new Http2FrameLogger(LogLevel.DEBUG, NettyClientHandler.class);
|
|
Http2FrameLogger(netty-codec-http2 : 4.1.77.Final)
public Http2FrameLogger(LogLevel level, Class<?> clazz) {
        this(checkAndConvertLevel(level), InternalLoggerFactory.getInstance(checkNotNull(clazz, "clazz")));
    }
|
|
Http2FrameLogger(netty-codec-http2 : 4.1.77.Final)
private static InternalLogLevel checkAndConvertLevel(LogLevel level) {
return ((LogLevel)ObjectUtil.checkNotNull(level, "level")).toInternalLevel();
}
|
|
LogLevel(netty-handler : 5.0.0.Alpha2)
InternalLogLevel toInternalLevel() {
        return internalLevel;
    }

Thanks for any thoughts,
Vivek Baranwal

Eric Anderson

unread,
Aug 30, 2022, 8:24:45 PM8/30/22
to vivek Baranwal, grpc.io
On Tue, Aug 30, 2022 at 12:28 AM vivek Baranwal <vbara...@gmail.com> wrote:
I have upgraded netty-handler jar version recently from 4.1.77.Final to 5.0.0.Alpha2 but looks like my GRPC call is getting failed in between because of this upgrade.

You can't upgrade gRPC to Netty 5. The netty namespace is different. There's also lots of things we know would need to be fixed. The only way you could have done so is if you used the very-old-and-dead Netty 5 from 2015. 

Dead and useless. Was replaced with Netty 4.1:
io.netty:netty-codec:5.0.0.Alpha2

New and interesting, but you should use alpha 4:
io.netty:netty5-codec:5.0.0.Alpha2

tried to access method io.netty.handler.logging.LogLevel.toInternalLevel

See the "io.netty" package? That is the dead Netty 5 from 2015. The new Netty 5 has "io.netty5" package.
Reply all
Reply to author
Forward
0 new messages