{"record":{"id":"a881ac08a88a6d59","repo":"dagger/dagger","slug":"workspace-has-no-client-id","errorCode":null,"errorMessage":"workspace has no client ID","messagePattern":"workspace has no client ID","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/schema/modulesource.go","lineNumber":3461,"sourceCode":"\t\t\t\treturn cycle\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n\treturn visit(src, nil)\n}\n\n// withModuleSourceWorkspaceClientContext restores host access when a workspace\n// belongs to a client. Value workspaces carry their complete filesystem value\n// and therefore need no client context.\nfunc withModuleSourceWorkspaceClientContext(ctx context.Context, workspace *core.Workspace) (context.Context, error) {\n\tif workspace.ClientID != \"\" {\n\t\treturn withWorkspaceClientContext(ctx, workspace)\n\t}\n\tif workspace.IsValueWorkspace() {\n\t\treturn ctx, nil\n\t}\n\treturn nil, fmt.Errorf(\"workspace has no client ID\")\n}\n\n// generateOneLocalDependency generates the single dependency at depPath by\n// running only its owning SDK's generator (looked up in owners) against a\n// workspace scoped to depPath (as cwd) with the dependency's own transitive\n// staging (depStaging) applied and recorded via\n// __withGeneratedLocalDependencies, and returns that dependency's changeset. Returns a nil result when no SDK claims the\n// dependency, so the caller skips it. Wrapped in a revealed span so the\n// per-dependency generation is visible in the trace.\nfunc (s *moduleSourceSchema) generateOneLocalDependency(\n\tctx context.Context,\n\tdag *dagql.Server,\n\tworkspace dagql.ObjectResult[*core.Workspace],\n\tdepPath string,\n\tdepStaging dagql.ObjectResult[*core.Changeset],\n\towners map[string]string,\n) (_ dagql.ObjectResult[*core.Changeset], rerr error) {\n\tctx, span := core.Tracer(ctx).Start(ctx, \"generate local dependency: \"+depPath)","sourceCodeStart":3443,"sourceCodeEnd":3479,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/core/schema/modulesource.go#L3443-L3479","documentation":"Guard in withModuleSourceWorkspaceClientContext: host access can only be restored when the workspace is bound to a client (ClientID set) or is a value workspace carrying its own filesystem. A workspace with neither cannot be used where host access is required (e.g. local dependency generation).","triggerScenarios":"Thrown at core/schema/modulesource.go:3461 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the workspace originates from a live client session with a client ID","Materialize the workspace as a value workspace before this call","Check the workspace wasn't constructed outside a client context"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}