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

Ensure we have an import error before using in import path #5884

Merged
merged 1 commit into from
Dec 8, 2020

Conversation

stack72
Copy link
Contributor

@stack72 stack72 commented Dec 7, 2020

Without this, we can panic.

Fixes: #5883
Fixes: #5860
Fixes: #5876
Fixes: pulumi/pulumi-aws#1252

Previous behaviour:

     Type                 Name                 Plan
 +   pulumi:pulumi:Stack  import-post-dev      create.
 =   └─ aws:iam:Policy    AdministratorAccess  import.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x4a80f56]

goroutine 73 [running]:
github.com/pulumi/pulumi/pkg/v2/resource/deploy.(*deploymentExecutor).importResources(0xc000eefa60, 0x5c10020, 0xc00151c4e0, 0x869c2a8, 0xc0005b2dc0, 0x7fffffff, 0x0, 0x0, 0x0, 0x0, ...)
	/Users/runner/work/pulumi/pulumi/pkg/resource/deploy/deployment_executor.go:459 +0x276
github.com/pulumi/pulumi/pkg/v2/resource/deploy.(*deploymentExecutor).Execute(0xc000eefa60, 0x5c10020, 0xc00151c4e0, 0x869c2a8, 0xc0005b2dc0, 0x7fffffff, 0x0, 0x0, 0x0, 0x0, ...)
	/Users/runner/work/pulumi/pulumi/pkg/resource/deploy/deployment_executor.go:138 +0x1247
github.com/pulumi/pulumi/pkg/v2/resource/deploy.(*Deployment).Execute(...)
	/Users/runner/work/pulumi/pulumi/pkg/resource/deploy/deployment.go:383
github.com/pulumi/pulumi/pkg/v2/engine.(*deployment).run.func1(0x5c1ac60, 0xc0005b2dc0, 0xc0005b3180, 0x5c10020, 0xc00151c4e0, 0xc00151c401, 0xc000e91f10, 0xc0000a3aa0)
	/Users/runner/work/pulumi/pulumi/pkg/engine/deployment.go:251 +0x267
created by github.com/pulumi/pulumi/pkg/v2/engine.(*deployment).run
	/Users/runner/work/pulumi/pulumi/pkg/engine/deployment.go:237 +0x306

New behaviour:

     Type                 Name                 Plan       Info
 +   pulumi:pulumi:Stack  import-post-dev      create     1 error
 =   └─ aws:iam:Policy    AdministratorAccess  import     1 error

Diagnostics:
  pulumi:pulumi:Stack (import-post-dev):
    error: preview failed

  aws:iam:Policy (AdministratorAccess):
    error: Preview failed: refreshing urn:pulumi:dev::import-post::aws:iam/policy:Policy::AdministratorAccess: 1 error occurred:
    	* Error reading IAM policy AdministratorAccess: InvalidParameter: 1 validation error(s) found.
    - minimum field size of 20, GetPolicyInput.PolicyArn.

@stack72 stack72 requested a review from justinvp December 7, 2020 19:54
@stack72 stack72 self-assigned this Dec 7, 2020
@lukehoban lukehoban added impact/panic This bug represents a panic or unexpected crash and removed impact/panic This bug represents a panic or unexpected crash labels Dec 7, 2020
@stack72 stack72 merged commit 4f5b3c8 into master Dec 8, 2020
@pulumi-bot pulumi-bot deleted the panic-import branch December 8, 2020 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants