Troubleshooting#
Use this section to resolve issues that can occur during a Helm upgrade.
StatefulSet immutable field error#
If helm upgrade fails with an error similar to the following, the new
chart version changed an immutable field in one or more StatefulSet
specs:
UPGRADE FAILED: cannot patch "msr4-harbor-database" with kind StatefulSet:
StatefulSet.apps "msr4-harbor-database" is invalid: spec: Forbidden:
updates to statefulset spec for fields other than 'replicas', 'ordinals',
'template', 'updateStrategy', 'revisionHistoryLimit',
'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden
Kubernetes does not allow in-place updates to StatefulSet spec fields
outside those listed in the error. Delete the affected StatefulSet
objects using --cascade=orphan, which removes the controller objects
while leaving their pods and PersistentVolumeClaims intact, then re-run
the upgrade.
Use --cascade=orphan
Always use --cascade=orphan when you delete StatefulSets as part
of this workaround. Omitting this flag causes a cascading deletion
that removes pods and can trigger PVC deletion, depending on the
persistentVolumeClaimRetentionPolicy. This results in data loss.
kubectl delete statefulset \
<RELEASE-NAME>-harbor-database \
<RELEASE-NAME>-harbor-redis \
<RELEASE-NAME>-harbor-trivy \
-n <NAMESPACE> --cascade=orphan
Not every StatefulSet is affected in every upgrade. Delete only the
StatefulSets named in the error output. If your deployment uses
external PostgreSQL and Redis/Valkey, msr4-harbor-database and
msr4-harbor-redis aren't present.