ipfs/kubo · error
no bootstrap peers to add
Error message
no bootstrap peers to add
What it means
'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.
Source
Thrown at core/commands/bootstrap.go:67
The special values 'default' and 'auto' can be used to add the default
bootstrap peers. Both are equivalent and will add the 'auto' placeholder to
the bootstrap list, which gets resolved using the AutoConf system.
` + bootstrapSecurityWarning,
},
Arguments: []cmds.Argument{
cmds.StringArg("peer", false, true, peerOptionDesc).EnableStdin(),
},
Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error {
if err := req.ParseBodyArgs(); err != nil {
return err
}
inputPeers := req.Arguments
if len(inputPeers) == 0 {
return errors.New("no bootstrap peers to add")
}
// Convert "default" to "auto" for backward compatibility
for i, peer := range inputPeers {
if peer == "default" {
inputPeers[i] = "auto"
}
}
cfgRoot, err := cmdenv.GetConfigRoot(env)
if err != nil {
return err
}
r, err := fsrepo.Open(cfgRoot)
if err != nil {
return err
}View on GitHub (pinned to 329838acdf)
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
Example fix
// before (empty arg list from script) ipfs bootstrap add $PEERS # PEERS empty // after [ -n "$PEERS" ] && ipfs bootstrap add $PEERS || ipfs bootstrap add --default
Defensive patterns
Strategy: validation
Validate before calling
if len(peers) == 0 {
return errors.New("refusing to call bootstrap add with empty peer list; use --default or --auto")
} Type guard
null
Try / catch
null
Prevention
- 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
When it happens
Trigger: Calling `ipfs bootstrap add` with zero arguments and without a flag that supplies peers implicitly.
Common situations: 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.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- cannot add default bootstrap peers: AutoConf is disabled (Au
- invalid bootstrap address: %s
- bootstrap address without a transport: %s
- cannot remove individual bootstrap peers when using 'auto' p
- cannot specify negative offset
AI-assisted analysis of ipfs/kubo@329838acdf (2026-09-03).
Data as JSON: /api/errors/64efb8856d76a18e.
Report an issue: GitHub.