TL;DR: Your working directory isn't initialized for the backend in your config. Run `tofu init`. If you changed the backend config itself, pick `tofu init -migrate-state` (keep your state) or `tofu init -reconfigure` (point at a fresh state).

```text
Error: Backend initialization required, please run "tofu init"

Reason: Backend configuration block has changed

The "backend" is the interface that OpenTofu uses to store state,
perform operations, etc. If this message is showing up, it means that the
OpenTofu configuration you're using is using a custom configuration for
the OpenTofu backend.

Changes to backend configurations require reinitialization. This allows
OpenTofu to set up the new configuration, copy existing state, etc. Please run
"tofu init" with either the "-reconfigure" or "-migrate-state" flags to
use the current configuration.
```

## Steps

1. If this is a fresh checkout (no `.terraform/` directory), just run `tofu init`.
   Expected: `Initializing the backend...` then `OpenTofu has been successfully initialized!`
2. If you CHANGED the backend block (local to S3, new bucket, new key), decide:
   - Keep the existing state: `tofu init -migrate-state`. tofu copies state from the old backend to the new one.
   - Point at a fresh/empty state: `tofu init -reconfigure`. tofu forgets the old backend entirely.
   Expected: init completes; `tofu plan` works.
3. Verify with `tofu plan`.
   Expected: the backend error is gone.

## When this applies

- `tofu plan` / `tofu apply` in a fresh clone, before any init.
- Right after editing the `backend` block.
- The `Reason:` line says `Initial configuration of the requested backend` or `Backend configuration block has changed`.

## When it doesn't apply

- Backend CREDENTIAL errors (`no valid credential sources`, `AccessDenied`) mean init ran but auth failed. Different fix.
- `Error: Failed to save state` happens after apply, not before init.

## Tool versions

All OpenTofu versions.

## Why it happens

The backend is configured per working directory, in `.terraform/`. A fresh checkout has no `.terraform/`; a changed backend block invalidates the cached one. Either way tofu refuses to guess where your state lives and tells you to re-init explicitly.

## Edge cases

- `-migrate-state` prompts before copying; in CI add `-input=false` and be sure the migration is what you want.
- Deleting `.terraform/` and re-running plain `tofu init` after a backend change does NOT migrate state; it orphans the old state. Use the flags.
- Terragrunt users: a changed `remote_state` block has the same effect; clear `.terragrunt-cache` and re-run so the regenerated backend config is picked up.