Skip to content
Latchkey

Helm "pre-install hooks failed" in CI

A pre-install hook (often a Job that prepares a database or secret) failed before Helm installed the main release. Helm aborts the install and names the failing hook resource.

What this error means

helm install fails with "Error: INSTALLATION FAILED: pre-install hooks failed: ... job failed: BackoffLimitExceeded" and the main resources are never created.

helm
Error: INSTALLATION FAILED: pre-install hooks failed: warning: Hook pre-install
my-app/templates/init-job.yaml failed: job failed: BackoffLimitExceeded

Common causes

The hook Job command failed

The init command in the pre-install hook exited non-zero and exhausted its backoffLimit.

A dependency the hook needs is not ready

The hook depends on a database, secret, or service that does not exist yet at pre-install time.

How to fix it

Inspect the hook pod logs

  1. List Jobs in the namespace to find the hook.
  2. Read the failed pod logs for the actual error.
  3. Fix the command or its prerequisites, then reinstall.
Terminal
kubectl get jobs -n prod
kubectl logs job/my-app-init -n prod --previous

Order hooks with weights

Use helm.sh/hook-weight so prerequisite hooks run before dependent ones, and avoid pre-install hooks that need resources only created later.

How to prevent it

  • Keep hook commands idempotent and well logged.
  • Use hook weights to order setup steps correctly.
  • Avoid pre-install hooks that depend on the release's own resources.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →