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

Assert deleting resource with empty resource ID #3059

Closed
lukehoban opened this issue Aug 9, 2019 · 7 comments
Closed

Assert deleting resource with empty resource ID #3059

lukehoban opened this issue Aug 9, 2019 · 7 comments
Assignees
Labels
kind/bug Some behavior is incorrect or out of spec
Milestone

Comments

@lukehoban
Copy link
Member

A user reports hitting the following assert - and notes:

Recently I'm getting exceptions regarding empty resource ID. I can create resource but i can't recreate and destroy them.

panic: fatal: An assertion has failed

goroutine 81 [running]:
github.com/pulumi/pulumi/pkg/util/contract.failfast(...)
        /home/travis/gopath/src/github.com/pulumi/pulumi/pkg/util/contract/failfast.go:23
github.com/pulumi/pulumi/pkg/util/contract.Assert(...)
        /home/travis/gopath/src/github.com/pulumi/pulumi/pkg/util/contract/assert.go:26
github.com/pulumi/pulumi/pkg/resource/deploy.NewDeleteStep(0xc001362180, 0xc0012a5800, 0xc0000c5300, 0x73)
        /home/travis/gopath/src/github.com/pulumi/pulumi/pkg/resource/deploy/step.go:237 +0x261
github.com/pulumi/pulumi/pkg/resource/deploy.(*stepGenerator).GenerateDeletes(0xc0003d30e0, 0xc00007cc00, 0x2, 0x0)
        /home/travis/gopath/src/github.com/pulumi/pulumi/pkg/resource/deploy/step_generator.go:539 +0x884
github.com/pulumi/pulumi/pkg/resource/deploy.(*planExecutor).Execute.func3(0xc001347980, 0xc0009dbba0, 0xc000c2e290, 0x18bfee0, 0xc000c32040, 0x18bfee0, 0xc000c32000, 0x10000, 0x1, 0xc0004e9c20)
        /home/travis/gopath/src/github.com/pulumi/pulumi/pkg/resource/deploy/plan_executor.go:155 +0x3d5
github.com/pulumi/pulumi/pkg/resource/deploy.(*planExecutor).Execute(0xc0009dbba0, 0x18bfee0, 0xc000c32000, 0x18c01e0, 0xc000391810, 0x7fffffff, 0x10000, 0xc0007f5f01, 0x0, 0x0)
        /home/travis/gopath/src/github.com/pulumi/pulumi/pkg/resource/deploy/plan_executor.go:192 +0x511
github.com/pulumi/pulumi/pkg/resource/deploy.(*Plan).Execute(...)
        /home/travis/gopath/src/github.com/pulumi/pulumi/pkg/resource/deploy/plan.go:330
github.com/pulumi/pulumi/pkg/engine.(*planResult).Walk.func1(0x18c01e0, 0xc000391810, 0xc000391760, 0x18bfee0, 0xc000c32000, 0x14daf01, 0xc000c2e280, 0xc0013477a0)
        /home/travis/gopath/src/github.com/pulumi/pulumi/pkg/engine/plan.go:195 +0x13b
created by github.com/pulumi/pulumi/pkg/engine.(*planResult).Walk
        /home/travis/gopath/src/github.com/pulumi/pulumi/pkg/engine/plan.go:186 +0x11b
@lukehoban lukehoban added kind/bug Some behavior is incorrect or out of spec feature/q3 labels Aug 9, 2019
@lukehoban lukehoban added this to the 0.26 milestone Aug 9, 2019
@pgavlin
Copy link
Member

pgavlin commented Aug 12, 2019

@lukehoban do we have details on the particular type of resource? An empty ID is very strange.

@lukehoban
Copy link
Member Author

@pgavlin
Copy link
Member

pgavlin commented Aug 13, 2019

That doesn't appear to contain any additional information beyond what's captured here.

@matkarasiewicz
Copy link

matkarasiewicz commented Aug 13, 2019

@pgavlin Hey, I posted this issue on Slack. Basically it even happens on preview:

Previewing destroy (stack-name):

panic: fatal: An assertion has failed

goroutine 131 [running]:

Fortunetly this is not related to some state of stack.

Code which causing it :

const azureResourceGroup = azure.core.ResourceGroup.get(
  `${config.stackName}-resource-group`,
  pulumi.interpolate`/subscriptions/${config.requireSecret(
    "subscriptionId"
  )}/resourceGroups/${config.require("resourceGroup")}`,
  {},
  { protect: true }
);

When I changed requireSecret to require for subscriptionId it started to work

const azureResourceGroup = azure.core.ResourceGroup.get(
  `${config.stackName}-resource-group`,
  pulumi.interpolate`/subscriptions/${config.require(
    "subscriptionId"
  )}/resourceGroups/${config.require("resourceGroup")}`,
  {},
  { protect: true }
);

*I'm using passphrase for stack config

@pgavlin
Copy link
Member

pgavlin commented Aug 13, 2019

@matkarasiewicz thank you for the extra information! I think I know what might be happening now.

@lukehoban
Copy link
Member Author

We believe this is indirectly caused by pulumi/pulumi-terraform#262, which allows empty id to sneak in for .get calls.

@lukehoban lukehoban assigned lukehoban and unassigned pgavlin Aug 14, 2019
@lukehoban lukehoban assigned pgavlin and unassigned lukehoban Aug 21, 2019
@pgavlin
Copy link
Member

pgavlin commented Aug 21, 2019

I believe this has been fixed by #3123.

@pgavlin pgavlin closed this as completed Aug 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

3 participants