{"record":{"id":"92018862bc4fc3af","repo":"ipfs/kubo","slug":"no-embedded-dependency-information","errorCode":null,"errorMessage":"no embedded dependency information","messagePattern":"no embedded dependency information","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/version.go","lineNumber":110,"sourceCode":"\tVersion    string\n\tReplacedBy string\n\tSum        string\n}\n\nconst pkgVersionFmt = \"%s@%s\"\n\nvar depsVersionCommand = &cmds.Command{\n\tHelptext: cmds.HelpText{\n\t\tTagline: \"Shows information about dependencies used for build.\",\n\t\tShortDescription: `\nPrint out all dependencies and their versions.`,\n\t},\n\tType: Dependency{},\n\n\tRun: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error {\n\t\tinfo, ok := debug.ReadBuildInfo()\n\t\tif !ok {\n\t\t\treturn errors.New(\"no embedded dependency information\")\n\t\t}\n\t\ttoDependency := func(mod *debug.Module) (dep Dependency) {\n\t\t\tdep.Path = mod.Path\n\t\t\tdep.Version = mod.Version\n\t\t\tdep.Sum = mod.Sum\n\t\t\tif repl := mod.Replace; repl != nil {\n\t\t\t\tdep.ReplacedBy = fmt.Sprintf(pkgVersionFmt, repl.Path, repl.Version)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tif err := res.Emit(toDependency(&info.Main)); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor _, dep := range info.Deps {\n\t\t\tif err := res.Emit(toDependency(dep)); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/version.go#L92-L128","documentation":"The 'ipfs version deps' command reads Go module dependency info embedded in the binary via debug.ReadBuildInfo(). If the runtime cannot provide build info, this error is returned. Build info is only embedded when the binary was built with the Go toolchain (go build); it is absent for binaries built by other means or manipulated afterwards.","triggerScenarios":"Running 'ipfs version deps' on a binary that was not built with the standard Go toolchain — e.g. built with -trimpath oddities is fine, but stripped/patched binaries, binaries produced by alternative toolchains, or test harnesses that don't embed build info will return ok=false.","commonSituations":"Distributing a binary built with a non-Go builder or heavily stripped packaging pipeline; running the command in a sandbox that replaced the ipfs binary; using a binary compiled from a modified build script that bypasses the go command.","solutions":["Rebuild the binary from source with the standard toolchain: make build (which uses go build)","Verify the binary is an official release artifact and not a repackaged/stripped one","If you need dependency info without build info, run 'go version -m ./ipfs' against the binary or check the source go.mod"],"exampleFix":"// before\ninfo, ok := debug.ReadBuildInfo()\nif !ok {\n    return errors.New(\"no embedded dependency information\")\n}\n// after (caller-side mitigation)\nout, err := exec.Command(\"go\", \"version\", \"-m\", ipfsBinaryPath).Output()","handlingStrategy":"fallback","validationCode":"if info, ok := debug.ReadBuildInfo(); !ok || len(info.Deps) == 0 {\n    // fall back to 'go version -m <binary>' or packaged metadata\n}","typeGuard":null,"tryCatchPattern":"deps, err := runVersionDeps()\nif err != nil && strings.Contains(err.Error(), \"no embedded dependency information\") {\n    out, exeErr := exec.Command(\"go\", \"version\", \"-m\", ipfsBin).Output()\n    if exeErr == nil { fmt.Println(string(out)); return nil }\n}\nreturn err","preventionTips":["Build with the standard go toolchain (make build)","Don't repackage or strip binaries in ways that drop build info","Document in your packaging pipeline that 'ipfs version deps' needs go-embedded build info"],"tags":["build-info","version","cli"],"backgroundTag":"missing-build-info","analyzedSha":"329838acdfafae224582930457efe80aa217afc0","analyzedAt":"2026-09-03T18:30:52.135Z","contentChangedAt":"2026-09-03T18:30:52.135Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}