confluentinc / confluent-cli

Confluent Platform CLI
Other
60 stars 38 forks source link

Confluent CLI log misses error & stack trace #56

Closed rmoff closed 6 years ago

rmoff commented 6 years ago

Connect fails to start, but with confluent log connect the stacktrace & error is missed, making it appear that it's just hung.

With Confluent CLI:

$ confluent start connect
$ confluent log connect
[...]
[2018-01-03 12:07:10,336] INFO Loading plugin from: /Users/Robin/git/kafka-connect-twitter/target/classes (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:179)
(END)

Run directly

rmoff@proxmox01 ~/confluent-4.0.0> ./bin/connect-distributed ./etc/schema-registry/connect-avro-distributed.properties
[...]
[2018-01-03 11:40:33,856] INFO Loading plugin from: /home/rmoff/kafka-connect-twitter/target/classes (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:179)
Exception in thread "main" java.lang.NoClassDefFoundError: com/github/jcustenborder/kafka/connect/utils/VersionUtil
        at com.github.jcustenborder.kafka.connect.twitter.TwitterSourceConnector.version(TwitterSourceConnector.java:41)
        at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.getPluginDesc(DelegatingClassLoader.java:279)
        at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.scanPluginPath(DelegatingClassLoader.java:260)
        at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.scanUrlsAndAddPlugins(DelegatingClassLoader.java:201)
        at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.registerPlugin(DelegatingClassLoader.java:193)
        at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.initLoaders(DelegatingClassLoader.java:153)
        at org.apache.kafka.connect.runtime.isolation.Plugins.<init>(Plugins.java:47)
        at org.apache.kafka.connect.cli.ConnectDistributed.main(ConnectDistributed.java:70)
Caused by: java.lang.ClassNotFoundException: com.github.jcustenborder.kafka.connect.utils.VersionUtil
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at org.apache.kafka.connect.runtime.isolation.PluginClassLoader.loadClass(PluginClassLoader.java:62)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 8 more
rmoff commented 6 years ago

Currently start_service writes stdout and stderr to separate files:

    ${start_command} "${service_dir}/${service}.properties" \
        2> "${service_dir}/${service}.stderr" \
        1> "${service_dir}/${service}.stdout" &

But confluent log only exposes the stdout file

    local service_log="${service_dir}/${service}.stdout"
[...]
    less "$service_log"

So either the stderr should be exposed another way (back to the user who invoked the confluent command), or stderr and stdout should be routed to the same log file.

kkonstantine commented 6 years ago

Consolidation of stderr with stdout to a single logfile was merged and backported.