---
title: "MGS8001: output ref not found"
description: Fires when magus query output <ref> names a well-formed reference id but no captured output is stored for it; magus then predicts which workspace target would mint it, or reports that none does, rather than leaving you with a dead end.
tags: [MGS8001, output refs, query, cache, retrieval]
---

# MGS8001: output ref not found

Every target that runs is given a short reference id (`out1a2b3c`) for its
captured output, retrievable later with `magus query output <ref>`. This code fires
when the ref is well-formed but no store holds output for it - it aged out of the
cache (the store keeps only the last few executions per target and prunes by age
and size), it was mistyped or copied incompletely, or it was minted somewhere its
output never reached.

A ref cannot be decoded back into a target - it is a truncated hash, not an
encoding - but it CAN be predicted: magus sweeps every candidate target in the
workspace, keys each exactly as a run would, and compares. That prints one of
two outcomes alongside the diagnostic:

- **A match.** Nothing here has produced this output, but a target's live cache
  key equals the ref, so magus prints the exact command that would mint it:
  `magus run <target> [project]`.
- **No match.** No target in this workspace keys to the ref at the current tree,
  which means the run that printed it had different inputs - a different commit,
  an uncommitted change, or a different environment - not that the lookup is
  broken.

## Resolution

- If magus found a match, run the printed command; it mints the ref and gives
  you the output.
- If it found none and you know (or suspect) which target minted it, run `magus
  describe target <target> --cache --against <ref>` to name the exact input that
  drifted, instead of guessing.
- If someone else already produced the output, ask them to share it: `magus
  query output <ref> --publish` on their machine uploads it as a signed bundle
  that resolves the same ref on yours.

A ref you copied short also lands here when it matches nothing, so check you
took the whole id.

## See also

- [Reproducing a ref that resolves nowhere](../../../concepts/cache/output-refs.md#reproducing-a-ref-that-resolves-nowhere):
  how the prediction works.
- [What the ref does not depend on](../../../concepts/cache/output-refs.md#what-the-ref-does-not-depend-on):
  what is and is not part of the key a ref truncates.
