Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ks (0.11) complains that resource was modified when updating Kubeflow #980

Closed
jlewi opened this issue Jun 12, 2018 · 13 comments
Closed

ks (0.11) complains that resource was modified when updating Kubeflow #980

jlewi opened this issue Jun 12, 2018 · 13 comments
Labels

Comments

@jlewi
Copy link
Contributor

jlewi commented Jun 12, 2018

I have an existing Kubeflow deployment when I try updating it I get

ERROR handle object: can't update deployments kubeflow.tf-job-operator-v1alpha2: Operation cannot be fulfilled on deployments.extensions "tf-job-operator-v1alpha2": the object has been modified; please apply your changes to the latest version and try again 

This appears to have started with ks 0.11

My version

ks version
ksonnet version: 0.11.0
jsonnet version: v0.10.0
client-go version: 

ks 0.11 uses merge patching and I suspect that might be the issue?

@jlewi
Copy link
Contributor Author

jlewi commented Jun 12, 2018

The following workaround worked

ks show jlewi-kubeflow -c kubeflow-core | kubectl apply -f 

@jlewi
Copy link
Contributor Author

jlewi commented Jun 12, 2018

@bryanl is this an issue with ksonnet or with K8s?

@pdmack
Copy link
Member

pdmack commented Jun 12, 2018

Same thing:

ERROR handle object: can't update deployments kubeflow.issue-summarization-ui: Operation cannot be fulfilled on deployments.apps "issue-summarization-ui": the object has been modified; please apply your changes to the latest version and try again

@bryanl
Copy link

bryanl commented Jun 12, 2018

I'm going to dig in and investigate. I will report back here.

@bajacondor
Copy link

I'm seeing the same with deployments.extensions when modifying the image property.
ERROR handle object: can't update deployments cicd.simple-app: Operation cannot be fulfilled on deployments.extensions "simple-app": the object has been modified; please apply your changes to the latest version and try again

@bryanl
Copy link

bryanl commented Jun 17, 2018

I've researched the cause of this error and we will need to add a retries to our apply action. While not optimal, it's safe to return ks apply again.

@jlewi
Copy link
Contributor Author

jlewi commented Jun 18, 2018

Thanks @bryanl

@jlewi
Copy link
Contributor Author

jlewi commented Jun 28, 2018

I hit a similar issue trying to update a service

ERROR handle object: merging object with existing state: Service "envoy" is invalid: [metadata.resourceVersion: Invalid value: "": must be specified for an update, spec.clusterIP: Invalid value: "": field is immutable] 

@bryanl Is this really an issue with optimistic locking? It seems like ks apply is trying to set the value to the empty string which doesn't work.

@jlewi
Copy link
Contributor Author

jlewi commented Jun 28, 2018

I get the same error if I pipe the output of ks show to ks apply

ks show default -c iap-ingress | kubectl apply -f -
Warning: kubectl apply should be used on resource created by either kubectl create --save-config or kubectl apply
ingress.extensions "envoy-ingress" configured
Warning: kubectl apply should be used on resource created by either kubectl create --save-config or kubectl apply
certificate.certmanager.k8s.io "envoy-ingress-tls" configured
Warning: kubectl apply should be used on resource created by either kubectl create --save-config or kubectl apply
serviceaccount "envoy" configured
Warning: kubectl apply should be used on resource created by either kubectl create --save-config or kubectl apply
clusterrolebinding.rbac.authorization.k8s.io "envoy" configured
Warning: kubectl apply should be used on resource created by either kubectl create --save-config or kubectl apply
clusterrole.rbac.authorization.k8s.io "envoy" configured
Warning: kubectl apply should be used on resource created by either kubectl create --save-config or kubectl apply
deployment.extensions "envoy" configured
Warning: kubectl apply should be used on resource created by either kubectl create --save-config or kubectl apply
deployment.extensions "iap-enabler" configured
Warning: kubectl apply should be used on resource created by either kubectl create --save-config or kubectl apply
configmap "envoy-config" configured
service "whoami-app" created
Warning: kubectl apply should be used on resource created by either kubectl create --save-config or kubectl apply
deployment.extensions "whoami-app" configured
Warning: kubectl apply should be used on resource created by either kubectl create --save-config or kubectl apply
cloudendpoint.ctl.isla.solutions "jlewi-kubeflow" configured
The Service "envoy" is invalid: 
* metadata.resourceVersion: Invalid value: "": must be specified for an update
* spec.clusterIP: Invalid value: "": field is immutable

@jlewi
Copy link
Contributor Author

jlewi commented Jul 7, 2018

I noticed while updating the dev.kubeflow.org that problem does seem to be related to retries.

I kept running the command

ks apply default -c kubeflow-core

Each time I ran it it complained for a different object and I got an error like

ERROR handle object: can't update deployments kubeflow.tf-job-operator-v1alpha2: Operation cannot be fulfilled on deployments.extensions "tf-job-operator-v1alpha2": the object has been modified; please apply your changes to the latest version and try again 

But each time I reran the command it got a little bit further and eventually it succeeded.

@jlewi
Copy link
Contributor Author

jlewi commented Jul 7, 2018

It looks like the error with updating the service

ERROR handle object: merging object with existing state: Service "envoy" is invalid: [metadata.resourceVersion: Invalid value: "": must be specified for an update, spec.clusterIP: Invalid value: "": field is immutable] 

Is a different error and now one that is fixed by retrying.

@jlewi
Copy link
Contributor Author

jlewi commented Jul 7, 2018

Opened #1145 for the problems with node port services because that seems to be a different issue.

@jlewi
Copy link
Contributor Author

jlewi commented Apr 1, 2019

/lifecycle stale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants