# general


01/06/2020, 8:58 PM
I've got an assertion failure that I don't understand:
Copy code
panic: fatal: An assertion has failed: Expected diff to not require deletion or replacement during Update of urn:pulumi:deploy-test::deploy::aws:ecs/service:Service::xxx
I replaced dependencies for the Service, could that be the problem?
Unfortunately this error doesn't occur during preview 😞
At least one recent report of a similar error -
I think this occurred because I was deleting the target group associated with an ECS Service. The AWS UI only lets you set target groups when creating the service, so maybe pulumi was trying to do an illegal operation? Anyways, I solved the problem by renaming my service.
That forced pulumi to re-create the service (with updated target groups) and it all worked just fine.


01/07/2020, 5:41 AM
This assertion happens when Pulumi computes that a replacement is not needed (and tells you that during preview), but then when it comes time to do the in-place update, it finds that it does need to do a replacement, so we refuse to proceed - as we don't want to silently do a replacement you didn't approve of. If the provider were implemented correctly, this should not be possible, but we have seen cases where upstream Terraform providers can trigger this condition. If you have any more details on the change you made (in particular, the code change to the
, the diff that was reported during the preview, etc. - it would be great to try to reproduce this and report the underlying bug in the upstream provider so that we can address the root cause that likely led to this.


01/07/2020, 7:15 PM
Here is a diff that was produced when I saw the assertion, specifically for the
. The service had two load balancers pointed at it, and I was trying to remove one of those. I'm glad to provide more details if this isn't enough:
Copy code
~ aws:ecs/service:Service: (update) 
      ~ loadBalancers : [ 
          ~ [0]: { 
                  ~ containerName : "test-dashboard-server" => "test-dashboard-server" 
                  ~ containerPort : 8080 => 8080 
                  - elbName       : "" 
                  ~ targetGroupArn: "arn:aws:elasticloadbalancing:us-west-2:948428744612:targetgroup/tg-a5ba771fb41eda24def7a-440027a/1fcfec737277751f" => "arn:aws:elasticloadbalancing:us-west-2:948428744612:targetgroup/tg-c49cd242343cbb5f35e0d-64c0c86/de2899e384a48509" 
          - [1]: { 
                  - containerName : "test-dashboard-server" 
                  - containerPort : 8080 
                  - targetGroupArn: "arn:aws:elasticloadbalancing:us-west-2:948428744612:targetgroup/tg-c49cd242343cbb5f35e0d-64c0c86/de2899e384a48509" 
      ~ taskDefinition: "arn:aws:ecs:us-west-2:948428744612:task-definition/dashboard-server:893" => "arn:aws:ecs:us-west-2:948428744612:task-definition/dashboard-server:896"
Also, here is the stack trace of the failure:
Copy code
panic: fatal: An assertion has failed: Expected diff to not require deletion or replacement during Update of urn:pulumi:deploy-test::deploy::aws:ecs/service:Service::asheworks-deploy-test-test-dashboard-server 
goroutine 3405 [running]: 
<|>, 0x5321bc5, 0x48, 0xc0008737e0, 0x1, 0x1) 
    /home/travis/gopath/src/ +0x198 
<*Provider).Update(0xc000581040|*Provider).Update(0xc000581040>, 0x5c40aa0, 0xc001535980, 0xc0004e00e0, 0xc000581040, 0x48cbf01, 0xc001ed1000) 
    /home/travis/gopath/src/ +0x82d 
<|>, 0xc001535980, 0x50c7620, 0xc0004e00e0, 0x50c0460, 0x9ccad48, 0x5c40aa0, 0xc001535980) 
    /home/travis/gopath/src/ +0x86 
<|>, 0xc001e81980, 0x50c7620, 0xc0004e00e0, 0xc000657460, 0xc000657480, 0x0, 0x0, 0x5ba4f80, 0xc0004889b0) 
    /home/travis/gopath/src/ +0x360 
<|>, 0xc000581040, 0x5c40aa0, 0xc001e81980, 0xc0011c46c0, 0xc0006563c0, 0x5c40aa0, 0xc001e81980, 0xc000e40000, 0xa87) 
    /home/travis/gopath/src/ +0x158 
<*Server).processUnaryRPC(0xc0000e4160|*Server).processUnaryRPC(0xc0000e4160>, 0x5c65da0, 0xc0007ea300, 0xc000aad800, 0xc00074dd40, 0x9c9cac0, 0x0, 0x0, 0x0) 
    /home/travis/gopath/src/ +0x466 
<*Server).handleStream(0xc0000e4160|*Server).handleStream(0xc0000e4160>, 0x5c65da0, 0xc0007ea300, 0xc000aad800, 0x0) 
    /home/travis/gopath/src/ +0xda6 
<*Server).serveStreams.func1.1(0xc0004f2040|*Server).serveStreams.func1.1(0xc0004f2040>, 0xc0000e4160, 0x5c65da0, 0xc0007ea300, 0xc000aad800) 
    /home/travis/gopath/src/ +0x9f 
created by <*Server).serveStreams.func1|*Server).serveStreams.func1> 
    /home/travis/gopath/src/ +0xa1