Troubleshooting
405 Method Not Allowed on LOCK/UNLOCK- Cause: Terraform backend uses custom HTTP verbs; routes not wired.
- Fix: Add explicit routes in Echo:
e.Add("LOCK", "/v1/backend/*", ...)
ande.Add("UNLOCK", "/v1/backend/*", ...)
. Rebuild and restart.
- Cause: Backend update handler doesn’t read lock ID from query.
- Fix: Read lock ID from header
X-Terraform-Lock-ID
or queryID
/id
.
- Cause: The
id
already exists remotely; renaming the Terraform resource block doesn’t change the remote ID. - Fix: Import (
terraform import opentaco_unit.NAME <id>
), changeid
, or delete the existing unit (./taco unit rm <id>
).
- Fix (dev override):
- Cause: Auth is enforced by default;
/v1
and/v1/backend/*
requireAuthorization: Bearer <access>
. - Fix:
- Use
./taco login
and then run unit commands; the CLI attaches Bearer automatically.- Ensure tokens exist in
~/.config/opentaco/credentials.json
under the current--server
. - Temporarily disable auth for Terraform backend testing with:
./opentacosvc -auth-disable
.
- Ensure tokens exist in
taco creds
(for /s3
)
- Cause: No valid access/refresh tokens or server’s signing key rotated.
- Fix:
./taco login --server <url> --force-login
. For fewer re‑logins across restarts, pinOPENTACO_TOKENS_PRIVATE_KEY_PEM_PATH
on the server.
credential_process
exits with 126
- Cause: Path to
taco
is not executable or contains spaces without quotes. - Fix: Use an absolute, quoted path and
chmod +x
the binary.
terraform.tfstate
- Cause: Client thinks the tfstate object exists but is empty.
- Fix: Ensure you’re running a build where empty tfstate GET/HEAD returns
404
. Rebuild/restart service and re‑runterraform init -reconfigure
withuse_lockfile = true
.
- Cause: Leftover lock.
- Fix:
./taco unit unlock <id> <lock-id>
(lock ID is positional). If unknown, check the last error Terraform printed; it includes the lock ID.