Skip to content
Latchkey

Cargo "failed to load manifest for workspace member" in CI

Cargo read your workspace’s members list (or a glob) and could not load one of the crates it names. A member directory was moved, deleted, or never checked out, so the workspace manifest references a crate that isn’t there.

What this error means

cargo aborts before building with failed to load manifest for workspace member <path> or package X is not a member of workspace. The workspace can’t even be assembled, so nothing in it builds - common after a crate is renamed or a member is excluded from the CI checkout.

cargo output
error: failed to load manifest for workspace member `/home/runner/work/app/crates/api`
referenced by workspace at `/home/runner/work/app/Cargo.toml`

Caused by:
  failed to read `/home/runner/work/app/crates/api/Cargo.toml`
Caused by:
  No such file or directory (os error 2)

Common causes

A members path or glob points at a missing crate

The [workspace] members = [...] list (or a crates/* glob) names a directory that was moved, renamed, or removed, so Cargo can’t read its Cargo.toml.

A member wasn’t included in the CI checkout

A sparse checkout, a submodule that wasn’t initialized, or a path member living in another repo means the directory is absent on the runner even though it exists locally.

How to fix it

Align the members list with the real directories

Update the workspace manifest so every member resolves on the runner, using a glob if members come and go.

Cargo.toml
[workspace]
members = ["crates/*"]   # or list explicit, existing paths
exclude = ["crates/scratch"]

Make sure every member is checked out

  1. Run find . -name Cargo.toml -maxdepth 3 in a debug step to see which members exist.
  2. Initialize submodules (actions/checkout with submodules: recursive) if a member is a submodule.
  3. For members in another repo, check that repo out into the expected relative path.

How to prevent it

  • Use a crates/* glob so adding/removing members doesn’t desync the list.
  • Keep members/exclude updated whenever you move or rename a crate.
  • Check out submodules and sibling-repo members in CI so paths resolve.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →