Skip to content

[ISSUE] Template error: missing elasticsearch.commonLabels field causes deployment failure #4146

@leiicamundi

Description

@leiicamundi

Helm Template Error: elasticsearch.commonLabels Type Mismatch

Describe the issue:

Helm template error occurs when deploying Camunda Platform with external Elasticsearch configuration where the elasticsearch section only contains enabled: false without the required commonLabels field.

Actual behavior:

Helm deployment fails with the following error:

Error: UPGRADE FAILED: template: camunda-platform/templates/z/1/2/3/4/5/6/7/8/z_compatibility_helpers.tpl:471:30: executing "camunda-platform/templates/z/1/2/3/4/5/6/7/8/z_compatibility_helpers.tpl" at <.Values.elasticsearch.commonLabels>: wrong type for value; expected map[string]interface {}; got interface {}

Expected behavior:

Helm deployment should succeed even when elasticsearch.enabled is set to false and external Elasticsearch is used through operators (like ECK).

How to reproduce:

  1. Create a values file with external Elasticsearch configuration
  2. Set elasticsearch.enabled: false without defining commonLabels
  3. Deploy using Helm: helm upgrade --install camunda oci://ghcr.io/camunda/helm/camunda-platform
  4. The deployment fails with the template error

Example problematic configuration:

global:
  elasticsearch:
    enabled: true
    external: true
    # ... other config

elasticsearch:
  enabled: false  # Missing commonLabels field

Logs:

Error: UPGRADE FAILED: template: camunda-platform/templates/z/1/2/3/4/5/6/7/8/z_compatibility_helpers.tpl:471:30: executing "camunda-platform/templates/z/1/2/3/4/5/6/7/8/z_compatibility_helpers.tpl" at <.Values.elasticsearch.commonLabels>: wrong type for value; expected map[string]interface {}; got interface {}

Environment:

  • Platform: OpenShift / Kubernetes (operator-based deployment)
  • Helm CLI version: 3.x.x
  • Chart version: 0.0.0-snapshot-latest (development version)
  • Values file: External Elasticsearch configuration with ECK operator

Fix:

Add the commonLabels field as an empty map to the elasticsearch section:

elasticsearch:
  enabled: false
  commonLabels: {}

This ensures the Helm template has the correct data type (map) instead of defaulting to interface{} when the field is undefined.

Root Cause:

The Helm template z_compatibility_helpers.tpl at line 471 expects .Values.elasticsearch.commonLabels to be a map type, but when this field is not explicitly defined in the values file, it defaults to an interface{} type, causing the template rendering to fail.

Solution Applied:

Modified the values.yml file to include the missing commonLabels field with an empty map value, ensuring proper type compatibility with the Helm template expectations.

PR: #4180

Metadata

Metadata

Assignees

Labels

kind/issueUnidentified issue, it could be a bug, misconfig, or anything in betweenplatform/openshiftIssues related to OpenShifttarget:8.8Target release 8.8.0

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions