`Error: INSTALLATION FAILED: rendered manifests contain a resource that already exists. Unable to continue with install: Service "shop-api" in namespace "shop" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "shop"`
AdvancedTroubleshootingInstall & Upgrade Failures
Answer
Likely causes → The object was created outside Helm (kubectl apply, another tool), by another release, or survived a previous uninstall (resource-policy: keep, a failed uninstall).
Diagnose →
kubectl get svc shop-api -n shop -o yaml | yq '.metadata.labels, .metadata.annotations'
helm list -A | grep -i shop
Fix → If it is safe for this release to own it, adopt it:
kubectl label svc shop-api -n shop app.kubernetes.io/managed-by=Helm --overwrite
kubectl annotate svc shop-api -n shop meta.helm.sh/release-name=shop meta.helm.sh/release-namespace=shop --overwrite
On Helm 3.17+ you can use --take-ownership instead. If it belongs to another release, rename the resource in your chart (fullnameOverride) or delete the stale object.
Prevent → One tool owns each object; migrate kubectl-managed resources deliberately.
More on Install & Upgrade Failures
`Error: UPGRADE FAILED: another operation (install/upgrade/rollback) is in progress`Beginner`Error: INSTALLATION FAILED: cannot re-use a name that is still in use`Beginner`Error: UPGRADE FAILED: context deadline exceeded`Beginner`Error: UPGRADE FAILED: release shop failed, and has been rolled back due to atomic being set: context deadline exceeded`Intermediate`Error: UPGRADE FAILED: cannot patch "shop-api" with kind Deployment: Deployment.apps "shop-api" is invalid: spec.selector: Invalid value: v1.LabelSelector{...}: field is immutable`Advanced`Error: UPGRADE FAILED: "shop" has no deployed releases`Advanced