You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to perform helm upgrade due to resource conflict #6850
Seem to be experiencing a weird bug when doing helm upgrade. The error states "Error: UPGRADE FAILED: rendered manifests contain a new resource that already exists. Unable to continue with update: existing resource conflict: kind: ServiceMonitor, namespace: dcd, name: bid-management".
We've tested on the following helm versions:
Helm Version:"v3.0.0-beta.2", "v3.0.0-beta.3"
We get the following error - "Error: UPGRADE FAILED: no ServiceMonitor with the name "bid-management" found". Though I can confirm it exists.
We get the error above "Error: UPGRADE FAILED: rendered manifests contain a new resource that already exists. Unable to continue with update: existing resource conflict: kind: ServiceMonitor, namespace: dcd, name: bid-management"
Reacted by Segev Finer, amq, Sérgio, David Seapy, Louis Bougeard, Austin Orth, Reto, Jeremy White, Adam, Levi Lugato and 22 more
@bacongobbler Apologies for the delay. Realised it's harder to reproduce locally with minikube since we've got everything setup for/with AWS EKS. At the moment I can confirm the apiVersion of the serviceMonitor doesn't change so it doesn't seem to be a relation to #6583.
Facing the same issue here. @bacongobbler , @efernandes-ANDigital
kubectl version: 1.14.7
kubernetes version 1.15 (PKS)
First time happened to me using Helm v3.0.0-rc.1, after updating to Helm v3.0.0-rc.2 this is still happening.
Made a rollback successfully to the previous state with rc.2 and upgraded again but it didn't solved it: after upgrading successfully trying a new upgrade gave the same error message.
helm diff shows no issues (it detects the resources correctly), and even if I look inside the secret related to the revision, it shows the resources there, so it shouldn't try to re-deploy them.
Not a complex chart, just using range to iterate a list (~100 elements) to generate some resources (namespaces, configmaps, etc.)
Just to add we noticed something else, upon disabling the service monitor. When running helm upgrade, it returns back a success message "Release "bid-mangement" has been upgraded. Happy Helming! etc. However upon checking the api-resources servicemonitors we still see the servicemonitor that was created.
What we've just noticed is for the same charts with other services it works just fine and we don't have the issue. The services use the same exact charts with just a few configuration changes for the services....very weird
The problem also happen while trying to install a chart (e.g. prometheus-operator), if the install fails and you try to install it again, helm complains about resource conflict, and if you try to remove the chart, complains saying it never been deployed.
@vakaobr I doubt it's the same issue. When the first install fails (and only with the first install), as you noticed, helm doesn't make a release. Hence helm wont have any information about a release to compare with already deployed resources and will try to install them showing that message because actually some of the resources were installed. You can probably solve this by using --atomic with the installation or using helm upgrade --install --force being careful with the --force since it will delete and re-create resources.
Here we are facing an issue that happens with already successfully installed charts.
Reacted by Sebastian Nyberg, Anton Dziubin, carlosorojas and tsterker
Update: still happening after updating to helm v3.0.0 (stable). @efernandes-ANDigital , @bacongobbler , @thomastaylor312
If I use helm diff, it shows NO differences, if I use helm upgrade --install --dry-run, it fails with the following error: "Error: UPGRADE FAILED: rendered manifests contain a new resource that already exists."
Using helm get manifest (of the last release), shows these resources.
Using helm template shows theses resources too.
Maybe this is related with how helm compares resources with the manifest vs the templates?
I'm creating resources iterating a list with range, could it be related with this?
This piece of code maybe?
Workaround:
Running the upgrade --install with --dry-run --debug and -v 10 option showed us that helm was somehow using some really old revisions. We deleted all revisions but the last 2 and it started to work again.
Did you manage to save the release ledger before deleting them? Would've been helpful to reproduce the issue if we had our hands on a solid reproducible case.
The conversion process is logically a "star" with the internal form at the center. Every versioned API can be converted to the internal form (and vice-versa)
Runtime behavior
I use a 1.14 cluster and kubectl. kubectl get -n kube-system deployment coredns -o yaml -v 8
Force to use another api version kubectl get -n kube-system deployment.v1.apps coredns -o yaml -v 8
You can see a single object (by its uid) can be retrieve by multiple API versions.
I am facing same issue the only think i have done i upgraded from helm 2.14.1 to latest, we are getting the error as mentioned above : **rendered manifests contain a resource that already exists. Unable to continue with install: existing resource conflict: kind: Service, namespace: *, name: *** . All stuff mentioned up about deleting that wont work for us as this is production and the API is critical with 0 down time required. kindly assist ...
Here's a dirty hack that we use whenever a resource, such as a PV or PVC, already exists and we don't want to delete it, but do want to upgrade containers. This typically happens whenever we do a helm upgrade whatever and the old deployment and new deployment get stuck in a race.
kubectl get deployments -n monitoring
kubectl get -n monitoring deployment/prometheus-operator-grafana -o jsonpath="{.spec.replicas}"
# Set spec.replicas to 0
kubectl edit -n monitoring deployments/prometheus-operator-grafana
watch -n1 -d "kubectl get pods -n monitoring"
# Once all pods have terminated, set the spec.replicas back to 1 or whatever value you want
kubectl edit -n monitoring deployments/prometheus-operator-grafana
watch -n1 -d "kubectl get pods -n monitoring"
# At this point you'll have an updated pod/deployment/whatever
Same issue when installing chart in two namespaces. My chart depends on prometheus-operator chart which will create ClusterRole . Error: rendered manifests contain a resource that already exists. Unable to continue with install: existing resource conflict: kind: ClusterRole, namespace: , name: p8s-operator
Same here. I migrated the helm2 to a helm 3 deployment and afterwards its no longer upgradeable because of the same error
./helm upgrade public-nginx-ingress stable/nginx-ingress --install --namespace ingress --wait -f public-nginx-ingress.yaml coalesce.go:199: warning: destination for extraContainers is a table. Ignoring non-table value [] coalesce.go:199: warning: destination for extraVolumes is a table. Ignoring non-table value [] coalesce.go:199: warning: destination for extraVolumeMounts is a table. Ignoring non-table value [] Error: UPGRADE FAILED: rendered manifests contain a new resource that already exists. Unable to continue with update: existing resource conflict: namespace: , name: public-nginx-ingress, existing_kind: rbac.authorization.k8s.io/v1, Kind=ClusterRole, new_kind: rbac.authorization.k8s.io/v1, Kind=ClusterRole
I tried to skip the rbac part, ais it already seems to exists and don't need to established again
Then i get the next issue ./helm upgrade public-nginx-ingress stable/nginx-ingress --install --namespace ingress --wait -f public-nginx-ingress.yaml --set rbac.create=false coalesce.go:199: warning: destination for extraContainers is a table. Ignoring non-table value [] coalesce.go:199: warning: destination for extraVolumeMounts is a table. Ignoring non-table value [] coalesce.go:199: warning: destination for extraVolumes is a table. Ignoring non-table value [] Error: UPGRADE FAILED: cannot patch "public-nginx-ingress-controller-metrics" with kind Service: Service "public-nginx-ingress-controller-metrics" is invalid: spec.clusterIP: Invalid value: "": field is immutable && cannot patch "public-nginx-ingress-controller" with kind Service: Service "public-nginx-ingress-controller" is invalid: spec.clusterIP: Invalid value: "": field is immutable && cannot patch "public-nginx-ingress-default-backend" with kind Service: Service "public-nginx-ingress-default-backend" is invalid: spec.clusterIP: Invalid value: "": field is immutable
Could someone clarify what the solution is here? I see that this got reopened then closed again 39 minutes later but I didn't see an obvious solution in this thread.
Could someone clarify what the solution is here? I see that this got reopened then closed again 39 minutes later but I didn't see an obvious solution in this thread.
There is no solution yet but this one is promising and almost ready to implement:
Activity
bacongobbler commentedon Oct 31, 2019
Can you provide a set of steps to reproduce the issue?
efernandes-dev-ops commentedon Nov 5, 2019
@bacongobbler Apologies for the delay. Realised it's harder to reproduce locally with minikube since we've got everything setup for/with AWS EKS. At the moment I can confirm the apiVersion of the serviceMonitor doesn't change so it doesn't seem to be a relation to #6583.
When I run helm template the first time:
After upgrading and once the resource gets created successfully, I run helm template again and get back the following below:
After running helm upgrade a second time, I get back the error mentioned above
Error: UPGRADE FAILED: rendered manifests contain a new resource that already exists. Unable to continue with update: existing resource conflict: kind: ServiceMonitor, namespace: dcd, name: bid-managementefernandes-dev-ops commentedon Nov 5, 2019
@bacongobbler Going to still try and re-produce the steps locally with minikube but might take longer than expected.
aespejel commentedon Nov 5, 2019
Facing the same issue here. @bacongobbler , @efernandes-ANDigital
kubectl version: 1.14.7
kubernetes version 1.15 (PKS)
First time happened to me using Helm v3.0.0-rc.1, after updating to Helm v3.0.0-rc.2 this is still happening.
Made a rollback successfully to the previous state with rc.2 and upgraded again but it didn't solved it: after upgrading successfully trying a new upgrade gave the same error message.
helm diff shows no issues (it detects the resources correctly), and even if I look inside the secret related to the revision, it shows the resources there, so it shouldn't try to re-deploy them.
Not a complex chart, just using range to iterate a list (~100 elements) to generate some resources (namespaces, configmaps, etc.)
Cannot repro it (tried on GKE)
thomastaylor312 commentedon Nov 6, 2019
@aespejel What
kinds of resources did it fail on?aespejel commentedon Nov 6, 2019
Namespaces, which makes sense having in mind the order helm is trying to apply manifests, right @thomastaylor312 ?
thomastaylor312 commentedon Nov 6, 2019
Yep, Namespaces go first, but I was just checking if this was happening with specific kinds of resources or with an assortment
efernandes-dev-ops commentedon Nov 11, 2019
Just to add we noticed something else, upon disabling the service monitor. When running helm upgrade, it returns back a success message "Release "bid-mangement" has been upgraded. Happy Helming! etc. However upon checking the api-resources servicemonitors we still see the servicemonitor that was created.
efernandes-dev-ops commentedon Nov 11, 2019
What we've just noticed is for the same charts with other services it works just fine and we don't have the issue. The services use the same exact charts with just a few configuration changes for the services....very weird
vakaobr commentedon Nov 14, 2019
The problem also happen while trying to install a chart (e.g. prometheus-operator), if the install fails and you try to install it again, helm complains about resource conflict, and if you try to remove the chart, complains saying it never been deployed.
aespejel commentedon Nov 17, 2019
@vakaobr I doubt it's the same issue. When the first install fails (and only with the first install), as you noticed, helm doesn't make a release. Hence helm wont have any information about a release to compare with already deployed resources and will try to install them showing that message because actually some of the resources were installed. You can probably solve this by using --atomic with the installation or using helm upgrade --install --force being careful with the --force since it will delete and re-create resources.
Here we are facing an issue that happens with already successfully installed charts.
aespejel commentedon Nov 17, 2019
Update: still happening after updating to helm v3.0.0 (stable). @efernandes-ANDigital , @bacongobbler , @thomastaylor312
If I use helm diff, it shows NO differences, if I use helm upgrade --install --dry-run, it fails with the following error: "Error: UPGRADE FAILED: rendered manifests contain a new resource that already exists."
Using helm get manifest (of the last release), shows these resources.
Using helm template shows theses resources too.
Maybe this is related with how helm compares resources with the manifest vs the templates?
I'm creating resources iterating a list with range, could it be related with this?
This piece of code maybe?
aespejel commentedon Nov 25, 2019
Workaround:
Running the upgrade --install with --dry-run --debug and -v 10 option showed us that helm was somehow using some really old revisions. We deleted all revisions but the last 2 and it started to work again.
bacongobbler commentedon Nov 25, 2019
Did you manage to save the release ledger before deleting them? Would've been helpful to reproduce the issue if we had our hands on a solid reproducible case.
34 remaining items
bacongobbler commentedon Feb 4, 2020
#7219 (comment)
topikachu commentedon Feb 5, 2020
@bacongobbler
I will show how kubernetes hanlde multiple API versions from design, code, and runtime.
https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api_changes.md#operational-overview.
There is an example in the doc on how to create a resource in v7beta1 and retrieve in v5. So from kubernetes design perspective, it allows a single object conversion among multiple versions.
Kubernetes source code
As I mentioned above, there are such conversions
https://github.com/kubernetes/kubernetes/blob/master/pkg/apis/apps/v1/conversion.go
Convert_v1_DeploymentSpec_To_apps_DeploymentSpecandConvert_apps_DeploymentSpec_To_v1_DeploymentSpecAlso, https://github.com/kubernetes/kubernetes/blob/master/pkg/apis/apps/v1beta2/conversion.go
Convert_v1beta2_DeploymentSpec_To_apps_DeploymentSpecandConvert_apps_DeploymentSpec_To_v1beta2_DeploymentSpec.The code use the interal data structure as a hub in different versions.
Runtime behavior
I use a 1.14 cluster and kubectl.
kubectl get -n kube-system deployment coredns -o yaml -v 8Force to use another api version
kubectl get -n kube-system deployment.v1.apps coredns -o yaml -v 8You can see a single object (by its uid) can be retrieve by multiple API versions.
richardmatthewsdev commentedon Feb 10, 2020
Hey,
I am having the same issue. My issue is regarding a pre existing stateful set. Any advice would be much appreciated.
Thanks,
Richard
pho-enix commentedon Feb 12, 2020
Let's open up discussions:
#7575
hunyhabib commentedon Feb 13, 2020
Hello,
I am facing same issue the only think i have done i upgraded from helm 2.14.1 to latest, we are getting the error as mentioned above : **rendered manifests contain a resource that already exists. Unable to continue with install: existing resource conflict: kind: Service, namespace: *, name: *** . All stuff mentioned up about deleting that wont work for us as this is production and the API is critical with 0 down time required. kindly assist ...
Thanks
Hany
pgporada commentedon Feb 20, 2020
Here's a dirty hack that we use whenever a resource, such as a PV or PVC, already exists and we don't want to delete it, but do want to upgrade containers. This typically happens whenever we do a
helm upgrade whateverand the old deployment and new deployment get stuck in a race.revmischa commentedon Feb 25, 2020
I got this error just following the basic tutorial
dkirrane commentedon Mar 10, 2020
Hitting this for a
ClusterRoleBindingwhen installing kubernetes dashboard charttuxknight commentedon Mar 12, 2020
Same issue when installing chart in two namespaces. My chart depends on prometheus-operator chart which will create ClusterRole .
Error: rendered manifests contain a resource that already exists. Unable to continue with install: existing resource conflict: kind: ClusterRole, namespace: , name: p8s-operatorcforce commentedon Mar 14, 2020
Same here. I migrated the helm2 to a helm 3 deployment and afterwards its no longer upgradeable because of the same error
./helm upgrade public-nginx-ingress stable/nginx-ingress --install --namespace ingress --wait -f public-nginx-ingress.yaml coalesce.go:199: warning: destination for extraContainers is a table. Ignoring non-table value [] coalesce.go:199: warning: destination for extraVolumes is a table. Ignoring non-table value [] coalesce.go:199: warning: destination for extraVolumeMounts is a table. Ignoring non-table value [] Error: UPGRADE FAILED: rendered manifests contain a new resource that already exists. Unable to continue with update: existing resource conflict: namespace: , name: public-nginx-ingress, existing_kind: rbac.authorization.k8s.io/v1, Kind=ClusterRole, new_kind: rbac.authorization.k8s.io/v1, Kind=ClusterRoleI tried to skip the rbac part, ais it already seems to exists and don't need to established again
Then i get the next issue
./helm upgrade public-nginx-ingress stable/nginx-ingress --install --namespace ingress --wait -f public-nginx-ingress.yaml --set rbac.create=false coalesce.go:199: warning: destination for extraContainers is a table. Ignoring non-table value [] coalesce.go:199: warning: destination for extraVolumeMounts is a table. Ignoring non-table value [] coalesce.go:199: warning: destination for extraVolumes is a table. Ignoring non-table value [] Error: UPGRADE FAILED: cannot patch "public-nginx-ingress-controller-metrics" with kind Service: Service "public-nginx-ingress-controller-metrics" is invalid: spec.clusterIP: Invalid value: "": field is immutable && cannot patch "public-nginx-ingress-controller" with kind Service: Service "public-nginx-ingress-controller" is invalid: spec.clusterIP: Invalid value: "": field is immutable && cannot patch "public-nginx-ingress-default-backend" with kind Service: Service "public-nginx-ingress-default-backend" is invalid: spec.clusterIP: Invalid value: "": field is immutablemicseydel commentedon Mar 18, 2020
Could someone clarify what the solution is here? I see that this got reopened then closed again 39 minutes later but I didn't see an obvious solution in this thread.
DavidZisky commentedon Mar 18, 2020
There is no solution yet but this one is promising and almost ready to implement:
#7649
bacongobbler commentedon Mar 18, 2020
#7649 was merged this morning.
DavidZisky commentedon Mar 18, 2020
Ohh, missed that ;) well, then answer to @micseydel question is in the first post of #7649 in Release Notes section