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

java.lang.ClassCastException: io.netty.channel.epoll.EpollEventLoopGroup cannot be cast to io.netty.channel.EventLoopGroup #31

Closed
mateen-dar opened this issue Dec 10, 2020 · 12 comments
Assignees

Comments

@mateen-dar
Copy link

Setting up Kafka Connect with Redis 6
v 0.0.2.11
Confluent version v 6.0.0

java.lang.ClassCastException: io.netty.channel.epoll.EpollEventLoopGroup cannot be cast to io.netty.channel.EventLoopGroup\n\t
at io.lettuce.core.resource.DefaultEventLoopGroupProvider.getOrCreate(DefaultEventLoopGroupProvider.java:119)\n\t
at io.lettuce.core.resource.DefaultEventLoopGroupProvider.allocate(DefaultEventLoopGroupProvider.java:65)\n\t
at io.lettuce.core.AbstractRedisClient.getEventLoopGroup(AbstractRedisClient.java:187)\n\t
at io.lettuce.core.AbstractRedisClient.channelType(AbstractRedisClient.java:173)\n\t
at io.lettuce.core.RedisClient.getConnectionBuilder(RedisClient.java:343)\n\t
at io.lettuce.core.RedisClient.connectStatefulAsync(RedisClient.java:291)\n\t
at io.lettuce.core.RedisClient.connectStandaloneAsync(RedisClient.java:274)\n\t
at io.lettuce.core.RedisClient.connect(RedisClient.java:207)\n\t
at com.github.jcustenborder.kafka.connect.redis.RedisSessionFactoryImpl$RedisSessionImpl.create(RedisSessionFactoryImpl.java:166)\n\t
at com.github.jcustenborder.kafka.connect.redis.RedisSessionFactoryImpl.create(RedisSessionFactoryImpl.java:52)\n\t
at com.github.jcustenborder.kafka.connect.redis.RedisSinkTask.start(RedisSinkTask.java:73)\n\t
at org.apache.kafka.connect.runtime.WorkerSinkTask.initializeAndStart(WorkerSinkTask.java:302)\n\t
at org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:193)\n\t
at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:185)\n\t
at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:235)\n\t
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n\t
at java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\t
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\t
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\t
at java.lang.Thread.run(Thread.java:748)\n"

@jruaux
Copy link

jruaux commented Mar 5, 2021

Having the same issue with Confluent Platform 6.1.0 and it also happens with this other Redis connector: https://github.com/jaredpetersen/kafka-connect-redis
I'm guessing it's a class loader issue introduced in Confluent 6.

@jcustenborder
Copy link
Owner

Sorry I just noticed this. It's most likely cause plugin isolation pulls in the classpath from the connect worker. I'll look into a patch shortly.

@jcustenborder
Copy link
Owner

Ok did a little research. It looks like we (I work at Confluent) have changed the version of netty a couple times. Classpath isolation inherits the classpath from the worker so that means this is the version we're getting each time. Easiest workaround you for my connector and https://github.com/jaredpetersen/kafka-connect-redis would be to see if there is a compatible version of lettuce that uses a compatible version of netty and recompile against that. I'll take a deeper look tomorrow. Sorry for the delayed response. I didn't see the notification come in from @mateen-dar.

./confluent-6.1.0/share/java/kafka/netty-all-4.1.51.Final.jar
./confluent-6.1.0/share/java/kafka/netty-buffer-4.1.51.Final.jar
./confluent-6.1.0/share/java/kafka/netty-codec-4.1.51.Final.jar
./confluent-6.1.0/share/java/kafka/netty-codec-http2-4.1.51.Final.jar
./confluent-6.1.0/share/java/kafka/netty-codec-http-4.1.51.Final.jar
./confluent-6.1.0/share/java/kafka/netty-codec-socks-4.1.51.Final.jar
./confluent-6.1.0/share/java/kafka/netty-common-4.1.51.Final.jar
./confluent-6.1.0/share/java/kafka/netty-handler-4.1.51.Final.jar
./confluent-6.1.0/share/java/kafka/netty-handler-proxy-4.1.51.Final.jar
./confluent-6.1.0/share/java/kafka/netty-resolver-4.1.51.Final.jar
./confluent-6.1.0/share/java/kafka/netty-tcnative-boringssl-static-2.0.34.Final.jar
./confluent-6.1.0/share/java/kafka/netty-transport-4.1.51.Final.jar
./confluent-6.1.0/share/java/kafka/netty-transport-native-epoll-4.1.51.Final.jar
./confluent-6.1.0/share/java/kafka/netty-transport-native-epoll-4.1.51.Final-linux-x86_64.jar
./confluent-6.1.0/share/java/kafka/netty-transport-native-unix-common-4.1.51.Final.jar
./confluent-6.0.1/share/java/kafka/netty-all-4.1.50.Final.jar
./confluent-6.0.1/share/java/kafka/netty-buffer-4.1.50.Final.jar
./confluent-6.0.1/share/java/kafka/netty-codec-4.1.50.Final.jar
./confluent-6.0.1/share/java/kafka/netty-common-4.1.50.Final.jar
./confluent-6.0.1/share/java/kafka/netty-handler-4.1.50.Final.jar
./confluent-6.0.1/share/java/kafka/netty-resolver-4.1.50.Final.jar
./confluent-6.0.1/share/java/kafka/netty-tcnative-boringssl-static-2.0.30.Final.jar
./confluent-6.0.1/share/java/kafka/netty-transport-4.1.50.Final.jar
./confluent-6.0.1/share/java/kafka/netty-transport-native-epoll-4.1.50.Final.jar
./confluent-6.0.1/share/java/kafka/netty-transport-native-unix-common-4.1.50.Final.jar

@jruaux
Copy link

jruaux commented Mar 6, 2021

I tried with older versions of Lettuce (5.2.1, 5.3.3, 6.0.0) with varying versions of Netty to no avail. Did you have any luck?

@jonathanfox82
Copy link

Any workaround for this issue?

@jcustenborder
Copy link
Owner

Try removing the netty jars from the connector. That seems to do it.

@jonathanfox82
Copy link

Perfect thanks.

@DenysFaure
Copy link

Hi guys,
Any news on this issue?

@jcustenborder
Copy link
Owner

The workaround above seems to work. I will be releasing a new version soon

@jruaux
Copy link

jruaux commented Mar 23, 2021

The workaround worked for me:

<dependency>
    <groupId>io.lettuce</groupId>
    <artifactId>lettuce-core</artifactId>
    <version>6.0.2.RELEASE</version>
    <exclusions>
        <exclusion>
            <groupId>io.netty</groupId>
            <artifactId>*</artifactId>
        </exclusion>
    </exclusions>
</dependency>

@DenysFaure
Copy link

Are there any plans to update docker image https://hub.docker.com/r/jcustenborder/kafka-connect-all ?

@jcustenborder
Copy link
Owner

@DenysFaure I updated that docker image for you. Going forward I'm not going to be deprecating that docker image. I would recommend moving to my cp-kafka-connect or my cp-server-connect-operator. These images are tagged based on the version of the Confluent platform they are using. This allows me to support several versions of connect workers for Confluent Platform and Confluent Operator installs.

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

No branches or pull requests

5 participants