dagger/dagger · error

cannot resolve result ref %d without cache

Error message

cannot resolve result ref %d without cache

What it means

Returned by ResultCall.refCall when a ResultCallRef carries only a numeric ResultID, no inline Call, no live shared call, and the cache argument is nil. Resolving an ID-based ref requires looking up the shared result in the Cache, so a nil cache makes the ref unresolvable — usually the caller forgot to thread EngineCache through.

Source

Thrown at dagql/result_call_frame.go:676

func (frame *ResultCall) receiverCall(c *Cache) (*ResultCall, error) {
	if frame == nil || frame.Receiver == nil {
		return nil, nil
	}
	return frame.refCall(c, frame.Receiver)
}

func (frame *ResultCall) refCall(c *Cache, ref *ResultCallRef) (*ResultCall, error) {
	if err := ref.Validate(); err != nil {
		return nil, err
	}
	if ref.Call != nil {
		return ref.Call, nil
	}
	if target := ref.loadSharedCall(); target != nil {
		return target, nil
	}
	if c == nil {
		return nil, fmt.Errorf("cannot resolve result ref %d without cache", ref.ResultID)
	}
	target := c.resultCallByResultID(sharedResultID(ref.ResultID))
	if target == nil {
		return nil, fmt.Errorf("missing result call frame for shared result %d", ref.ResultID)
	}
	return target, nil
}

func (frame *ResultCall) recipeDigestWithVisiting(c *Cache, visiting map[sharedResultID]struct{}) (digest.Digest, error) {
	if frame == nil {
		return "", nil
	}

	frame.recipeDigestOnce.Do(func() {
		field, err := resultCallIdentityField(frame)
		if err != nil {
			frame.recipeDigestErr = err
			return

View on GitHub (pinned to 82ba2681db)

Solutions

  1. Pass the engine cache (EngineCache(ctx)) into refCall/receiverCall
  2. Materialize the ref with an inline Call before the cache is gone
  3. Ensure resolution happens while the session cache is still alive
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at dagql/result_call_frame.go:676 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of dagger/dagger@82ba2681db (2026-09-05). Data as JSON: /api/errors/8d277449e434f771. Report an issue: GitHub.