{"record":{"id":"37c562e63c887a96","repo":"dagger/dagger","slug":"unknown-module-source-kind-s","errorCode":null,"errorMessage":"unknown module source kind: %s","messagePattern":"unknown module source kind: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/schema/modulesource.go","lineNumber":1786,"sourceCode":"\t\t\t}\n\t\t\tnewUpdatedArgs = append(newUpdatedArgs, dagql.NewID[*core.ModuleSource](updatedItemID))\n\t\t\tcontinue\n\t\t}\n\n\t\tif existingItem.Self().Kind == core.ModuleSourceKindLocal {\n\t\t\tfor updateReq := range updateReqs {\n\t\t\t\tif updateReq.symbolic == existingItem.Self().ModuleName {\n\t\t\t\t\treturn nil, fmt.Errorf(\"updating local %s is not supported\", accessor.typ.Plural())\n\t\t\t\t}\n\n\t\t\t\tvar contextRoot string\n\t\t\t\tswitch parentSrc.Self().Kind {\n\t\t\t\tcase core.ModuleSourceKindLocal:\n\t\t\t\t\tcontextRoot = parentSrc.Self().Local.ContextDirectoryPath\n\t\t\t\tcase core.ModuleSourceKindGit:\n\t\t\t\t\tcontextRoot = \"/\"\n\t\t\t\tdefault:\n\t\t\t\t\treturn nil, fmt.Errorf(\"unknown module source kind: %s\", parentSrc.Self().Kind)\n\t\t\t\t}\n\n\t\t\t\tparentSrcRoot := filepath.Join(contextRoot, parentSrc.Self().SourceRootSubpath)\n\t\t\t\titemSrcRoot := filepath.Join(contextRoot, existingItem.Self().SourceRootSubpath)\n\t\t\t\texistingSymbolic, err := pathutil.LexicalRelativePath(parentSrcRoot, itemSrcRoot)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"failed to get relative path: %w\", err)\n\t\t\t\t}\n\n\t\t\t\tif updateReq.symbolic == existingSymbolic {\n\t\t\t\t\treturn nil, fmt.Errorf(\"updating local %s is not supported\", accessor.typ.Plural())\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\texistingName := existingItem.Self().ModuleName\n\t\texistingSymbolic := existingItem.Self().Git.CloneRef","sourceCodeStart":1768,"sourceCodeEnd":1804,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/core/schema/modulesource.go#L1768-L1804","documentation":"While checking whether an update request matches a local-kind item, the code needs the parent's context root and switches on parentSrc.Self().Kind. Only local and git parents are handled; any other parent kind (e.g. dir) hits the default branch and throws 'unknown module source kind'.","triggerScenarios":"Calling updateDependencies/updateToolchains on a module whose parent source Kind is dir (or any non-local/non-git kind) while a local-kind related module exists and at least one update request is being matched.","commonSituations":"Updating dependencies of a module loaded from a Directory-style (dir-kind) source rather than a local context or git ref; newer source kinds not yet supported by the update path; programmatic construction of sources with unexpected Kind.","solutions":["Update dependencies using a local (in-workspace) or git-resolved module source instead of a dir-kind source.","Load the module via the normal workspace/develop flow so the parent source kind is local or git.","Update dagger if dir-kind parents should be supported — this may be a missing-case gap.","As a workaround, edit the dependency version directly in dagger.json instead of calling updateDependencies."],"exampleFix":"// before: updating deps of a dir-kind source\nctxDir.ModuleSource().UpdateDependencies(ctx, [\"dep\"])\n// after: use the workspace-local source\nlocalSrc.UpdateDependencies(ctx, [\"dep\"])","handlingStrategy":"validation","validationCode":"// Go: only update deps on local or git parent sources\nswitch parent.Self().Kind {\ncase core.ModuleSourceKindLocal, core.ModuleSourceKindGit:\n    // ok\ndefault:\n    return fmt.Errorf(\"cannot update dependencies of %s-kind source %q; use local or git source\", parent.Self().Kind, parent.Self().ModuleName)\n}","typeGuard":"func canUpdateDeps(src *core.ModuleSource) bool {\n    return src.Kind == core.ModuleSourceKindLocal || src.Kind == core.ModuleSourceKindGit\n}","tryCatchPattern":null,"preventionTips":["Run updateDependencies from a workspace-local or git-resolved module source","Edit dagger.json directly for dir-kind sources instead of calling update APIs","Beware dir-kind sources when scripting bulk dependency updates","Upgrade dagger if dir-kind parent support is needed in the update path"],"tags":["dagger","module-source","unsupported-kind","module-update"],"backgroundTag":"unsupported-module-source-kind","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"}