ipfs/kubo · error

cannot add default bootstrap peers: AutoConf is disabled (Au

Error message

cannot add default bootstrap peers: AutoConf is disabled (AutoConf.Enabled=false). Enable AutoConf by setting AutoConf.Enabled=true in your config, or add specific peer addresses instead

What it means

`ipfs bootstrap add` rejects the "auto" placeholder (or "default" which maps to it) when AutoConf is disabled in the node config. The command checks `peer == config.AutoPlaceholder && !cfg.AutoConf.Enabled.WithDefault(config.DefaultAutoConfEnabled)` and returns this explanatory error instead of writing an unusable auto-bootstrap entry.

Source

Thrown at core/commands/bootstrap.go:95

		cfgRoot, err := cmdenv.GetConfigRoot(env)
		if err != nil {
			return err
		}

		r, err := fsrepo.Open(cfgRoot)
		if err != nil {
			return err
		}
		defer r.Close()
		cfg, err := r.Config()
		if err != nil {
			return err
		}

		// Check if trying to add "auto" when AutoConf is disabled
		for _, peer := range inputPeers {
			if peer == config.AutoPlaceholder && !cfg.AutoConf.Enabled.WithDefault(config.DefaultAutoConfEnabled) {
				return errors.New("cannot add default bootstrap peers: AutoConf is disabled (AutoConf.Enabled=false). Enable AutoConf by setting AutoConf.Enabled=true in your config, or add specific peer addresses instead")
			}
		}

		added, err := bootstrapAdd(r, cfg, inputPeers)
		if err != nil {
			return err
		}

		return cmds.EmitOnce(res, &BootstrapOutput{added})
	},
	Type: BootstrapOutput{},
	Encoders: cmds.EncoderMap{
		cmds.Text: cmds.MakeTypedEncoder(func(req *cmds.Request, w io.Writer, out *BootstrapOutput) error {
			return bootstrapWritePeers(w, "added ", out.Peers)
		}),
	},
}

View on GitHub (pinned to 329838acdf)

Solutions

  1. Enable AutoConf: `ipfs config --json AutoConf.Enabled true`, then retry the add
  2. Instead add concrete peer addresses: `ipfs bootstrap add /dnsaddr/bootstrap.libp2p.io/p2p/Qm...`
  3. Check current state with `ipfs config AutoConf.Enabled` before using the auto placeholder

Example fix

// before
ipfs bootstrap add default   # fails when AutoConf disabled
// after
ipfs config --json AutoConf.Enabled true
ipfs bootstrap add default
Defensive patterns

Strategy: validation

Validate before calling

enabled, _ := exec.Command("ipfs", "config", "AutoConf.Enabled").Output()
if strings.TrimSpace(string(enabled)) == "false" {
    // do not use the "auto"/"default" placeholder; add explicit addresses instead
}

Type guard

null

Try / catch

if err != nil && strings.Contains(err.Error(), "AutoConf is disabled") {
    // fallback: enable AutoConf or add explicit peer addresses
}

Prevention

When it happens

Trigger: `ipfs bootstrap add auto`, `ipfs bootstrap add default` (converted to "auto"), or `ipfs bootstrap add --auto` while the config has AutoConf.Enabled=false.

Common situations: Users who disabled AutoConf (AutoConf.Enabled=false) but run generic setup scripts or docs that say `ipfs bootstrap add --default`; environments switched to static peer lists.

Related errors


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