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

  1. Pass one or more multiaddr peer addresses: `ipfs bootstrap add /ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMG...`
  2. Use `ipfs bootstrap add --default` to restore the standard peer list
  3. Use `ipfs bootstrap add --auto` (or argument "auto") to let AutoConf manage bootstrap peers
  4. 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

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


AI-assisted analysis of ipfs/kubo@329838acdf (2026-09-03). Data as JSON: /api/errors/64efb8856d76a18e. Report an issue: GitHub.