> ## Documentation Index
> Fetch the complete documentation index at: https://www.qovery.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Helm upgrade failed: context deadline exceeded

> A cluster update or a Helm service fails with Helm timed out, UPGRADE FAILED or context deadline exceeded. Find the resource that never became ready, then fix it or raise the timeout.

A cluster update or the deployment of a Helm service fails with an error like:

```text theme={null}
Helm timed out for release vertical-pod-autoscaler during helm UPGRADE: Error: UPGRADE FAILED: an error occurred while rolling back the release. original upgrade error: context deadline exceeded
```

For your own charts, the release name is the one of your Helm service, and the error can also read `INSTALL FAILED` or `timed out waiting for the condition`.

## What the error means

Helm installed or upgraded the release, then waited for its pods and jobs to become ready. They did not become ready before the timeout, so Helm stopped and rolled the release back. The timeout is the symptom: the cause is a pod that could not be scheduled, could not start, or never passed its readiness check.

## During a cluster update

When the release is a Qovery component (for example `vertical-pod-autoscaler`, `ingress-nginx`, `cert-manager`), the cluster update could not start the new version of that component. The most common reason is a full cluster: the new pods cannot be scheduled because no node has room, and the cluster cannot add nodes.

1. Open the cluster **Logs** and look, a few lines before the timeout, for a scheduling message such as `0/3 nodes are available: 3 Insufficient memory`.
2. Give the cluster room: raise the maximum number of nodes, allow larger instance types, or raise the node pool limits. See [Insufficient cpu or memory](https://www.qovery.com/docs/getting-started/troubleshoot/insufficient-cpu.md).
3. Update the cluster again.

A cluster with a fixed number of nodes (same minimum and maximum) cannot add a node during the update. If its nodes are full, the extra pods the update needs have no room. Allow at least one more node than you run day to day.

## During the deployment of a Helm service

**1. Find the resource that is not ready**

Connect to the cluster (see [Connect to your cluster](https://www.qovery.com/docs/configuration/connect-to-cluster.md)) and watch the namespace of the environment while you deploy:

```bash theme={null}
kubectl get pods -n <environment-namespace> --watch
kubectl get events -n <environment-namespace> --sort-by=.lastTimestamp
```

A pod in `Pending` cannot be scheduled. A pod in `ImagePullBackOff` cannot pull its image. A pod in `CrashLoopBackOff` starts and crashes: read its logs with `kubectl logs <pod> -n <namespace> --previous`. A pod `Running` but not `Ready` fails its readiness probe.

**2. Check the values**

Every `qovery.env.<NAME>` in your values override must match a variable available to the Helm service, with the same case. A value that is not replaced, or a chart key with a typo, often leaves a pod unable to connect to its database. See [Environment variables in values](https://www.qovery.com/docs/configuration/helm.md#environment-variables-in-values).

**3. Raise the timeout if the chart is slow**

Some charts need more time on first install, for example to create CRDs or run database migrations. Raise the timeout of the Helm service in its general settings (default 300 seconds), or add a Helm argument such as `--timeout 15m0s` in the **Arguments** field. See [Helm](https://www.qovery.com/docs/configuration/helm.md).

### Charts that wait for their own hooks (Apache Airflow)

Some charts run a job as a Helm hook, for example database migrations, and start pods that wait for that job to finish. If Helm waits for those pods to be ready before it runs the hook, neither side can progress, and the release times out however long the timeout is.

The Apache Airflow chart is the most common case: its pods wait in `wait-for-airflow-migrations` and the migration job never starts. Turn off Helm hooks for its jobs in your values override, so they run as normal jobs:

```yaml theme={null}
createUserJob:
  useHelmHooks: false
  applyCustomEnv: false
migrateDatabaseJob:
  useHelmHooks: false
  applyCustomEnv: false
```

Check the documentation of your chart for an equivalent option.

### The chart deploys, but the Console shows it as not running

Qovery finds the pods of a Helm service through its labels and annotations. If your chart does not set them, the deployment can succeed while the Console shows no pods and no logs. Add the `qovery.labels.service` and `qovery.annotations.service` macros to the templates of your chart. See [Helm service logging limitations](https://www.qovery.com/docs/getting-started/troubleshoot/overview.md#service-runtime-issues).

## Still stuck?

Contact Qovery support from the Console: click the help button at the bottom right, then **Contact Support**. You can also post in your dedicated Slack channel. Include the Console URL of the service, the deployment ID or the time of the error, and the error line from the logs. See [Help and Support](https://www.qovery.com/docs/getting-started/useful-resources/help-and-support.md).


## Related topics

- [0/1 nodes are available: 1 Insufficient cpu. No preemption victims found](https://www.qovery.com/docs/getting-started/troubleshoot/insufficient-cpu.md)
- [Troubleshooting](https://www.qovery.com/docs/getting-started/troubleshoot/overview.md)
- [Helm Charts](https://www.qovery.com/docs/configuration/helm.md)
- [Commands Overview](https://www.qovery.com/docs/cli/commands/overview.md)
- [BackoffLimitExceeded: Job has reached the specified backoff limit](https://www.qovery.com/docs/getting-started/troubleshoot/job-backoff-limit-exceeded.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.