{"record":{"id":"85b815772b7c9b27","repo":"dagger/dagger","slug":"module-q-w","errorCode":null,"errorMessage":"module %q: %w","messagePattern":"module %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/schema/workspace_overlay_modules.go","lineNumber":120,"sourceCode":"\tfor _, name := range names {\n\t\tif wanted != nil {\n\t\t\tif _, ok := wanted[canonicalOverlayModuleName(name)]; !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tentry := cfg.Modules[name]\n\t\t// A built-in SDK install entry carries [as-sdk] authoring metadata, not\n\t\t// a loadable module ref (see workspaceConfigPendingModules).\n\t\tif entry.AsSDK != nil && coresdk.IsBuiltinSDKName(entry.Source) {\n\t\t\tcontinue\n\t\t}\n\t\tif entry.LegacyDefaultPath {\n\t\t\tcontinue\n\t\t}\n\n\t\tsrc, relevant, err := s.workspaceOverlayModuleSource(ctx, srv, parent, entry, configDir, configTouched)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"module %q: %w\", name, err)\n\t\t}\n\t\tif !relevant {\n\t\t\tcontinue\n\t\t}\n\n\t\tasModuleArgs, err := BuildLegacyAsModuleArgs(\n\t\t\tname,\n\t\t\tfalse, // legacy +defaultPath entries are skipped above\n\t\t\t\"\", \"\",\n\t\t\tentry.Settings,\n\t\t\tcfg.DefaultsFromDotEnv,\n\t\t\tnil,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"module %q: %w\", name, err)\n\t\t}\n\n\t\tvar mod dagql.ObjectResult[*core.Module]","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/core/schema/workspace_overlay_modules.go#L102-L138","documentation":"This error wraps any failure that occurs while resolving the module source of an overlay module entry in the workspace config (dagger.json [modules] table). The resolver workspaceOverlayModuleSource may fail because the source path or remote ref cannot be resolved against the overlay rootfs or config. Dagger re-throws it prefixed with `module \"<name>\":` so you know which config entry is broken.","triggerScenarios":"Calling workspaceTargetModules when a workspace config entry's source cannot be resolved: a local path in dagger.json [modules] does not exist, a remote ref (git) cannot be fetched, or the config entry's settings/resolve fails during ApplyEnvOverlay-driven loading.","commonSituations":"Typoed or deleted module directory referenced in dagger.json; renamed module dir without updating config; remote module ref pointing at a private repo without credentials; stale config after pulling a branch where the module moved.","solutions":["Check the `source` value of the failing module in dagger.json and fix the path or ref","Run `dagger develop` / re-install the module (`dagger install <name>`) to refresh the config entry","If the module was intentionally removed, delete its entry from the [modules] table","For remote refs, verify credentials and network access to the source repository"],"exampleFix":"// before (dagger.json)\n\"modules\": { \"mylib\": { \"source\": \"../libs/mylib\" } }\n// after\n\"modules\": { \"mylib\": { \"source\": \"./libs/mylib\" } }","handlingStrategy":"validation","validationCode":"// Go: before loading, verify each [modules] entry source exists / is fetchable\nfor name, entry := range cfg.Modules {\n    if workspace.IsLocalRef(entry.Source, \"\") {\n        if _, err := os.Stat(filepath.Join(configDir, entry.Source)); err != nil {\n            return fmt.Errorf(\"module %q source %q missing: %w\", name, entry.Source, err)\n        }\n    }\n}","typeGuard":null,"tryCatchPattern":"// Go\ndeps, err := ws.Modules(ctx)\nif err != nil {\n    var modErr *fmt.WrapError // or strings.Contains check\n    if strings.Contains(err.Error(), \"module \") {\n        log.Fatalf(\"bad workspace module entry: %v — fix dagger.json [modules]\", err)\n    }\n    return err\n}","preventionTips":["Keep [modules].source entries relative to the workspace config dir","Re-run `dagger install` after moving or renaming module directories","Never hand-edit module entries; let the CLI manage dagger.json","Verify remote refs are reachable with credentials before CI runs"],"tags":["workspace","module-resolution","config"],"backgroundTag":"module-source-not-resolvable","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"}