{"record":{"id":"64efb8856d76a18e","repo":"ipfs/kubo","slug":"no-bootstrap-peers-to-add","errorCode":null,"errorMessage":"no bootstrap peers to add","messagePattern":"no bootstrap peers to add","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/bootstrap.go","lineNumber":67,"sourceCode":"\nThe special values 'default' and 'auto' can be used to add the default\nbootstrap peers. Both are equivalent and will add the 'auto' placeholder to\nthe bootstrap list, which gets resolved using the AutoConf system.\n` + bootstrapSecurityWarning,\n\t},\n\n\tArguments: []cmds.Argument{\n\t\tcmds.StringArg(\"peer\", false, true, peerOptionDesc).EnableStdin(),\n\t},\n\n\tRun: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error {\n\t\tif err := req.ParseBodyArgs(); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tinputPeers := req.Arguments\n\n\t\tif len(inputPeers) == 0 {\n\t\t\treturn errors.New(\"no bootstrap peers to add\")\n\t\t}\n\n\t\t// Convert \"default\" to \"auto\" for backward compatibility\n\t\tfor i, peer := range inputPeers {\n\t\t\tif peer == \"default\" {\n\t\t\t\tinputPeers[i] = \"auto\"\n\t\t\t}\n\t\t}\n\n\t\tcfgRoot, err := cmdenv.GetConfigRoot(env)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tr, err := fsrepo.Open(cfgRoot)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/bootstrap.go#L49-L85","documentation":"'ipfs bootstrap add' was invoked with no peer arguments and no 'default'/'auto' keyword. The command has nothing to do, so it refuses rather than silently succeeding; at least one peer address (or 'default') must be given.","triggerScenarios":"Calling `ipfs bootstrap add` with zero arguments and without a flag that supplies peers implicitly.","commonSituations":"Scripted config automation that builds the argument list dynamically and ends up empty; typos dropping the argument; old scripts using `bootstrap add default` where arg parsing stripped the argument.","solutions":["Pass one or more multiaddr peer addresses: `ipfs bootstrap add /ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMG...`","Use `ipfs bootstrap add --default` to restore the standard peer list","Use `ipfs bootstrap add --auto` (or argument \"auto\") to let AutoConf manage bootstrap peers","Fix the calling script to check the peer list is non-empty before invoking"],"exampleFix":"// before (empty arg list from script)\nipfs bootstrap add $PEERS   # PEERS empty\n// after\n[ -n \"$PEERS\" ] && ipfs bootstrap add $PEERS || ipfs bootstrap add --default","handlingStrategy":"validation","validationCode":"if len(peers) == 0 {\n    return errors.New(\"refusing to call bootstrap add with empty peer list; use --default or --auto\")\n}","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Guard scripts against empty argument lists before exec","Use explicit --default or --auto flags instead of relying on positional args","Log the fully-expanded command line in automation","Quote and validate multiaddrs before adding"],"tags":["cli","bootstrap","argument-validation"],"backgroundTag":"missing-required-argument","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"}