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(server): crash when non-existent server type is used #659

Merged
merged 1 commit into from
Apr 13, 2023

Conversation

apricote
Copy link
Member

Using a server type that does not exist would crash the plugin with

Stack trace from the terraform-provider-hcloud_v1.38.0 plugin:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x60 pc=0x104b539a0]

goroutine 98 [running]:
github.com/hetznercloud/terraform-provider-hcloud/internal/server.resourceServerCreate({0x104e9f9a8, 0x140005d0240}, 0x0?, {0x104de5a80?, 0x140001c5c20?})
github.com/hetznercloud/terraform-provider-hcloud/internal/server/resource.go:280 +0xe0

Using a server type that does not exist would crash the plugin with

    Stack trace from the terraform-provider-hcloud_v1.38.0 plugin:
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x2 addr=0x60 pc=0x104b539a0]

    goroutine 98 [running]:
    github.com/hetznercloud/terraform-provider-hcloud/internal/server.resourceServerCreate({0x104e9f9a8, 0x140005d0240}, 0x0?, {0x104de5a80?, 0x140001c5c20?})
    github.com/hetznercloud/terraform-provider-hcloud/internal/server/resource.go:280 +0xe0
@apricote apricote added the crash label Apr 13, 2023
@apricote apricote self-assigned this Apr 13, 2023
@apricote
Copy link
Member Author

Test failure is a flake.

@apricote apricote merged commit 5b7a20c into main Apr 13, 2023
@apricote apricote deleted the fix-crash-missing-server-type branch April 13, 2023 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants