Welcome to the Linux Foundation Forum!

Lab 3.3 - Error from server (Conflict)

Hi, think I might have hit a bug

On step 15 in Lab 3.3 after editing "first.yaml" I've added the 3 lines in order to add a port to the container.

name: nginx
ports:
- containerPort: 80
protocol: TCP
resources: {}

After which, you are asked to run
$ kubectl replace -f first.yaml

This is the result:
@lab31-a:~$ kubectl replace -f first.yaml

Error from server (Conflict): error when replacing "first.yaml": Operation cannot be fulfilled on deployments.extensions "nginx": StorageError: invalid object, Code: 4, Key: /registry/deployments/default/nginx, ResourceVersion: 0, AdditionalErrorMsg: Precondition failed: UID in precondition: 0fec00f3-c8ac-11e8-9a8a-42010a9a0003, UID in object meta: e0b9bee1-cae9-11e8-869d-42010a9a0003

I think this might the result of me shutting down the 2 GCE instances when I'm not studying.

Comments

  • chrispokorni
    chrispokorni Posts: 2,301

    Hi,
    Stopping and re-starting GCE instances did not cause any issues for me, and I have done that several times, with a various number of nodes in my cluster.
    It seems from the output that there are 2 conflicting UIDs for the same object. In step 5, did you remove all 4 parameters (creationTimestamp, resourceVersion, selfLink, uid) from the top of the yaml file, plus all the status related lines from the bottom of the file?
    If the UID was left in the first.yaml, it may cause such conflicts.
    Regards,
    -Chris

  • @chrispokorni said:
    It seems from the output that there are 2 conflicting UIDs for the same object. In step 5, did you remove all 4 parameters (creationTimestamp, resourceVersion, selfLink, uid) from the top of the yaml file, plus all the status related lines from the bottom of the file?

    No I didn't, I recall reading it but not doing it. That's probably the cause, thanks so much for replying!

Categories

Upcoming Training