ipfs/kubo · error

no local swarm address for migration node

Error message

no local swarm address for migration node

What it means

addMigrationPaths needs at least one swarm address for the temporary migration node so it can connect to it from the main node. An empty peer.AddrInfo.Addrs means the migration node reported no listen addresses, making the swarm connect impossible.

Source

Thrown at cmd/ipfs/kubo/add_migrations.go:108

		ipfsPath, err := ufs.Add(ctx, files.NewReaderStatFile(f, fi), options.Unixfs.Pin(pin, ""))
		f.Close()
		if err != nil {
			return err
		}
		fmt.Printf("Added migration file %q: %s\n", filepath.Base(filePath), ipfsPath)
	}

	return nil
}

// addMigrationPaths adds the files at paths to IPFS, optionally pinning
// them. This is done after connecting to the peer.
func addMigrationPaths(ctx context.Context, node *core.IpfsNode, peerInfo peer.AddrInfo, paths []path.Path, pin bool) error {
	if len(paths) == 0 {
		return errors.New("nothing downloaded by ipfs fetcher")
	}
	if len(peerInfo.Addrs) == 0 {
		return errors.New("no local swarm address for migration node")
	}

	ipfs, err := coreapi.NewCoreAPI(node)
	if err != nil {
		return err
	}

	// Connect to temp node
	if err := ipfs.Swarm().Connect(ctx, peerInfo); err != nil {
		return fmt.Errorf("could not connect to migration peer %q: %s", peerInfo.ID, err)
	}
	fmt.Printf("connected to migration peer %q\n", peerInfo)

	if pin {
		pinAPI := ipfs.Pin()
		for _, ipfsPath := range paths {
			err := pinAPI.Add(ctx, ipfsPath)
			if err != nil {

View on GitHub (pinned to 329838acdf)

Solutions

  1. Ensure the temp migration node can bind a swarm address (check its config Addresses.Swarm and logs)
  2. Check for port conflicts or sandboxing (containers, seccomp) that block local listening
  3. Re-run `ipfs daemon --migrate`; inspect the temp node's `ipfs id` output for empty Addrs
  4. Fall back to external migrations: run fs-repo-migrations directly instead of the embedded fetch path
Defensive patterns

Strategy: validation

Validate before calling

id, _ := exec.Command("ipfs", "--config", tmpPath, "id").Output()
if !strings.Contains(string(id), "\"Addrs\": [") {
    return errors.New("temp migration node has no swarm addresses")
}

Prevention

When it happens

Trigger: The temporary migration ipfs node initialized/started but exposed no addresses (failed to bind, misconfigured Addresses.Swarm, or the AddrInfo was populated from `ipfs id` output that lacked Addrs).

Common situations: Port conflicts or restricted environments (containers without loopback networking) preventing the temp node from listening; broken API/swarm address config in the temp IPFS_PATH; firewall blocking local sockets.

Related errors


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