{"record":{"id":"94fb0d266eb91e5c","repo":"dagger/dagger","slug":"get-workspace-id-w","errorCode":null,"errorMessage":"get workspace ID: %w","messagePattern":"get workspace ID: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/modfunc.go","lineNumber":1292,"sourceCode":"\t\treturn nil, fmt.Errorf(\"%w: workspace arguments are not inherited by module runtime calls; pass a Workspace explicitly\", ErrNoCurrentWorkspace)\n\t}\n\n\tvar ws dagql.ObjectResult[*Workspace]\n\terr := dag.Select(ctx, dag.Root(), &ws,\n\t\tdagql.Selector{\n\t\t\tField: \"currentWorkspace\",\n\t\t\tArgs: []dagql.NamedInput{\n\t\t\t\t{Name: \"skipMigrationCheck\", Value: dagql.Boolean(true)},\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"load workspace: %w\", err)\n\t}\n\n\twsID, err := ws.ID()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"get workspace ID: %w\", err)\n\t}\n\treturn dagql.NewID[*Workspace](wsID), nil\n}\n\nfunc (fn *ModuleFunction) applyIgnoreOnDir(ctx context.Context, dag *dagql.Server, arg *FunctionArg, value any) (any, error) {\n\tif kind := arg.TypeDef.Self().Kind; kind != TypeDefKindObject {\n\t\treturn nil, fmt.Errorf(\"[kind=%v] argument %q must be of type Directory to apply ignore pattern: [%s]\", kind, arg.OriginalName, strings.Join(arg.Ignore, \",\"))\n\t}\n\tif objName := arg.TypeDef.Self().AsObject.Value.Self().Name; objName != \"Directory\" {\n\t\treturn nil, fmt.Errorf(\"[ObjName=%v] argument %q must be of type Directory to apply ignore pattern: [%s]\", objName, arg.OriginalName, strings.Join(arg.Ignore, \",\"))\n\t}\n\n\tif dag == nil {\n\t\treturn nil, fmt.Errorf(\"dagql server is nil but required to ignore pattern on directory %q\", arg.OriginalName)\n\t}\n\n\tapplyIgnore := func(dir dagql.IDable) (JSON, error) {\n\t\tvar ignoredDir dagql.Result[*Directory]","sourceCodeStart":1274,"sourceCodeEnd":1310,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/core/modfunc.go#L1274-L1310","documentation":"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.","triggerScenarios":"ws.ID() fails on the freshly loaded Workspace — typically an underlying error computing the ID of its source directory (unreadable content, underlying store failure).","commonSituations":"Workspace whose underlying directory content cannot be hashed (permissions, IO error); rare internal failures in the dagql ID cache layer.","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"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err != nil {\n\tif strings.Contains(err.Error(), \"get workspace ID\") {\n\t\t// workspace loaded but ID computation failed; check source readability\n\t}\n}","preventionTips":["Ensure workspace source directories are readable and content-hashable","Retry transient ID computation failures; recreate the workspace if persistent"],"tags":["dagger","workspace","id-resolution"],"backgroundTag":"workspace-id-resolution-failed","analyzedSha":"82ba2681dbe30d3547a1dc50ea495900ab5b6047","analyzedAt":"2026-09-05T07:21:37.930Z","contentChangedAt":"2026-09-05T07:21:37.930Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}