Uploaded image for project: 'AMQ Streams'
  1. AMQ Streams
  2. ENTMQST-1812

Improve the exception thrown with wrong image configuration

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major Major
    • 1.5.0.GA
    • 1.4.0.GA
    • None
    • None

      When users - for example after incorrect upgrade - ends up with CO deployment with missing or misconfigured environment variable for image configuration they currently get this cryptic exception:

      Exception in thread "main" io.strimzi.operator.common.InvalidConfigurationException: io.strimzi.operator.cluster.model.NoImageException: No image for version 2.4.0
      	at io.strimzi.operator.cluster.ClusterOperatorConfig.parseKafkaVersions(ClusterOperatorConfig.java:204)
      	at io.strimzi.operator.cluster.ClusterOperatorConfig.fromMap(ClusterOperatorConfig.java:94)
      	at io.strimzi.operator.cluster.Main.main(Main.java:59)
      Caused by: io.strimzi.operator.cluster.model.NoImageException: No image for version 2.4.0
      	at io.strimzi.operator.cluster.model.KafkaVersion$Lookup.image(KafkaVersion.java:163)
      	at io.strimzi.operator.cluster.model.KafkaVersion$Lookup.validateKafkaMirrorMaker2Images(KafkaVersion.java:321)
      	at io.strimzi.operator.cluster.ClusterOperatorConfig.parseKafkaVersions(ClusterOperatorConfig.java:202)
      

      That doesn't really tell them much about the issue. Thsi PR improves the exception to make it more clear where the issue is:

      Exception in thread "main" io.strimzi.operator.common.InvalidConfigurationException: Failed to parse default container image configuration for Kafka Mirror Maker 2 from environment variable STRIMZI_KAFKA_MIRROR_MAKER_2_IMAGES
      	at io.strimzi.operator.cluster.ClusterOperatorConfig.parseKafkaVersions(ClusterOperatorConfig.java:222)
      	at io.strimzi.operator.cluster.ClusterOperatorConfig.fromMap(ClusterOperatorConfig.java:94)
      	at io.strimzi.operator.cluster.Main.main(Main.java:59)
      Caused by: io.strimzi.operator.cluster.model.NoImageException: No image for version 2.4.0
      	at io.strimzi.operator.cluster.model.KafkaVersion$Lookup.image(KafkaVersion.java:163)
      	at io.strimzi.operator.cluster.model.KafkaVersion$Lookup.validateKafkaMirrorMaker2Images(KafkaVersion.java:321)
      	at io.strimzi.operator.cluster.ClusterOperatorConfig.parseKafkaVersions(ClusterOperatorConfig.java:220)
      	... 2 more
      

      This should help users better identify the problems.

              Unassigned Unassigned
              scholzj JAkub Scholz
              Lukas Kral Lukas Kral
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: