Nil pointer error when deploying Helm chart

  • Is this your first time deploying Airbyte?: Yes
  • Deployment: Helm chart
  • Airbyte Version: 0.35.66-alpha

Hi,

I’m trying to deploy the Airbyte Helm chart to our Kubernetes cluster. I have a folder structure set up like so:

chart
├── Chart.lock
├── Chart.yaml
├── subcharts
│   └── airbyte (manually copied from the repo)
├── templates
│   └── secret.yaml
└── values.yaml

In my chart.yaml, I’ve defined the airbyte chart as a local dependency:

apiVersion: v2
name: airbyte
type: application
version: 0.1.0
appVersion: "0.35.66-alpha"
dependencies:
  - name: airbyte
    version: 0.3.1
    repository: file://subcharts/airbyte

And in my values.yaml, I have the following:

airbyte:
  nameOverride: airbyte
  webapp:
    ingress:
      annotations:
        kubernetes.io/ingress.class: internal-nginx
      hosts:
        - airbyte.staging.example.com
  postgresql:
    enabled: true
    existingSecret: airbyte-db-secret

This secret is defined in templates/secret.yaml:

apiVersion: v1
kind: Secret
metadata:
  name: airbyte-db-secret
type: Opaque
data:
  postgresql-password: "examplepassword"

Now, when I try to deploy, I get the following error:

Error: template: airbyte/charts/airbyte/templates/worker/deployment.yaml:60:23: executing "airbyte/charts/airbyte/templates/worker/deployment.yaml" at <include "airbyte.database.secret.name" .>: error calling include: template: airbyte/charts/airbyte/templates/_helpers.tpl:78:50: executing "airbyte.database.secret.name" at <.Subcharts.postgresql>: nil pointer evaluating interface {}.postgresql
helm.go:81: [debug] template: airbyte/charts/airbyte/templates/worker/deployment.yaml:60:23: executing "airbyte/charts/airbyte/templates/worker/deployment.yaml" at <include "airbyte.database.secret.name" .>: error calling include: template: airbyte/charts/airbyte/templates/_helpers.tpl:78:50: executing "airbyte.database.secret.name" at <.Subcharts.postgresql>: nil pointer evaluating interface {}.postgresql

The offending code (in the Airbyte Helm chart) looks like this:

{{- define "airbyte.database.secret.name" -}}
{{- if .Values.postgresql.enabled -}}
    {{ template "postgresql.secretName" .Subcharts.postgresql }}
{{- else }}
    {{- if .Values.externalDatabase.existingSecret -}}
        {{- printf "%s" .Values.externalDatabase.existingSecret -}}
    {{- else -}}
        {{ printf "%s-%s" (include "common.names.fullname" .) "secrets" }}
    {{- end -}}
{{- end -}}
{{- end -}}

The line causing the error is {{ template "postgresql.secretName" .Subcharts.postgresql }}. Am I doing something wrong in how I’m deploying this?

Looks like this error occurs because the Helm chart requires Helm >= 3.7.0, and I was using an older version: Helm chart - move sensitive data to secret, refactor hard coded names by georgekaz · Pull Request #11020 · airbytehq/airbyte · GitHub

1 Like