dagger/dagger · error
get workspace ID: %w
Error message
get workspace ID: %w
What it means
After successfully selecting the currentWorkspace object, loadWorkspaceArg calls ws.ID() to build the argument's dagql ID. If that ID computation fails, the error is wrapped as "get workspace ID". This is a late-stage failure: the workspace loaded but could not be fingerprinted.
Source
Thrown at core/modfunc.go:1292
return nil, fmt.Errorf("%w: workspace arguments are not inherited by module runtime calls; pass a Workspace explicitly", ErrNoCurrentWorkspace)
}
var ws dagql.ObjectResult[*Workspace]
err := dag.Select(ctx, dag.Root(), &ws,
dagql.Selector{
Field: "currentWorkspace",
Args: []dagql.NamedInput{
{Name: "skipMigrationCheck", Value: dagql.Boolean(true)},
},
},
)
if err != nil {
return nil, fmt.Errorf("load workspace: %w", err)
}
wsID, err := ws.ID()
if err != nil {
return nil, fmt.Errorf("get workspace ID: %w", err)
}
return dagql.NewID[*Workspace](wsID), nil
}
func (fn *ModuleFunction) applyIgnoreOnDir(ctx context.Context, dag *dagql.Server, arg *FunctionArg, value any) (any, error) {
if kind := arg.TypeDef.Self().Kind; kind != TypeDefKindObject {
return nil, fmt.Errorf("[kind=%v] argument %q must be of type Directory to apply ignore pattern: [%s]", kind, arg.OriginalName, strings.Join(arg.Ignore, ","))
}
if objName := arg.TypeDef.Self().AsObject.Value.Self().Name; objName != "Directory" {
return nil, fmt.Errorf("[ObjName=%v] argument %q must be of type Directory to apply ignore pattern: [%s]", objName, arg.OriginalName, strings.Join(arg.Ignore, ","))
}
if dag == nil {
return nil, fmt.Errorf("dagql server is nil but required to ignore pattern on directory %q", arg.OriginalName)
}
applyIgnore := func(dir dagql.IDable) (JSON, error) {
var ignoredDir dagql.Result[*Directory]View on GitHub (pinned to 82ba2681db)
Solutions
- Inspect the wrapped cause for the underlying ID computation failure
- Verify the workspace source directory is readable and valid
- Retry the call; if persistent, recreate the workspace from a known-good directory
Defensive patterns
Strategy: try-catch
Try / catch
if err != nil {
if strings.Contains(err.Error(), "get workspace ID") {
// workspace loaded but ID computation failed; check source readability
}
} Prevention
- Ensure workspace source directories are readable and content-hashable
- Retry transient ID computation failures; recreate the workspace if persistent
When it happens
Trigger: ws.ID() fails on the freshly loaded Workspace — typically an underlying error computing the ID of its source directory (unreadable content, underlying store failure).
Common situations: Workspace whose underlying directory content cannot be hashed (permissions, IO error); rare internal failures in the dagql ID cache layer.
Related errors
- get bound workspace ID: %w
- get bound workspace ID: %w
- verify skipped modules: %w
- read workspace root: %w
- get %s ID for address %q: %w
AI-assisted analysis of dagger/dagger@82ba2681db (2026-09-05).
Data as JSON: /api/errors/94fb0d266eb91e5c.
Report an issue: GitHub.