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

[Bug]: nil pointer dereference in convertToFriendlyError #656

Open
displague opened this issue Apr 25, 2024 · 0 comments
Open

[Bug]: nil pointer dereference in convertToFriendlyError #656

displague opened this issue Apr 25, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@displague
Copy link
Member

Terraform Version

1.8.2

Equinix Provider Version

1.36.0

Effected Terraform Resources

No response

Terraform Config Files

No response

Debug Output

No response

Panic Output

No response

Expected Behavior

No errors

Actual Behavior

│   with equinix_metal_project.nutanix[0],                                                     
│   on main.tf line 21, in resource "equinix_metal_project" "nutanix":                          
│   21: resource "equinix_metal_project" "nutanix" {                                           
│                                                                                              
│ The plugin.(*GRPCProvider).ReadResource request was cancelled.
╵                                                                                              
                        
Stack trace from the terraform-provider-equinix_v1.36.0 plugin:                                 
                                                                                               
panic: runtime error: invalid memory address or nil pointer dereference                         
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0xe01eb7]
                                                                                                                                                                                              
goroutine 38 [running]:                                      
github.com/equinix/terraform-provider-equinix/internal/errors.convertToFriendlyError({0xc0004b4580, 0x1, 0x1}, 0x0)
        github.com/equinix/terraform-provider-equinix/internal/errors/errors.go:36 +0x37
github.com/equinix/terraform-provider-equinix/internal/errors.FriendlyErrorForMetalGo({0x1704c80?, 0xc0004190e0?}, 0xc0004a7080?)
        github.com/equinix/terraform-provider-equinix/internal/errors/errors.go:31 +0x77
github.com/equinix/terraform-provider-equinix/internal/resources/metal/project.fetchProject({0x170d088?, 0xc0004a7080?}, 0xc0004a7080?, {0xc000040300, 0x24})
        github.com/equinix/terraform-provider-equinix/internal/resources/metal/project/resource.go:188 +0x13c
github.com/equinix/terraform-provider-equinix/internal/resources/metal/project.(*Resource).Read(0xc000820030, {0x170d088, 0xc0004a7080}, {{{{0x1712db8, 0xc0006438f0}, {0x134b2a0, 0xc000643710}}, {0x17150a0, 0xc0000a8af0}}, 0xc000112478, .
..}, ...)
        github.com/equinix/terraform-provider-equinix/internal/resources/metal/project/resource.go:159 +0x1e6
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).ReadResource(0xc0003e3040, {0x170d088, 0xc0004a7080}, 0xc0006420f0, 0xc0005a7620)
        github.com/hashicorp/terraform-plugin-framework@v1.6.1/internal/fwserver/server_readresource.go:101 +0x64e
github.com/hashicorp/terraform-plugin-framework/internal/proto5server.(*Server).ReadResource(0xc0003e3040, {0x170d088?, 0xc0004a6f60?}, 0xc0004b22c0)
        github.com/hashicorp/terraform-plugin-framework@v1.6.1/internal/proto5server/server_readresource.go:56 +0x3e5
github.com/hashicorp/terraform-plugin-mux/tf5muxserver.(*muxServer).ReadResource(0x170d0c0?, {0x170d088?, 0xc0004a6c60?}, 0xc0004b22c0)
        github.com/hashicorp/terraform-plugin-mux@v0.15.0/tf5muxserver/mux_server_ReadResource.go:35 +0x193
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadResource(0xc0000b6140, {0x170d088?, 0xc0004a6270?}, 0xc00033a7e0)
        github.com/hashicorp/terraform-plugin-go@v0.22.0/tfprotov5/tf5server/server.go:775 +0x4c3
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler({0x14c57a0?, 0xc0000b6140}, {0x170d088, 0xc0004a6270}, 0xc0004c6000, 0x0)
        github.com/hashicorp/terraform-plugin-go@v0.22.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:482 +0x169
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0001a6e00, {0x170d088, 0xc0004a61e0}, {0x1713b08, 0xc0003e2ea0}, 0xc0004ba000, 0xc0000b2ba0, 0x212be08, 0x0)
        google.golang.org/grpc@v1.62.0/server.go:1383 +0xe03                                                           
google.golang.org/grpc.(*Server).handleStream(0xc0001a6e00, {0x1713b08, 0xc0003e2ea0}, 0xc0004ba000)
        google.golang.org/grpc@v1.62.0/server.go:1794 +0x100c                                                          
google.golang.org/grpc.(*Server).serveStreams.func2.1()                                                                
        google.golang.org/grpc@v1.62.0/server.go:1027 +0x8b                                                            
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 27
        google.golang.org/grpc@v1.62.0/server.go:1038 +0x135                                                           

Error: The terraform-provider-equinix_v1.36.0 plugin crashed!                                                          

This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.

Steps to Reproduce

It is possible that the laptop was going to sleep and the socket terminated in an unusual way. I'm not sure. In anycase, there is a possible reference to a nil that could be addressed to prevent this trace in the future

@displague displague added the bug Something isn't working label Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant