{"record":{"id":"275130ec0c82c7c2","repo":"dagger/dagger","slug":"failed-to-parse-dep-ref-string-w","errorCode":null,"errorMessage":"failed to parse dep ref string: %w","messagePattern":"failed to parse dep ref string: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/modulesource.go","lineNumber":2133,"sourceCode":") (inst dagql.ObjectResult[*ModuleSource], err error) {\n\t// sanity checks\n\tif parentSrc != nil {\n\t\tif parentSrc.SourceRootSubpath == \"\" {\n\t\t\treturn inst, fmt.Errorf(\"source root path must be set\")\n\t\t}\n\t\tif parentSrc.ModuleName == \"\" {\n\t\t\treturn inst, fmt.Errorf(\"module name must be set\")\n\t\t}\n\t}\n\n\tparsedDepRef, err := ParseRefString(\n\t\tctx,\n\t\tNewModuleSourceFS(bk, parentSrc),\n\t\tdepSrcRef,\n\t\tdepPin,\n\t)\n\tif err != nil {\n\t\treturn inst, fmt.Errorf(\"failed to parse dep ref string: %w\", err)\n\t}\n\n\tswitch parsedDepRef.Kind {\n\tcase ModuleSourceKindLocal:\n\t\tif parentSrc == nil {\n\t\t\t// it's okay if there's no parent when the dep is git, but we can't find a local dep relative to nothing\n\t\t\treturn inst, fmt.Errorf(\"local module dep source path %q must be relative to a parent module\", depSrcRef)\n\t\t}\n\n\t\tif filepath.IsAbs(depSrcRef) {\n\t\t\t// they need to be relative to the parent module's source root\n\t\t\treturn inst, fmt.Errorf(\"local module dep source path %q is absolute\", depSrcRef)\n\t\t}\n\t\tif parentSrc.Workspace.Self() != nil {\n\t\t\tdepPath := filepath.Join(parentSrc.SourceRootSubpath, depSrcRef)\n\t\t\tif !filepath.IsLocal(depPath) {\n\t\t\t\treturn inst, fmt.Errorf(\"local module dep source path %q escapes workspace\", depSrcRef)\n\t\t\t}","sourceCodeStart":2115,"sourceCodeEnd":2151,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/core/modulesource.go#L2115-L2151","documentation":"The dependency reference string (depSrcRef) could not be parsed into a module source ref by ParseRefString, which classifies refs as local paths, git URLs, or other supported forms. The wrapped inner error describes exactly why (e.g. malformed git ref, unsupported scheme, bad pin format).","triggerScenarios":"Resolving a dependency declared in dagger.json (dependencies/SDKs) or passed to ModuleSource APIs where the ref string is malformed: wrong git URL syntax, unparseable ref like 'https:/broken', invalid pin/version format, or a path that cannot be resolved against the parent's filesystem.","commonSituations":"Typo in a dependency entry in dagger.json; using a Windows-style or absolute path where a relative local path or git URL is expected; copying a ref with missing scheme slashes; a pin string that isn't a commit SHA or tag the parser accepts.","solutions":["Read the wrapped %w error to see the exact parse failure and correct the ref string in dagger.json or the API call.","Use a valid relative local path (e.g. \"../my-dep\") or a well-formed git URL (e.g. \"github.com/org/repo\") for the dependency.","If a pin is supplied, make sure it matches what the ref expects (commit SHA for git pins).","Re-run `dagger develop` / reload the module after editing dagger.json so the new refs are re-parsed."],"exampleFix":"// dagger.json before\n{\"dependencies\": [{\"name\": \"utils\", \"source\": \"httpsgithub.com/org/utils\"}]}\n// after\n{\"dependencies\": [{\"name\": \"utils\", \"source\": \"github.com/org/utils\"}]}","handlingStrategy":"validation","validationCode":"// validate the dep ref shape before resolving\nif !(strings.Contains(depRef, \"/\") && !filepath.IsAbs(depRef) || strings.Contains(depRef, \".\")) {\n    return fmt.Errorf(\"dep ref %q is neither a valid relative path nor git URL\", depRef)\n}","typeGuard":null,"tryCatchPattern":"inst, err := core.ResolveDepToSource(ctx, bk, dag, parentSrc, depRef, pin, depName)\nif err != nil && strings.Contains(err.Error(), \"failed to parse dep ref string\") {\n    log.Fatalf(\"check the dependency source in dagger.json: %v\", err)\n}","preventionTips":["Keep dependency \"source\" values as clean relative paths or host/org/repo git URLs.","Never hand-edit ref syntax; let `dagger` scaffold dependencies.","Validate dagger.json with a schema check in CI.","Beware copy-paste mangling of URLs (missing slashes, smart quotes)."],"tags":["dagger","modules","parsing"],"backgroundTag":"invalid-ref-string","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"}