{"record":{"id":"dbd9583eb510429f","repo":"dagger/dagger","slug":"sdks-are-not-env-scoped-uninstall-sdks-in-the-bas","errorCode":null,"errorMessage":"SDKs are not env-scoped; uninstall SDKs in the base workspace config","messagePattern":"SDKs are not env-scoped; uninstall SDKs in the base workspace config","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/schema/workspace_builders.go","lineNumber":435,"sourceCode":"\t\tif len(env.Modules) == 0 {\n\t\t\tenv.Modules = nil\n\t\t}\n\t}\n\tstaged.Config.Env[envName] = env\n\tupdated, err := workspace.UpdateConfigBytes(staged.Data, staged.Config)\n\tif err != nil {\n\t\treturn dagql.ObjectResult[*core.Workspace]{}, err\n\t}\n\treturn s.stageWorkspaceConfigBytes(ctx, parent, staged, updated)\n}\n\nfunc (s *workspaceSchema) withoutSDK(\n\tctx context.Context,\n\tparent dagql.ObjectResult[*core.Workspace],\n\targs workspaceUninstallArgs,\n) (dagql.ObjectResult[*core.Workspace], error) {\n\tif _, ok := selectedWorkspaceEnv(ctx); ok {\n\t\treturn dagql.ObjectResult[*core.Workspace]{}, fmt.Errorf(\"SDKs are not env-scoped; uninstall SDKs in the base workspace config\")\n\t}\n\treturn s.withoutModule(ctx, parent, args)\n}\n\nfunc (s *workspaceSchema) workspaceWithChangeset(\n\tctx context.Context,\n\tparent dagql.ObjectResult[*core.Workspace],\n\tchanges dagql.ObjectResult[*core.Changeset],\n) (dagql.ObjectResult[*core.Workspace], error) {\n\tif changes.Self() == nil {\n\t\treturn parent, nil\n\t}\n\tchangesID, err := changes.ID()\n\tif err != nil {\n\t\treturn dagql.ObjectResult[*core.Workspace]{}, err\n\t}\n\tsrv, err := core.CurrentDagqlServer(ctx)\n\tif err != nil {","sourceCodeStart":417,"sourceCodeEnd":453,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/core/schema/workspace_builders.go#L417-L453","documentation":"Policy guard in withoutSDK: an SDK uninstall was attempted while a workspace environment was selected. SDKs are not env-scoped — they are installed and removed only in the base workspace config — so the request is rejected instead of writing an env overlay.","triggerScenarios":"Thrown at core/schema/workspace_builders.go:435 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Clear the environment selection before uninstalling the SDK","Remove the SDK entry from the base workspace config"],"exampleFix":null,"handlingStrategy":"validation","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"}