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

Panic in resourceDigitalOceanAppRead #678

nightvisi0n opened this issue Aug 31, 2021 · 3 comments · Fixed by #684

Panic in resourceDigitalOceanAppRead #678

nightvisi0n opened this issue Aug 31, 2021 · 3 comments · Fixed by #684


Copy link

@nightvisi0n nightvisi0n commented Aug 31, 2021

Bug Report

Today I tried to apply my terraform config, which ended in the following error:

Stack trace from the terraform-provider-digitalocean_v2.11.1 plugin:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xdfe531]

goroutine 72 [running]:, 0xc0000ad620, 0xc00052a000, 0xf60860, 0xc0005af740, 0xc000437920, 0xc00062b908, 0x40e0f8) +0x471*Resource).read(0xc0001888c0, 0x123ae28, 0xc0003c7700, 0xc00052a000, 0xf60860, 0xc0005af740, 0x0, 0x0, 0x0)[email protected]/helper/schema/resource.go:347 +0x17f*Resource).RefreshWithoutUpgrade(0xc0001888c0, 0x123ae28, 0xc0003c7700, 0xc0003ac7e0, 0xf60860, 0xc0005af740, 0xc0004967a0, 0x0, 0x0, 0x0)[email protected]/helper/schema/resource.go:624 +0x1cb*GRPCProviderServer).ReadResource(0xc0000b0090, 0x123ae28, 0xc0003c7700, 0xc0003c7740, 0xc0003c7700, 0x40b965, 0x1007960)[email protected]/helper/schema/grpc_provider.go:575 +0x43b*server).ReadResource(0xc0000ba380, 0x123aed0, 0xc0003c7700, 0xc0008923c0, 0xc0000ba380, 0xc000739620, 0xc000815ba0)[email protected]/tfprotov5/server/server.go:298 +0x105, 0xc0000ba380, 0x123aed0, 0xc000739620, 0xc000892360, 0x0, 0x123aed0, 0xc000739620, 0xc00042ec00, 0x1065)[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:344 +0x214*Server).processUnaryRPC(0xc0000d6540, 0x1244738, 0xc000642f00, 0xc000820000, 0xc0005ae120, 0x17d8b90, 0x0, 0x0, 0x0)[email protected]/server.go:1194 +0x52b*Server).handleStream(0xc0000d6540, 0x1244738, 0xc000642f00, 0xc000820000, 0x0)[email protected]/server.go:1517 +0xd0c*Server).serveStreams.func1.2(0xc0000b61c0, 0xc0000d6540, 0x1244738, 0xc000642f00, 0xc000820000)[email protected]/server.go:859 +0xab
created by*Server).serveStreams.func1[email protected]/server.go:857 +0x1fd

Error: The terraform-provider-digitalocean_v2.11.1 plugin crashed!

It seems this bug occurs in any operation where the current state from the DO App Platform has to be read.

The terraform config uses the following resources:

  • digitalocean_database_cluster
  • digitalocean_database_db
  • digitalocean_database_user
  • digitalocean_app

If you need any more info please let me know.

@nightvisi0n nightvisi0n changed the title Panic during terraform apply Panic in resourceDigitalOceanAppRead Aug 31, 2021
Copy link

@danaelhe danaelhe commented Aug 31, 2021

Hi there,

Would it be possible to include your terraform config file? Has this config file always been erroring out or has it ever been successful?


Copy link

@nightvisi0n nightvisi0n commented Sep 2, 2021

Hi, after further investigation it seems like this only happens if the initial deployment fails (e.g. due to a missing image in DOCR).
The same config worked after a manual (successful) deployment.
I think this bug is reproducible by deploying a minimal app with a non-existent DOCR image (which will fail).

Copy link

@andrewsomething andrewsomething commented Sep 2, 2021

Thanks for the follow up @nightvisi0n. This is clearly an error state. We should be checking for the active deployment here and erroring out if it does not exist before trying to access its ID rather than panicking.

d.Set("active_deployment_id", app.ActiveDeployment.ID)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants