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

SIGSEGV when saving remote state in Terraform 1.6.0-dev and up #34094

Closed
dradtke opened this issue Oct 16, 2023 · 2 comments
Closed

SIGSEGV when saving remote state in Terraform 1.6.0-dev and up #34094

dradtke opened this issue Oct 16, 2023 · 2 comments
Labels
bug cloud Related to Terraform Cloud's integration with Terraform new new issue not yet triaged

Comments

@dradtke
Copy link

dradtke commented Oct 16, 2023

Terraform Version

Terraform v1.6.1
on linux_amd64

Terraform Configuration Files

N/A

Debug Output

Can be provided if needed, but I think the stack trace should be enough.

Expected Behavior

The apply should have completed successfully.

Actual Behavior

The apply failed with

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

goroutine 486 [running]:
github.com/hashicorp/go-tfe.(*stateVersions).Upload.func1()
	/home/runner/go/pkg/mod/github.com/hashicorp/[email protected]/state_version.go:294 +0xb6
golang.org/x/sync/errgroup.(*Group).Go.func1()
	/home/runner/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:75 +0x56
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 26
	/home/runner/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:72 +0x96

Steps to Reproduce

Set up a Terraform project with an Artifactory backend, and run

$ terraform apply

Additional Context

We are using Artifactory internally to hold our remote state, and to host some custom internal providers.

However, we don't believe these providers are the issue, since the stack trace does not reference them, and our changes are still being applied successfully even when Terraform crashes; it's only the remote state that does not get saved.

References

No response

@dradtke dradtke added bug new new issue not yet triaged labels Oct 16, 2023
@jbardin jbardin added the cloud Related to Terraform Cloud's integration with Terraform label Oct 16, 2023
@radditude
Copy link
Member

radditude commented Oct 16, 2023

Thanks for reporting! This looks to be a known issue around handling upstream errors from the server when uploading state using the remote or cloud backends. That is to say, it's likely that your Artifactory instance returned a non-success error code when saving state, which unfortunately resulted in this panic rather than a more helpful error.

The fix has already been addressed in #34074 and should be released in v1.6.2.

@kmoe kmoe closed this as completed Oct 17, 2023
Copy link
Contributor

github-actions bot commented Dec 8, 2023

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug cloud Related to Terraform Cloud's integration with Terraform new new issue not yet triaged
Projects
None yet
Development

No branches or pull requests

4 participants