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

[Bug]: CO logs StringIndexOutOfBoundsException when tag is not specified for KafkaConnect build #8472

Closed
Frawless opened this issue May 4, 2023 · 1 comment · Fixed by #8484

Comments

@Frawless
Copy link
Member

Frawless commented May 4, 2023

Bug Description

When a user doesn't specify a tag in DockerOutput part of KafkaConnect build, the image is built and pushed but CO cannot pull it into KafkaConnect pod with the following error:

2023-05-03 20:40:52 DEBUG AbstractOperator:568 - Reconciliation #80(timer) KafkaConnect(infra-namespace/my-cluster-831aae8e): Updated metric strimzi.resource.state[tag(kind=KafkaConnect),tag(name=my-cluster-831aae8e),tag(reason=begin -1, end 42, length 42),tag(resource-namespace=infra-namespace)] = 0
2023-05-03 20:40:52 WARN  AbstractOperator:525 - Reconciliation #80(timer) KafkaConnect(infra-namespace/my-cluster-831aae8e): Failed to reconcile
java.lang.StringIndexOutOfBoundsException: begin -1, end 42, length 42
	at java.lang.String.checkBoundsBeginEnd(String.java:4602) ~[?:?]
	at java.lang.String.substring(String.java:2705) ~[?:?]
	at java.lang.String.substring(String.java:2678) ~[?:?]
	at io.strimzi.operator.cluster.operator.assembly.ConnectBuildOperator.lambda$openShiftBuildWaitForFinish$29(ConnectBuildOperator.java:382) ~[io.strimzi.cluster-operator-0.35.0-SNAPSHOT.jar:0.35.0-SNAPSHOT]
	at io.vertx.core.impl.future.Composition.onSuccess(Composition.java:38) ~[io.vertx.vertx-core-4.3.8.jar:4.3.8]
	at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60) ~[io.vertx.vertx-core-4.3.8.jar:4.3.8]
	at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:211) ~[io.vertx.vertx-core-4.3.8.jar:4.3.8]
	at io.vertx.core.impl.future.Composition$1.onSuccess(Composition.java:62) ~[io.vertx.vertx-core-4.3.8.jar:4.3.8]
	at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60) ~[io.vertx.vertx-core-4.3.8.jar:4.3.8]
	at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:211) ~[io.vertx.vertx-core-4.3.8.jar:4.3.8]
	at io.vertx.core.impl.future.PromiseImpl.tryComplete(PromiseImpl.java:23) ~[io.vertx.vertx-core-4.3.8.jar:4.3.8]
	at io.vertx.core.impl.future.PromiseImpl.onSuccess(PromiseImpl.java:49) ~[io.vertx.vertx-core-4.3.8.jar:4.3.8]
	at io.vertx.core.impl.future.FutureBase.lambda$emitSuccess$0(FutureBase.java:54) ~[io.vertx.vertx-core-4.3.8.jar:4.3.8]
	at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) ~[io.netty.netty-common-4.1.87.Final.jar:4.1.87.Final]
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) ~[io.netty.netty-common-4.1.87.Final.jar:4.1.87.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[io.netty.netty-common-4.1.87.Final.jar:4.1.87.Final]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569) ~[io.netty.netty-transport-4.1.87.Final.jar:4.1.87.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[io.netty.netty-common-4.1.87.Final.jar:4.1.87.Final]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[io.netty.netty-common-4.1.87.Final.jar:4.1.87.Final]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[io.netty.netty-common-4.1.87.Final.jar:4.1.87.Final]
	at java.lang.Thread.run(Thread.java:833) ~[?:?]

The error should be more user-friendly that will tell to users what is really wrong.

Steps to reproduce

Deploy KafkaConnect with the following configuration

apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaConnect 
metadata:
  name: my-connect-cluster
  annotations:
    strimzi.io/use-connector-resources: "true" 
spec:
  ...
  build:
    output:
      type: docker
      image: my-registry.io/my-org/my-connect-cluster # without tag
      pushSecret: my-registry-credentials

Expected behavior

CO will log some user-friendly error messages instead of StringIndexOutOfBoundsException

Strimzi version

main

Kubernetes version

OpenShift 4.13

Installation method

YAML files

Infrastructure

Openstack

Configuration files and logs

No response

Additional context

No response

@scholzj
Copy link
Member

scholzj commented May 4, 2023

Triaged on 4.5.2023: We should add a proper validation that the tag section is present in the image.

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

Successfully merging a pull request may close this issue.

2 participants