Error with upgrading helm chart from 5.8.5 to 5.9

hello

i have a gitlab running on kubernetes
i m trying to upgrade it from 5.8.5 to 5.9 helm chart

but i get this error :

Error: UPGRADE FAILED: cannot patch “gitlab-gitlab-runner” with kind Deployment: Deployment.apps “gitlab-gitlab-runner” is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{“app”:“gitlab-gitlab-runner”}, MatchExpressions:v1.LabelSelectorRequirement(nil)}: field is immutable && cannot patch “gitlab-gitlab-exporter” with kind Deployment: Deployment.apps “gitlab-gitlab-exporter” is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{“app”:“gitlab-exporter”, “release”:“gitlab”}, MatchExpressions:v1.LabelSelectorRequirement(nil)}: field is immutable && cannot patch “gitlab-gitlab-shell” with kind Deployment: Deployment.apps “gitlab-gitlab-shell” is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{“app”:“gitlab-shell”, “release”:“gitlab”}, MatchExpressions:v1.LabelSelectorRequirement(nil)}: field is immutable && cannot patch “gitlab-sidekiq-all-in-1-v2” with kind Deployment: Deployment.apps “gitlab-sidekiq-all-in-1-v2” is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{“app”:“sidekiq”, “queue-pod-name”:“all-in-1”, “release”:“gitlab”}, MatchExpressions:v1.LabelSelectorRequirement(nil)}: field is immutable && cannot patch “gitlab-toolbox” with kind Deployment: Deployment.apps “gitlab-toolbox” is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{“app”:“toolbox”, “release”:“gitlab”}, MatchExpressions:v1.LabelSelectorRequirement(nil)}: field is immutable && cannot patch “gitlab-webservice-default” with kind Deployment: Deployment.apps “gitlab-webservice-default” is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{“app”:“webservice”, “gitlab.com/webservice-name":"default”, “release”:“gitlab”}, MatchExpressions:v1.LabelSelectorRequirement(nil)}: field is immutable && cannot patch “gitlab-registry” with kind Deployment: Deployment.apps “gitlab-registry” is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{“app”:“registry”, “release”:“gitlab”}, MatchExpressions:v1.LabelSelectorRequirement(nil)}: field is immutable && cannot patch “gitlab-gitaly” with kind StatefulSet: StatefulSet.apps “gitlab-gitaly” is invalid: spec: Forbidden: updates to statefulset spec for fields other than ‘replicas’, ‘template’, and ‘updateStrategy’ are forbidden && cannot patch “gitlab-postgresql” with kind StatefulSet: StatefulSet.apps “gitlab-postgresql” is invalid: spec: Forbidden: updates to statefulset spec for fields other than ‘replicas’, ‘template’, and ‘updateStrategy’ are forbidden && cannot patch “gitlab-redis-master” with kind StatefulSet: StatefulSet.apps “gitlab-redis-master” is invalid: spec: Forbidden: updates to statefulset spec for fields other than ‘replicas’, ‘template’, and ‘updateStrategy’ are forbidden

thanks

This is because the field spec.selector.matchLabels is immutable, so that, you cannot change it. Based on that, seems like your chart for version 5.9 is trying to use some labels that were not present in previous version (5.8.5) in the deployment resource. I recommend you to manually delete that resource and try again to install it again.

You can check documentation about labels immutability here.