Skip to content
Latchkey

CircleCI attach_workspace "No workspace found" - Fix

A job ran attach_workspace but no workspace was available to attach. Either no upstream job persisted one, or this job does not depend on the job that did, so the data is not in scope.

What this error means

The downstream job fails at attach_workspace saying no workspace is available, or attaches an empty directory. Files persisted upstream never appear because the dependency chain is broken.

job log
attach_workspace
  - Attaching workspace...
  - Error: No workspace found. Did an upstream job persist_to_workspace,
    and does this job 'require' it?

Common causes

No requires dependency on the persisting job

A workspace only flows to jobs downstream of the one that persisted it. Without requires: [build] in the workflow, the attaching job is not downstream and sees no workspace.

Upstream never persisted

If the upstream job did not run persist_to_workspace (or failed before it), there is nothing for this job to attach.

Wrong attach location

Attaching at a path that does not match how the files are referenced makes them look absent even when the workspace attached.

How to fix it

Add the requires dependency in the workflow

.circleci/config.yml
workflows:
  ci:
    jobs:
      - build
      - deploy:
          requires:
            - build   # makes the build's workspace available

Ensure upstream persists what downstream attaches

  1. Confirm the upstream job runs persist_to_workspace after producing files.
  2. Use a matching attach_workspace.at in the downstream job.
  3. List the attached directory while debugging to confirm contents.

How to prevent it

  • Wire requires: so every attaching job is downstream of the persisting job.
  • Keep persist/attach roots consistent across the workflow.
  • Fail fast by listing attached files in the downstream job.

Frequently asked questions

What causes ""No workspace found""?
A workspace only flows to jobs downstream of the one that persisted it. Without requires: [build] in the workflow, the attaching job is not downstream and sees no workspace.
How do I fix "No workspace found"?
Add the requires dependency in the workflow

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card