{"record":{"id":"f9593b2bed59701d","repo":"dagger/dagger","slug":"parsing-legacy-module-config-s-w","errorCode":null,"errorMessage":"parsing legacy module config %s: %w","messagePattern":"parsing legacy module config (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/schema/workspace_migrate.go","lineNumber":403,"sourceCode":"\t\tconfigPath := filepath.Join(ws.HostPath(), filepath.FromSlash(cp.Path))\n\t\tconfigDir := filepath.Dir(configPath)\n\t\thasWorkspaceConfig, err := workspaceMigrationHasExplicitConfigAncestor(workspaceCtx, statFS, ws.HostPath(), configDir)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tif hasWorkspaceConfig {\n\t\t\t// FIXME(workspace-migrate): Match the top-level explicit-config rule\n\t\t\t// for now: pre-existing workspace configs own migration below them.\n\t\t\tcontinue\n\t\t}\n\n\t\tdata, err := bk.ReadCallerHostFile(workspaceCtx, configPath)\n\t\tif err != nil {\n\t\t\treturn nil, nil, fmt.Errorf(\"reading legacy module config %s: %w\", cp.Path, err)\n\t\t}\n\t\tcompatWorkspace, err := workspaceMigrationCompatWorkspaceForLegacyConfig(data, configPath)\n\t\tif err != nil {\n\t\t\treturn nil, nil, fmt.Errorf(\"parsing legacy module config %s: %w\", cp.Path, err)\n\t\t}\n\t\tif compatWorkspace == nil {\n\t\t\tcontinue\n\t\t}\n\t\tcompatWorkspace.DiscoveredLocalModule = cp.DiscoveredLocalModule\n\t\tcompatWorkspaces = append(compatWorkspaces, compatWorkspace)\n\t}\n\treturn compatWorkspaces, discoveryWarnings, nil\n}\n\n// workspaceMigrationConfigPath is a legacy config selected for migration,\n// tagged with whether it was reached by following a local module reference\n// from the selected root config (rather than being the selection itself).\ntype workspaceMigrationConfigPath struct {\n\tPath                  string\n\tDiscoveredLocalModule bool\n}\n","sourceCodeStart":385,"sourceCodeEnd":421,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/core/schema/workspace_migrate.go#L385-L421","documentation":"Wraps a workspace.ParseLegacyModuleConfigTolerant failure (message in source reads 'parsing legacy module config') while reading a pre-workspace dagger.json from the caller's host during migration. The file was read successfully but its contents are not a valid legacy module config; the migration aborts rather than guessing.","triggerScenarios":"Thrown at core/schema/workspace_migrate.go:403 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix or remove the malformed legacy dagger.json named in the error","Ensure the file is valid JSON with the expected module fields"],"exampleFix":null,"handlingStrategy":"try-catch","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"}