Why am I getting "fatal: bad object" errors with Git commands in promoted runs?

Last updated: September 8, 2025

Context

When using Git commands like `git show` with the $TF_VAR_spacelift_commit_sha environment variable in promoted runs, you may encounter "fatal: bad object" errors. This typically occurs when trying to access commit information in tracked runs generated from a promoted run.

Answer

If you're experiencing "fatal: bad object" errors in promoted runs, this is likely due to an outdated launcher image in your worker pool. To resolve this issue:

  1. Check your worker pool pod specification for the launcher image version

  2. Update the launcher image to the latest version:

    • If using ECR directly: Use `public.ecr.aws/spacelift/launcher:latest`

    • If using Pull Through Cache: Ensure your private repository is synced with the latest public image

  3. After updating the launcher image, retry your promoted run

Note: If you're using private workers with the Kubernetes controller, simply updating the launcher image should resolve the issue. There's no need to manually recycle the worker pool if you have dynamic worker scaling enabled, as new workers will automatically use the updated image.

The proper functionality can be verified by checking that the Git commands using $TF_VAR_spacelift_commit_sha execute successfully in your promoted runs.