dagger/dagger · error
parsing legacy module config %s: %w
Error message
parsing legacy module config %s: %w
What it means
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.
Source
Thrown at core/schema/workspace_migrate.go:403
configPath := filepath.Join(ws.HostPath(), filepath.FromSlash(cp.Path))
configDir := filepath.Dir(configPath)
hasWorkspaceConfig, err := workspaceMigrationHasExplicitConfigAncestor(workspaceCtx, statFS, ws.HostPath(), configDir)
if err != nil {
return nil, nil, err
}
if hasWorkspaceConfig {
// FIXME(workspace-migrate): Match the top-level explicit-config rule
// for now: pre-existing workspace configs own migration below them.
continue
}
data, err := bk.ReadCallerHostFile(workspaceCtx, configPath)
if err != nil {
return nil, nil, fmt.Errorf("reading legacy module config %s: %w", cp.Path, err)
}
compatWorkspace, err := workspaceMigrationCompatWorkspaceForLegacyConfig(data, configPath)
if err != nil {
return nil, nil, fmt.Errorf("parsing legacy module config %s: %w", cp.Path, err)
}
if compatWorkspace == nil {
continue
}
compatWorkspace.DiscoveredLocalModule = cp.DiscoveredLocalModule
compatWorkspaces = append(compatWorkspaces, compatWorkspace)
}
return compatWorkspaces, discoveryWarnings, nil
}
// workspaceMigrationConfigPath is a legacy config selected for migration,
// tagged with whether it was reached by following a local module reference
// from the selected root config (rather than being the selection itself).
type workspaceMigrationConfigPath struct {
Path string
DiscoveredLocalModule bool
}
View on GitHub (pinned to 82ba2681db)
Solutions
- Fix or remove the malformed legacy dagger.json named in the error
- Ensure the file is valid JSON with the expected module fields
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at core/schema/workspace_migrate.go:403 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of dagger/dagger@82ba2681db (2026-09-05).
Data as JSON: /api/errors/f9593b2bed59701d.
Report an issue: GitHub.