TL;DR: Terragrunt does NOT create your state bucket by default (`--backend-bootstrap` defaults to `false`), so `init` fails with "bucket not found" on a fresh environment. Run `terragrunt backend bootstrap` once to create it.

```text
Initializing the backend...
Error: Failed to get existing workspaces: S3 bucket "my-state-bucket" does not exist.
```

(Exact wording varies; the constant is init failing because the bucket named in `remote_state` isn't there.)

## Steps

1. Check whether the bucket exists at all, and as whom: `aws s3api head-bucket --bucket [bucket]` and `aws sts get-caller-identity`.
   Expected: you know if it's missing vs misnamed vs a credentials problem.
2. If it's genuinely missing, create it through Terragrunt: `terragrunt backend bootstrap`.
   Expected: bucket created and reconciled with your `remote_state` config (versioning etc.).
3. Or enable it per-run: `terragrunt run --backend-bootstrap -- init`.
   Expected: init creates what's missing, then proceeds.
4. Re-run init.
   Expected: backend initializes.

## When this applies

- First deploy to a new environment/account; the bucket was never created.
- You assumed Terragrunt creates backend resources automatically.

## When it doesn't apply

- The bucket exists but access is denied: that's IAM, not bootstrapping.
- `disable_init = true` in the `remote_state` block: then nothing is created regardless of the flag; fix the block.
- Azure (`azurerm`) backend: Terragrunt does NOT bootstrap Azure storage at all; create the account and container out of band.

## Tool versions

All Terragrunt 1.x. Only `s3` and `gcs` backends support automatic creation.

## Why it happens

Backend bootstrapping is opt-in because creating cloud resources as a side effect of `init` surprises people. The default keeps `init` read-only with respect to the account, which means fresh environments need one explicit bootstrap.

## Edge cases

- For S3, bootstrap also UPDATES an existing bucket to match `remote_state` (e.g. versioning), so it's worth running against buckets that already exist.
- A bucket name that's wrong (typo) fails the same way; `head-bucket` distinguishes "missing" from "misnamed" before you bootstrap the wrong name.