confluentinc / cp-all-in-one

docker-compose.yml files for cp-all-in-one , cp-all-in-one-community, cp-all-in-one-cloud, Apache Kafka Confluent Platform
951 stars 680 forks source link

Control-Center not able to connect to Kafka-Connect cluster #94

Closed ntx-ben closed 1 year ago

ntx-ben commented 2 years ago

Description Using the cp-all-in-one-kraft docker-compose file with confluentinc/cp-kafka-connect:7.1.1.amd64 and confluentinc/cp-enterprise-control-center:7.1.1.amd64 , kafka-connect is showing errors in the logs as follows:

[2022-06-04 14:38:15,210] ERROR Uncaught exception in REST call to /v1/metadata/id (org.apache.kafka.connect.runtime.rest.errors.ConnectExceptionMapper)
javax.ws.rs.NotFoundException: HTTP 404 Not Found
        at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:252)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:244)
        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265)
        at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:234)
        at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:680)
        at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394)
        at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:366)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:319)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:550)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1434)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:234)
        at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:179)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
        at org.eclipse.jetty.server.Server.handle(Server.java:516)
        at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:400)
        at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:645)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:392)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
        at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:137)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
        at java.base/java.lang.Thread.run(Thread.java:829)

It seems control-center is sending those requests (i.e. /v1/metadata/id) to kafka-connect and as a result shows that no kafka-connect clusters can be found.

Using confluentinc/cp-enterprise-control-center:6.2.0 does not exhibit this issue.

Environment

vsinha1105 commented 2 years ago

I am also facing the same issue. In fact for me, control-center is not even starting up. Its not able to connect to brokers

compose file I am using is as below:

`--- version: '2' services: zookeeper: image: confluentinc/cp-zookeeper:7.1.0 hostname: zookeeper container_name: zookeeper ports:

Machine Details: Mac m1 pro Docker version 20.10.14, build a224086 Docker Compose version v2.5.1

portovep commented 2 years ago

@vsinha1105 I managed to solve my control-center not even starting up issue by increasing the Docker VM memory specs from 2GB to 8GB.

Badgerr commented 2 years ago

Hi all. I am facing the same issue. Steps to reproduce:

  1. Download https://github.com/confluentinc/cp-all-in-one/blob/7.1.1-post/cp-all-in-one/docker-compose.yml
  2. Change connect.image to confluentinc/cp-kafka-connect:7.1.1.
  3. Start up docker compose and check that: 3.1. UI shows "No Connect Clusters Found" 3.2. curl http://127.0.0.1:8083/v1/metadata/id returns {"error_code":404,"message":"HTTP 404 Not Found"}. The same request returns {"id":"","scope":{"path":[],"clusters":{"kafka-cluster":"***","connect-cluster":"compose-connect-group"}}} for the default cnfldemos/cp-server-connect-datagen:0.5.3-7.1.0 image.
nicolepastrana commented 2 years ago

This is what worked for me in my M1 Chip:

https://github.com/confluentinc/cp-all-in-one/blob/7.1.1-post/cp-all-in-one/docker-compose.yml

thiagohsp commented 2 years ago

Same error here, using confluentinc/cp-kafka-connect:7.1.1 as connect image and confluentinc/cp-enterprise-control-center:7.1.1 for control-center.

ybyzek commented 2 years ago

What do folks here think about the proposal in https://github.com/confluentinc/cp-all-in-one/pull/99#issuecomment-1188491079 ?

OneCricketeer commented 2 years ago

The original issue reports using a Windows host, albeit using ARM images. Let's not mix it up with issues related to M1 Macs

Badgerr commented 2 years ago

Figured out finally. confluent.controlcenter.connect.healthcheck.endpoint should be /connectors in accordance with the documentation https://docs.confluent.io/platform/current/control-center/installation/configuration.html#general.

thiagohsp commented 2 years ago

Figured out finally. confluent.controlcenter.connect.healthcheck.endpoint should be /connectors in accordance with the documentation https://docs.confluent.io/platform/current/control-center/installation/configuration.html#general.

At docker-compose enviroment configuration, wich should be this property name? I tried CONTROL_CENTER_CONNECT_HEALTHCHECK_ENDPOINT and nothing change, still getting same error.

OneCricketeer commented 2 years ago

tried CONTROL_CENTER_CONNECT_HEALTHCHECK_ENDPOINT and nothing change

You need the whole variable name with confluent

CONTROL_CENTER_CONFLUENT_CONTROLCENTER_CONNECT_HEALTHCHECK_ENDPOINT

dhinojosa commented 2 years ago

On edit: accidentally captured the wrong one

It's actually CONTROL_CENTER_CONNECT_HEALTHCHECK_ENDPOINT. That ought to fix it, tried it on mine, and it links up well.

 control-center:
        image: confluentinc/cp-enterprise-control-center:7.2.1
        hostname: control-center
        container_name: control-center
        depends_on:
            - broker
            - schema-registry
            - connect
            - ksqldb-server
        ports:
            - "9021:9021"
        environment:
            CONTROL_CENTER_BOOTSTRAP_SERVERS: 'broker:29092'
            CONTROL_CENTER_CONNECT_CONNECT-DEFAULT_CLUSTER: 'http://connect:8083'
            CONTROL_CENTER_KSQL_KSQLDB1_URL: "http://ksqldb-server:8088"
            CONTROL_CENTER_KSQL_KSQLDB1_ADVERTISED_URL: "http://localhost:8088"
            CONTROL_CENTER_SCHEMA_REGISTRY_URL: "http://schema-registry:8081"
            CONTROL_CENTER_REPLICATION_FACTOR: 1
            CONTROL_CENTER_INTERNAL_TOPICS_PARTITIONS: 1
            CONTROL_CENTER_MONITORING_INTERCEPTOR_TOPIC_PARTITIONS: 1
            CONTROL_CENTER_CONNECT_HEALTHCHECK_ENDPOINT: '/connectors'
            CONFLUENT_METRICS_TOPIC_REPLICATION: 1
            PORT: 9021

Here are the results:

image

davetroiano commented 1 year ago

The connect image to use with Control Center is confluentinc/cp-server-connect rather than confluentinc/cp-kafka-connect. confluentinc/cp-server-connect is the base image for cnfldemos/cp-server-connect-datagen in cp-all-in-one, and confluentinc/cp-kafka-connect is the base image for cnfldemos/kafka-connect-datagen in cp-all-in-one-community.

Given this, I don't see any change needed in the Docker compose file(s) but perhaps this should be clarified in documentation for people who don't want to use cnfldemos/cp-server-connect-datagen? Could folks on this thread chime in as to why they made this change? Was it to get past OS support issues, or did anyone do it because they didn't want datagen packaged?

related: For a while, the confluentinc/cp-* images supported arm64 while cnfldemos/cp-server-connect-datagen did not, so were people making this change in order to get M1 support? Note that the latest cnfldemos/cp-server-connect-datagen:0.6.0-7.2.1 in 7.2.2-post does now support arm64

davetroiano commented 1 year ago

Closing this out since it seems n/a anymore - please comment or reopen if there are docs or other changes desired!

Raghav2211 commented 1 year ago

@ntx-ben @vsinha1105 working one https://github.com/Raghav2211/cp-all-in-one/commit/7ea5f21093872c4bc8f5ecdeb75c7e967c322f73