{"record":{"id":"8afbbfd8cf080ff9","repo":"dagger/dagger","slug":"resolving-toolchain-module-w","errorCode":null,"errorMessage":"resolving toolchain module: %w","messagePattern":"resolving toolchain module: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/server/session_workspaces.go","lineNumber":1755,"sourceCode":"\t}\n\tsrc := primary.Self().Source.Value\n\tdefaultPathContextSrc := src\n\tif primary.Self().ContextSource.Valid && primary.Self().ContextSource.Value.Self() != nil {\n\t\tdefaultPathContextSrc = primary.Self().ContextSource.Value\n\t}\n\n\tfor i, toolchainSrc := range src.Self().Toolchains {\n\t\tif toolchainSrc.Self() == nil {\n\t\t\tcontinue\n\t\t}\n\t\tvar cfg *modules.ModuleConfigDependency\n\t\tif i < len(src.Self().ConfigToolchains) {\n\t\t\tcfg = src.Self().ConfigToolchains[i]\n\t\t}\n\t\tpending := pendingRelatedModule(defaultPathContextSrc, toolchainSrc.Self(), cfg, false)\n\t\ttoolchainMod, err := srv.resolveModuleSourceAsModule(ctx, dag, toolchainSrc, pending)\n\t\tif err != nil {\n\t\t\treturn resolvedModuleLoad{}, fmt.Errorf(\"resolving toolchain module: %w\", err)\n\t\t}\n\t\tresolved.related = append(resolved.related, resolvedServedModule{\n\t\t\tmod:        toolchainMod,\n\t\t\tentrypoint: false,\n\t\t})\n\t}\n\n\tif src.Self().Blueprint.Self() != nil {\n\t\tpending := pendingRelatedModule(defaultPathContextSrc, src.Self().Blueprint.Self(), src.Self().ConfigBlueprint, true)\n\t\tblueprintMod, err := srv.resolveModuleSourceAsModule(ctx, dag, src.Self().Blueprint, pending)\n\t\tif err != nil {\n\t\t\treturn resolvedModuleLoad{}, fmt.Errorf(\"resolving blueprint module: %w\", err)\n\t\t}\n\t\tresolved.related = append(resolved.related, resolvedServedModule{\n\t\t\tmod:        blueprintMod,\n\t\t\tentrypoint: true,\n\t\t})\n\t\tresolved.primaryEntrypoint = false","sourceCodeStart":1737,"sourceCodeEnd":1773,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/engine/server/session_workspaces.go#L1737-L1773","documentation":"When resolving a module load whose source declares config toolchains (src.Self().ConfigToolchains), each toolchain module is resolved via resolveModuleSourceAsModule; failure is wrapped as 'resolving toolchain module'. It means one of the toolchain dependencies declared in the module configuration could not be built/loaded into a served Module.","triggerScenarios":"A module's config declares ConfigToolchains entries whose source is broken: invalid module path in config, missing or errored toolchain module code (bad dagger.json, SDK init failure, compile error), or its git/local source unresolvable.","commonSituations":"Committed config pointing at a toolchain module directory that was moved/renamed; toolchain module's SDK not installed; syntax errors in the toolchain module source; pinning a git toolchain ref that no longer exists.","solutions":["Read the inner (%w) error to find which toolchain module failed and why.","Fix the toolchain module source: valid dagger.json, compilable code, correct path in config.","Verify the toolchain's SDK matches what the engine supports and is installed.","If toolchain comes from git, confirm the ref still exists and is reachable."],"exampleFix":"// before (config)\n[[toolchains]]\npath = \"./tools/old-toolchain\" // moved away\n// after\n[[toolchains]]\npath = \"./tools/toolchain\" // dir exists with valid dagger.json","handlingStrategy":"validation","validationCode":"// preflight: toolchain dirs exist and are valid modules\nfor _, tc := range cfgToolchains { if _, err := os.Stat(filepath.Join(root, tc.Path, \"dagger.json\")); err != nil { return fmt.Errorf(\"toolchain %q missing dagger.json\", tc.Path) } }","typeGuard":null,"tryCatchPattern":"if err != nil { var mle resolvedModuleLoad; if errors.As(err, &mle) == false { /* inspect wrapped cause via %w chain */ } }","preventionTips":["Keep ConfigToolchains paths pointing at existing, valid module directories.","CI-check that configured toolchains build (dagger develop) on config changes.","Pin toolchain git refs to tags that exist."],"tags":["modules","toolchain","configuration"],"backgroundTag":"module-resolution-failed","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"}