{"record":{"id":"170257d7b1cb7057","repo":"dagger/dagger","slug":"workspace-host-path-is-required","errorCode":null,"errorMessage":"workspace host path is required","messagePattern":"workspace host path is required","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/schema/workspace_migrate_parent.go","lineNumber":52,"sourceCode":"\tif err != nil {\n\t\treturn nil, err\n\t}\n\tparentPlans, err := workspaceMigrationParentPlans(ws, assignments, workspacePlans)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif parentPlans, err = workspaceMigrationInstallParentSDKModules(workspacePlans, parentPlans, assignments); err != nil {\n\t\treturn nil, err\n\t}\n\treturn workspaceMigrationWarnExplicitModuleLoading(ws, workspacePlans, parentPlans, assignments)\n}\n\nfunc workspaceMigrationParentAssignments(\n\tws *core.Workspace,\n\tcompatWorkspaces []*workspace.CompatWorkspace,\n) ([]workspaceMigrationParentAssignment, error) {\n\tif ws == nil || ws.HostPath() == \"\" {\n\t\treturn nil, fmt.Errorf(\"workspace host path is required\")\n\t}\n\n\tassignments := make([]workspaceMigrationParentAssignment, 0, len(compatWorkspaces))\n\tfor _, compatWorkspace := range compatWorkspaces {\n\t\tif compatWorkspace == nil {\n\t\t\tcontinue\n\t\t}\n\t\t// A discovered local dependency/toolchain target is loaded through its\n\t\t// referrer, not explicitly; it must not create a parent workspace, hoist\n\t\t// its runtime, or warn about explicit loading.\n\t\tif compatWorkspace.DiscoveredLocalModule {\n\t\t\tcontinue\n\t\t}\n\t\tif compatWorkspace.Config == nil || compatWorkspace.Config.SDK == nil {\n\t\t\tcontinue\n\t\t}\n\t\trel, err := workspaceMigrationProjectRootRelPath(ws, compatWorkspace.ProjectRoot)\n\t\tif err != nil {","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/core/schema/workspace_migrate_parent.go#L34-L70","documentation":"workspaceMigrationParentAssignments computes which compat workspaces get a parent plan, and requires a concrete local workspace (non-nil, with a non-empty HostPath) because parent assignments are local-path based. This error means the function was invoked with no local workspace host path, so relative parent paths cannot be computed.","triggerScenarios":"Calling workspaceMigrationParentPlansForPlainModules with a nil ws or a remote/virtual workspace whose HostPath() returns \"\" (e.g. workspace never materialized locally).","commonSituations":"Running migration for a remote or in-memory workspace where local checkout is absent; regression where ws is nil due to earlier failed discovery; invoking parent-plan machinery outside the normal local migrate flow.","solutions":["Ensure the workspace is materialized locally with a valid HostPath before parent planning","Check that workspace discovery succeeded and returned a non-nil workspace","Skip parent-plan flow for non-local workspaces; run the local-only migration path instead","Verify ws.HostPath() is set after workspace load"],"exampleFix":"// before\nplans, err := workspaceMigrationParentPlansForPlainModules(remoteWS, cw)\n// after\nif remoteWS.HostPath() == \"\" {\n    return fmt.Errorf(\"migration requires a local workspace\")\n}\nplans, err := workspaceMigrationParentPlansForPlainModules(localWS, cw)","handlingStrategy":"validation","validationCode":"if ws == nil || ws.HostPath() == \"\" {\n    return fmt.Errorf(\"parent assignment requires a locally materialized workspace\")\n}","typeGuard":"func isLocalWorkspace(ws *core.Workspace) bool {\n    return ws != nil && ws.HostPath() != \"\"\n}","tryCatchPattern":"plans, err := workspaceMigrationParentPlansForPlainModules(ws, cws)\nif err != nil {\n    if strings.Contains(err.Error(), \"workspace host path is required\") {\n        return fmt.Errorf(\"migration requires a local checkout; materialize the workspace first: %w\", err)\n    }\n    return err\n}","preventionTips":["Only run parent planning for local (HostPath-backed) workspaces","Materialize remote workspaces locally before migration","Check ws.HostPath() after discovery and fail early if empty"],"tags":["migration","workspace","parent-plan","validation"],"backgroundTag":"missing-host-path","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"}