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

fix: 🐛 resolve getPolicyDocumentOutput nil dereference (#1872) #1873

Closed
wants to merge 1 commit into from

Conversation

ghostsquad
Copy link

resolves #1872

@github-actions
Copy link

PR is now waiting for a maintainer to run the acceptance tests.
Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

@github-actions
Copy link

PR is now waiting for a maintainer to run the acceptance tests.
Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

@ghostsquad
Copy link
Author

ghostsquad commented Mar 22, 2022

After figuring out how to attach a debugger, I can further confirm that this is the issue.

EDIT
Notice that r is nil

the screenshot is unfortunately not highlight the line that actually matters here. Sorry about that.

image

@guineveresaenger guineveresaenger added kind/bug Some behavior is incorrect or out of spec resolution/wont-fix This issue won't be fixed labels Mar 22, 2022
@stack72
Copy link
Contributor

stack72 commented Mar 22, 2022

Hi @ghostsquad

What version of Pulumi are you using? I believe we fixed this in Pulumi pulumi/pulumi#9067 in 3.25.1

Paul

@guineveresaenger
Copy link
Contributor

hi @ghostsquad! Thank you for your pull request.

The SDKs in this repository are created via codegen, and so this change would be overwritten on the next patch release.

I'll close this PR for now but it looks like @stack72 is pointing you to a possible resolution?

@ghostsquad
Copy link
Author

I'm not sure I understand @stack72. I'm using the latest release of this repository, which is 4.38.1

Don't know what this has to do with the Pulumi CLI. The error doesn't occur in the CLI.

@stack72
Copy link
Contributor

stack72 commented Mar 23, 2022

Hi @ghostsquad

The engine is what controls this behaviour and the engine is a dependency of the CLI. We fixed the engine in the PR I linked you to an it was released as 3.25.1

The error may manifest itself in this code base but it's actually being returned from the engine

Paul

@ghostsquad
Copy link
Author

ghostsquad commented Mar 23, 2022

For reference:

at 17:19:33 ❯ pulumi version
v3.26.1

But I still don't understand what voodoo you are referring to. The code that is running can be traced by go, the debugger, my IDE to this package, which is imported in my main.go:

import "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/iam"

go.mod

github.com/pulumi/pulumi-aws/sdk/v4 v4.38.1

Additionally, my binary is built without help from the pulumi CLI via:

runtime:
  name: go
  options:
    binary: app.sh

app.sh

if [ "${DEBUG:-}" == "1" ]; then
  go build -o debugapp -gcflags "all=-N -l" .
  dlv --listen=:2345 --headless=true --api-version=2 --accept-multiclient exec ./debugapp
else
  go build -o app .
  ./app
fi

Thank you for taking the time to explain to me what's going on.

@ghostsquad
Copy link
Author

If you are referring to the specific error that I found in the debugger, that's not what I'm concerned about. That was by design via this in the config

pulumi:disable-default-providers:
- '*'

The problem is that this error was never surfaced. I got a nil pointer exception, and without debugging, it was not possible to retrieve the error message.

@ghostsquad ghostsquad deleted the fix/1872 branch March 23, 2022 00:32
@ghostsquad
Copy link
Author

I updated #1873 (comment) to point out that r = nil here. Which is why *r panics.

@guineveresaenger guineveresaenger added resolution/fixed This issue was fixed and removed resolution/wont-fix This issue won't be fixed labels Mar 25, 2022
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 resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GetPolicyDocumentOutput panics instead of returning error
3 participants