terraform-provider-hcloud
terraform-provider-hcloud copied to clipboard
[Bug]: panic: runtime error: invalid memory address or nil pointer dereference
What happened?
Running the provider it will sometimes (definitely not always) result in this stack trace:
Releasing state lock. This may take a few moments...
Stack trace from the terraform-provider-hcloud_v1.27.0 plugin:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xaf8c56]
goroutine 63 [running]:
github.com/hetznercloud/hcloud-go/hcloud.(*ActionClient).WatchOverallProgress.func1(0xc0000c6a80, 0xc000724840, 0xc0008281d0, 0x1, 0x1, 0xc000478178, 0x10fea38, 0xc000716fc0)
github.com/hetznercloud/[email protected]/hcloud/action.go:196 +0x176
created by github.com/hetznercloud/hcloud-go/hcloud.(*ActionClient).WatchOverallProgress
github.com/hetznercloud/[email protected]/hcloud/action.go:189 +0xde
Error: The terraform-provider-hcloud_v1.27.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.
After upgrading to 1.32.2 I still get this:
Releasing state lock. This may take a few moments...
Stack trace from the terraform-provider-hcloud_v1.32.2 plugin:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xa6b40f]
goroutine 130 [running]:
github.com/hetznercloud/hcloud-go/hcloud.(*ActionClient).WatchOverallProgress.func1()
github.com/hetznercloud/[email protected]/hcloud/action.go:196 +0x1af
created by github.com/hetznercloud/hcloud-go/hcloud.(*ActionClient).WatchOverallProgress
github.com/hetznercloud/[email protected]/hcloud/action.go:189 +0x133
Error: The terraform-provider-hcloud_v1.32.2 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.
Which looks exactly like the same stacktrace so we can see that this has been in here for some time. I'm not sure this is a problem in this provider or in hcloud-go but I thought starting here from the provider would be fair.
The lines leading up to the stacktrace are:
Acquiring state lock. This may take a few moments...
module.dynamic_environments["test"].hcloud_volume_attachment.database: Destroying... [id=1337]
module.dynamic_environments["test"].hcloud_server_network.database: Destroying... [id=1337-1337]
module.dynamic_environments["test"].hcloud_server_network.database: Still destroying... [id=1337-1337, 10s elapsed]
module.dynamic_environments["test"].hcloud_volume_attachment.database: Still destroying... [id=1337, 10s elapsed]
╷
│ Warning: Applied changes may be incomplete
│
│ The plan was created with the -target option in effect, so some changes
│ requested in the configuration may have been ignored and the output values
│ may not be fully updated. Run the following command to verify that no other
│ changes are pending:
│ terraform plan
│
│ Note that the -target option is not suitable for routine use, and is
│ provided only for exceptional situations such as recovering from errors or
│ mistakes, or when Terraform specifically suggests to use it as part of an
│ error message.
╵
╷
│ Error: Plugin did not respond
│
│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
│ contain more details.
╵
╷
│ Error: Plugin did not respond
│
│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
│ contain more details.
╵
What did you expect to happen?
It shouldn't crash.
Please provide a minimal working example
It's really hard to pinpoint the exact cause as it's not perfectly reproducible but it seems to always occur when destroying a related hcloud_volume_attachment
, hcloud_server_network
both in the same destruction run.