Has anyone had any success updating the docker ima...
# google-cloud
c
Has anyone had any success updating the docker image associated with a Cloud Run service? The operation to update the image fails with error 409 and I have to remove the service and its dependents from the script, update, and then add them back and update.
The failed 'pulumi up' looks like
Copy code
~ gcp:cloudrun/service:Service: (update)
        [id=locations/europe-west1/namespaces/google-nonsense-266615/services/myservice-2ac5c21]
        [urn=urn:pulumi:devg::MyPulumiProject::gcp:cloudrun/service:Service::myservice]
        [provider=urn:pulumi:devg::MyPulumiProject::pulumi:providers:gcp::default_2_6_0_alpha_1581425333_g84d6e20f::dfa39488-7e03-43be-be80-c2d476cfeb02]
      ~ template: {
          ~ spec    : {
              ~ containers          : [
                  ~ [0]: {
                          ~ image     : "<http://gcr.io/google-nonsense-266615/myservice:v1.0.2-8165364a2a7cefde45dfd7050c77247305d65f653818a29c9f52f1520a6315d8|gcr.io/google-nonsense-266615/myservice:v1.0.2-8165364a2a7cefde45dfd7050c77247305d65f653818a29c9f52f1520a6315d8>" => "<http://gcr.io/google-nonsense-266615/myservice:313274e56f45b45d06bdf071c842a11648034a42d30b339358d0a86007716ca4|gcr.io/google-nonsense-266615/myservice:313274e56f45b45d06bdf071c842a11648034a42d30b339358d0a86007716ca4>"
                        }
                ]
            }
        }
    --outputs:--
  ~ myservice.endpoint.url    : "<https://myservice-2ac5c21-fkacohaojq-ew.a.run.app>" => output<string>

Do you want to perform this update? yes
Updating (devg):
     Type                 Name                                 Status     Info
     pulumi:pulumi:Stack  MyPulumiProject-devg             'dotnet build -nologo .' completed successful 
     Type                     Name                                 Status                  Info
     pulumi:pulumi:Stack      MyPulumiProject-devg  **failed**              1 error
     ├─ docker:image:Image    myserviceImage
 ~   └─ gcp:cloudrun:Service  myservice                            **updating failed**     [diff: ~template]; 1 err     
Diagnostics:
  gcp:cloudrun:Service (myservice):
    error: 1 error occurred:
        * updating urn:pulumi:devg::MyPulumiProject::gcp:cloudrun/service:Service::myservice: Error updating Service "locations/europe-west1/namespaces/google-nonsense-266615/services/myservice-2ac5c21": googleapi: Error 409: Conflict for resource 'myservice-2ac5c21' for version '1581510236729000'.
w
Cc @tall-librarian-49374 who was working with cloud run recently for https://www.pulumi.com/blog/google-cloud-run-serverless-containers/.
t
Yes, I remember being stuck in this situation once and I could not get out without redeploying from scratch. Other times updates worked though.
c
Any suggestions on a way to structure the components such that the service gets torn down and recreated every time the docker image is pushed?
Although I've now seen it happen when only changing the service template
t
Yeah, for me it didn’t seem related specifically to the docker image.
Surprised that nobody reported it yet on the terraform provider repo