dagger/dagger · error

context directory call: %w

Error message

context directory call: %w

What it means

Wraps a failure to retrieve the ResultCall (the dagql call metadata) of the context Directory instance. LoadContextDir needs the call to compute a content digest for cache keying; if the instance's result call cannot be resolved, this error is returned.

Source

Thrown at core/modulesource.go:1520

	//   2. otherwise the module source itself.
	//
	// NOTE: this applies unilaterally, whether the module was loaded from Host,
	// Git, or a Directory.
	if ws, ok := WorkspaceFromContext(ctx); ok {
		inst, err = src.loadContextFromWorkspace(ctx, dag, ws, path, filterInputs)
	} else {
		inst, err = NewModuleSourceFS(nil, src).directory(ctx, dag, path, filterInputs)
	}
	if err != nil {
		return inst, err
	}
	instID, err := inst.ID()
	if err != nil {
		return inst, fmt.Errorf("context directory ID: %w", err)
	}
	instCall, err := inst.ResultCall()
	if err != nil {
		return inst, fmt.Errorf("context directory call: %w", err)
	}
	if instID != nil && instCall.ContentDigest() == "" {
		snapshot, err := inst.Self().Snapshot.GetOrEval(ctx, inst.Result)
		if err != nil {
			return inst, fmt.Errorf("context directory snapshot: %w", err)
		}
		dirPath, err := inst.Self().Dir.GetOrEval(ctx, inst.Result)
		if err != nil {
			return inst, fmt.Errorf("context directory path: %w", err)
		}
		dgst, err := GetContentHashFromDirectory(ctx, snapshot, dirPath)
		if err != nil {
			return inst, fmt.Errorf("failed to content-hash contextual directory: %w", err)
		}
		inst, err = inst.WithContentDigest(ctx, dgst)
		if err != nil {
			return inst, fmt.Errorf("failed to set contextual directory content digest: %w", err)
		}

View on GitHub (pinned to 82ba2681db)

Solutions

  1. Look at the wrapped inner error for the root cause
  2. Ensure the Directory instance originates from a dagql Select call with recorded call metadata
  3. Retry the module load after clearing the engine session if state appears stale
  4. File an upstream issue with reproduction if it persists
Defensive patterns

Strategy: try-catch

Validate before calling

// Go: ensure instance was produced by a Select (has result metadata)
if inst.Result == nil {
    return fmt.Errorf("directory has no dagql result; obtain it via dag.Select")
}

Try / catch

instCall, err := inst.ResultCall()
if err != nil {
    return nil, fmt.Errorf("context directory call: %w", err)
}

Prevention

When it happens

Trigger: ModuleSource.LoadContextDir runs and inst.ResultCall() fails — the dagql instance lacks a recorded result call, usually because the instance wasn't produced by a normal dagql Select/evaluation.

Common situations: Hit in internal module-loading paths, especially with workspace-bound contexts or custom Directory provisioning; almost always an engine-internal state issue rather than a user mistake.

Related errors


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