Test failure: `TestRemote_applyCanceled`
Author: SarahFrenchCreated Sep 15, 2026Updated Sep 15, 2026
Labelstests
I encountered this test failure during https://github.com/hashicorp/terraform/pull/39201, which didn't change anything related to the remote backend.
Recording this as a bug in case it surfaces again.
!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!
Terraform crashed! This is always indicative of a bug within Terraform.
Please report the crash with Terraform[1] so that we can fix this.
When reporting bugs, please include your terraform version, the stack trace
shown below, and any additional information which may help replicate the issue.
[1]: https://github.com/hashicorp/terraform/issues
!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!
--- FAIL: TestRemote_applyCanceled (0.01s)
backend_apply_test.go:140: expected apply operation to fail
panic: runtime error: invalid memory address or nil pointer dereference
goroutine 73 [running]:
runtime/debug.Stack()
/opt/hostedtoolcache/go/1.26.4/x64/src/runtime/debug/stack.go:26 +0x5e
github.com/hashicorp/terraform/internal/logging.PanicHandler()
/home/runner/work/terraform/terraform/internal/logging/panic.go:84 +0x15c
panic({0x20e69c0?, 0x3ded230?})
/opt/hostedtoolcache/go/1.26.4/x64/src/runtime/panic.go:860 +0x13a
github.com/hashicorp/terraform/internal/backend/remote.(*Remote).cancel(0x394c8bfe5bc0, {0x26f0a20, 0x394c8be72ff0}, 0x394c8bfe6f00, 0x394c8bf2f688)
/home/runner/work/terraform/terraform/internal/backend/remote/backend.go:886 +0x134
github.com/hashicorp/terraform/internal/backend/remote.(*Remote).Operation.func1()
/home/runner/work/terraform/terraform/internal/backend/remote/backend.go:863 +0x3ca
created by github.com/hashicorp/terraform/internal/backend/remote.(*Remote).Operation in goroutine 56
/home/runner/work/terraform/terraform/internal/backend/remote/backend.go:828 +0x515
FAIL github.com/hashicorp/terraform/internal/backend/remote 0.126s
Source: hashicorp/terraform