Cmak: Unable to restart Kafka Manager using Docker Compose

Created on 16 Oct 2017  路  6Comments  路  Source: yahoo/CMAK

Hello,

I am using Kafka Manager run with Docker Compose with the following .yml:

kafka-manager:
    image: qnib/plain-kafka-manager
    network_mode: host
    environment:
      ZOOKEEPER_HOSTS: "localhost:2181"
      APPLICATION_SECRET: blabla
    restart: always

It starts and is working fine at 1 run. When i stop and start ig again after few minutes, i got the following error:

>> JMX_ENABLE:true, PROMETHEUS_JMX_ENABLE:false
> execute entrypoint '/opt/qnib/entry/30-kafka-manager.sh'
> execute CMD '/opt/qnib/kafka/manager/bin/start.sh'
This application is already running (Or delete /opt/kafka-manager/RUNNING_PID file).
[II] qnib/init-plain script v0.4.28
> execute entrypoint '/opt/entry/00-logging.sh'
> execute entrypoint '/opt/entry/10-docker-secrets.env'
[II] No /run/secrets directory, skip step
> execute entrypoint '/opt/entry/99-remove-healthcheck-force.sh'
> execute entrypoint '/opt/qnib/entry/19-configure-jmx.sh'
+ sed -i -e s/JMX_PORT/1234/g /opt/prometheus/jmx/default.yml
> execute entrypoint '/opt/qnib/entry/20-jmx-prometheus.env

Upon docker ps i can see the following:

CONTAINER ID        IMAGE                                   COMMAND                  CREATED             STATUS                            PORTS                    NAMES
2d9d2c866066        qnib/plain-kafka-manager                "/usr/local/bin/en..."   32 minutes ago      Restarting (255) 14 seconds ago                            webtools_kafka-manager_1

In order to run it, I have to remove that container and create it again, which is inconvenient in long term.
Any idea how to fix that? I checked ps -A but i do not see any Kafka Manager process running.

Most helpful comment

I am too using Kafka Manager with docker with following configuration:

kafka-manager: image: sheepkiller/kafka-manager environment: ZK_HOSTS: zoo:2181 depends_on: - kafka - zoo
I have same error:
This application is already running (Or delete /opt/kafka-manager/RUNNING_PID file).

This problem was fixed with configuration:
command: -Dpidfile.path=/dev/null

All 6 comments

I'm seeing the same behavior on my end. First time started, the container is fine. If I stop my containers, then docker-compose up again, kafka-manager starts throwing all kinds of exceptions in the log. Here's an example of the stack trace in the log when it happens:

kafka-manager_1 | [error] k.m.a.c.OffsetCacheActive - [topic=player.added] An error has occurred while getting topic offsets from broker List((BrokerIdentity(1001,127.0.0.1,9092,-1,false),0), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),1)) kafka-manager_1 | java.nio.channels.ClosedChannelException: null kafka-manager_1 | at kafka.network.BlockingChannel.send(BlockingChannel.scala:110) ~[org.apache.kafka.kafka_2.11-0.9.0.1.jar:na] kafka-manager_1 | at kafka.consumer.SimpleConsumer.liftedTree1$1(SimpleConsumer.scala:98) ~[org.apache.kafka.kafka_2.11-0.9.0.1.jar:na] kafka-manager_1 | at kafka.consumer.SimpleConsumer.kafka$consumer$SimpleConsumer$$sendRequest(SimpleConsumer.scala:83) ~[org.apache.kafka.kafka_2.11-0.9.0.1.jar:na] kafka-manager_1 | at kafka.consumer.SimpleConsumer.getOffsetsBefore(SimpleConsumer.scala:149) ~[org.apache.kafka.kafka_2.11-0.9.0.1.jar:na] kafka-manager_1 | at kafka.manager.actor.cluster.OffsetCache$$anonfun$18$$anonfun$20$$anonfun$21.apply(KafkaStateActor.scala:406) ~[kafka-manager.kafka-manager-1.3.1.8-sans-externalized.jar:na] kafka-manager_1 | at kafka.manager.actor.cluster.OffsetCache$$anonfun$18$$anonfun$20$$anonfun$21.apply(KafkaStateActor.scala:403) ~[kafka-manager.kafka-manager-1.3.1.8-sans-externalized.jar:na] kafka-manager_1 | at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24) ~[org.scala-lang.scala-library-2.11.8.jar:na] kafka-manager_1 | at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24) ~[org.scala-lang.scala-library-2.11.8.jar:na] kafka-manager_1 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_151] kafka-manager_1 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_151] kafka-manager_1 | [error] k.m.a.c.OffsetCacheActive - [topic=__consumer_offsets] An error has occurred while getting topic offsets from broker List((BrokerIdentity(1001,127.0.0.1,9092,-1,false),45), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),34), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),12), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),8), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),19), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),23), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),4), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),40), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),15), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),11), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),9), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),44), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),33), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),22), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),26), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),37), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),13), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),46), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),24), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),35), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),16), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),5), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),10), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),48), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),21), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),43), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),32), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),49), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),6), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),36), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),1), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),39), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),17), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),25), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),14), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),47), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),31), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),42), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),0), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),20), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),27), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),2), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),38), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),18), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),30), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),7), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),29), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),41), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),3), (BrokerIdentity(1001,127.0.0.1,9092,-1,false),28)) kafka-manager_1 | java.nio.channels.ClosedChannelException: null

I am too using Kafka Manager with docker with following configuration:

kafka-manager: image: sheepkiller/kafka-manager environment: ZK_HOSTS: zoo:2181 depends_on: - kafka - zoo
I have same error:
This application is already running (Or delete /opt/kafka-manager/RUNNING_PID file).

This problem was fixed with configuration:
command: -Dpidfile.path=/dev/null

This has been fixed in the latest version of https://hub.docker.com/r/qnib/plain-kafka-manager/

For reference for other people running into this issue and wanting to know why this fixes it, it's basic play-framework configuration: https://www.playframework.com/documentation/2.7.x/ProductionConfiguration#Changing-the-path-of-RUNNING_PID

Add command: -Dpidfile.path=/dev/null ao arquivo docker-compose.yml para resolver o problema.

I added the above to "command:" in my docker-compose. It worked but the co-located kafka-manager became unhappy. I removed it again and now both work. thanks @carlos2031 and @rmasgutov for the suggestions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

captainbupt picture captainbupt  路  8Comments

sanjeevtripurari picture sanjeevtripurari  路  4Comments

Angryrou picture Angryrou  路  4Comments

lm884612 picture lm884612  路  3Comments

jmax01 picture jmax01  路  4Comments