Earthly "target not found" / target does not exist in CI
Earthly looks up the +target you named in the Earthfile at the given path. If no target by that name exists there, or the path points at the wrong Earthfile, Earthly reports that the target does not exist.
What this error means
earthly fails immediately with "Error: target +X does not exist" or "target not found", before any build steps run.
earthly
Error: target +unit-tests does not exist
target +unit-tests not found in Earthfile ./EarthfileCommon causes
The target name is misspelled
The +target you invoked does not match any target header in the Earthfile, usually a typo or a renamed target.
Wrong path to the Earthfile
The reference points at a directory whose Earthfile does not define that target, so the lookup fails.
How to fix it
List the real targets
- List the targets defined in the Earthfile.
- Invoke the exact name, including the correct path prefix.
- Re-run once the reference matches a defined target.
Terminal
earthly ls
earthly ./services/api+testMatch the path to the Earthfile
Reference the target relative to the Earthfile that defines it, using the +target syntax with the correct directory.
How to prevent it
- Use
earthly lsto confirm target names before scripting them. - Keep target references in CI in sync with the Earthfile.
- Reference targets by their full path prefix in a monorepo.
Related guides
Earthly "failed to solve" BuildKit error in CIFix Earthly "failed to solve" in CI - BuildKit could not execute a step in the target graph. The real cause i…
Earthly "Earthfile syntax error" in CIFix Earthly Earthfile syntax errors in CI - the parser rejected the file before building, usually a bad comma…
Earthly "SAVE ARTIFACT ... not found" in CIFix Earthly "SAVE ARTIFACT ... not found" in CI - the path you saved does not exist in the build container, s…