Closed thiagorizzo closed 2 years ago
Can you please share the full log from the Kafka Connect pods?
@scholzj It's the full log:
Preparing truststore
Preparing truststore is complete
Starting Kafka Connect with configuration:
# Bootstrap servers
bootstrap.servers=...
# REST Listeners
rest.port=8083
rest.advertised.host.name=10.162.128.210
rest.advertised.port=8083
# Plugins
plugin.path=/opt/kafka/plugins
# Provided configuration
offset.storage.topic=connect-cluster-offsets
value.converter=org.apache.kafka.connect.json.JsonConverter
config.storage.topic=connect-cluster-configs
key.converter=org.apache.kafka.connect.json.JsonConverter
group.id=data-connect-cluster
status.storage.topic=connect-cluster-status
config.storage.replication.factor=3
offset.storage.replication.factor=3
status.storage.replication.factor=3
security.protocol=SASL_PLAINTEXT
producer.security.protocol=SASL_PLAINTEXT
consumer.security.protocol=SASL_PLAINTEXT
admin.security.protocol=SASL_PLAINTEXT
sasl.mechanism=PLAIN
sasl.jaas.config=[hidden]
producer.sasl.mechanism=PLAIN
producer.sasl.jaas.config=[hidden]
consumer.sasl.mechanism=PLAIN
consumer.sasl.jaas.config=[hidden]
admin.sasl.mechanism=PLAIN
admin.sasl.jaas.config=[hidden]
# Additional configuration
client.rack=
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:513)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:525)
Caused by: java.io.FileNotFoundException: /opt/kafka/custom-config/metrics-config.yml (No such file or directory)
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
at java.base/java.io.FileReader.<init>(FileReader.java:75)
at io.prometheus.jmx.shaded.io.prometheus.jmx.JmxCollector.<init>(JmxCollector.java:78)
at io.prometheus.jmx.shaded.io.prometheus.jmx.JavaAgent.premain(JavaAgent.java:29)
... 6 more
*** java.lang.instrument ASSERTION FAILED ***: "result" with message agent load/premain call failed at ./src/java.instrument/share/native/libinstrument/JPLISAgent.c line: 422
FATAL ERROR in native method: processing of -javaagent failed, processJavaStart failed
Hmm, I thought it will show a bit more. What is the container image you use for the pod?
Because Strimzi 0.30 does nto use metrics-config.yaml
at all It uses metric-config.json
. So I suspect your image is based on some much older Strimzi version and not on 0.30.0.
Its my env variables for operator:
STRIMZI_DEFAULT_CRUISE_CONTROL_IMAGE:quay.io/strimzi/kafka:0.30.0-kafka-3.2.0
STRIMZI_DEFAULT_JMXTRANS_IMAGE:quay.io/strimzi/jmxtrans:0.30.0
STRIMZI_DEFAULT_KAFKA_BRIDGE_IMAGE:quay.io/strimzi/kafka-bridge:0.21.6
STRIMZI_DEFAULT_KAFKA_EXPORTER_IMAGE:quay.io/strimzi/kafka:0.30.0-kafka-3.2.0
STRIMZI_DEFAULT_KAFKA_INIT_IMAGE:quay.io/strimzi/operator:0.30.0
STRIMZI_DEFAULT_KANIKO_EXECUTOR_IMAGE:quay.io/strimzi/kaniko-executor:0.30.0
STRIMZI_DEFAULT_MAVEN_BUILDER:quay.io/strimzi/maven-builder:0.30.0
STRIMZI_DEFAULT_TLS_SIDECAR_ENTITY_OPERATOR_IMAGE:quay.io/strimzi/kafka:0.30.0-kafka-3.2.0
STRIMZI_DEFAULT_TOPIC_OPERATOR_IMAGE:quay.io/strimzi/operator:0.30.0
STRIMZI_DEFAULT_USER_OPERATOR_IMAGE:quay.io/strimzi/operator:0.30.0
STRIMZI_FEATURE_GATES:
STRIMZI_FULL_RECONCILIATION_INTERVAL_MS:120000
STRIMZI_KAFKA_CONNECT_IMAGES:3.1.0=quay.io/strimzi/kafka:0.30.0-kafka-3.1.0 3.1.1=quay.io/strimzi/kafka:0.30.0-kafka-3.1.1 3.2.0=quay.io/strimzi/kafka:0.30.0-kafka-3.2.0
STRIMZI_KAFKA_IMAGES:3.1.0=quay.io/strimzi/kafka:0.30.0-kafka-3.1.0 3.1.1=quay.io/strimzi/kafka:0.30.0-kafka-3.1.1 3.2.0=quay.io/strimzi/kafka:0.30.0-kafka-3.2.0
STRIMZI_KAFKA_MIRROR_MAKER_2_IMAGES:3.1.0=quay.io/strimzi/kafka:0.30.0-kafka-3.1.0 3.1.1=quay.io/strimzi/kafka:0.30.0-kafka-3.1.1 3.2.0=quay.io/strimzi/kafka:0.30.0-kafka-3.2.0
STRIMZI_KAFKA_MIRROR_MAKER_IMAGES:3.1.0=quay.io/strimzi/kafka:0.30.0-kafka-3.1.0 3.1.1=quay.io/strimzi/kafka:0.30.0-kafka-3.1.1 3.2.0=quay.io/strimzi/kafka:0.30.0-kafka-3.2.0
STRIMZI_NAMESPACE:*
STRIMZI_OPERATION_TIMEOUT_MS:300000
STRIMZI_OPERATOR_NAMESPACE:fieldRef(v1:metadata.namespace)
Well, I don't think that is the case. Because if you use the settings above and the KafkaConnect
CR you shared above which does nto have any .spec.image
setting, then it will not give you the same error, because it does not use the YAML file:
$ docker run -ti quay.io/strimzi/kafka:0.30.0-kafka-3.2.0 cat kafka_connect_run.sh | grep metrics-config
KAFKA_OPTS="${KAFKA_OPTS} -javaagent:$(ls "$KAFKA_HOME"/libs/jmx_prometheus_javaagent*.jar)=9404:$KAFKA_HOME/custom-config/metrics-config.json"
As I said above, it is using custom-config/metrics-config.json
and not custom-config/metrics-config.yml
whcih is used in your error message. So you have to be using another container image.
@scholzj you are right, its "strimzi/kafka:0.20.1-kafka-2.6.0"
Right, so you need to update to the image for correct Strimzi and Kafka version and you should be fine.
Kafka has good backwards compatibility. So I think Connect from Kafka 3.2.0 should work fine with Kafka 2.4.1. But if you want to stick with Kafka 2.4.1 for Connect, you should not use Strimzi 0.30 which supports only Kafka 3.2 and 3.2. You need to use some older Strimzi version which supports such an old Kfka version.
@scholzj great! gonna try it, thank you very much :D
@scholzj it worked, just updated the images. thanks
Great. So I guess we can close this?
Sure, thanks again @scholzj
Describe the bug Kafka Connect metrics doesnt works
Error Log:
Exception in thread "main" java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:513) at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:525) Caused by: java.io.FileNotFoundException: /opt/kafka/custom-config/metrics-config.yml (No such file or directory) at java.base/java.io.FileInputStream.open0(Native Method) at java.base/java.io.FileInputStream.open(FileInputStream.java:219) at java.base/java.io.FileInputStream.(FileInputStream.java:157)
at java.base/java.io.FileReader.(FileReader.java:75)
at io.prometheus.jmx.shaded.io.prometheus.jmx.JmxCollector.(JmxCollector.java:78)
at io.prometheus.jmx.shaded.io.prometheus.jmx.JavaAgent.premain(JavaAgent.java:29)
... 6 more
java.lang.instrument ASSERTION FAILED : "result" with message agent load/premain call failed at ./src/java.instrument/share/native/libinstrument/JPLISAgent.c line: 422
FATAL ERROR in native method: processing of -javaagent failed, processJavaStart failed
To Reproduce Steps to reproduce the behavior:
Expected behavior
Kafka up and running with metrics enabled
Environment (please complete the following information):
YAML files and logs
KafkaConnect:
ConfigMap: