ipfs/kubo · error

libp2p stream mounting not enabled

Error message

libp2p stream mounting not enabled

What it means

The `ipfs p2p` stream-mounting commands (`p2p listen`/`p2p dial` with filesystem mount) are gated behind the experimental config flag `Experimental.Libp2pStreamMounting`. `p2pGetNode`, the shared node accessor for these commands, returns this error when the flag is not enabled in the node's repo config. This keeps an experimental, potentially unsafe feature off by default.

Source

Thrown at core/commands/p2p.go:702

		}

		return nil
	},
}

func p2pGetNode(env cmds.Environment) (*core.IpfsNode, error) {
	nd, err := cmdenv.GetNode(env)
	if err != nil {
		return nil, err
	}

	config, err := nd.Repo.Config()
	if err != nil {
		return nil, err
	}

	if !config.Experimental.Libp2pStreamMounting {
		return nil, errors.New("libp2p stream mounting not enabled")
	}

	if !nd.IsOnline {
		return nil, ErrNotOnline
	}

	return nd, nil
}

View on GitHub (pinned to 329838acdf)

Solutions

  1. Enable the flag and restart the daemon: `ipfs config --json Experimental.Libp2pStreamMounting true`, then `ipfs daemon`.
  2. Verify with `ipfs config Experimental.Libp2pStreamMounting` that it reports `true` on the node you are targeting (check IPFS_PATH).
  3. Ensure you are talking to the intended daemon — the config must be enabled on the node the API points at (`--api`).
  4. If mounting is not the goal, use plain `ipfs p2p stream dial/listen` (non-mount), which is not gated by this flag.

Example fix

// before
$ ipfs p2p stream listen /x/foo /mnt/foo
Error: libp2p stream mounting not enabled
// after
$ ipfs config --json Experimental.Libp2pStreamMounting true
$ ipfs daemon  # restart
$ ipfs p2p stream listen /x/foo /mnt/foo
Defensive patterns

Strategy: validation

Validate before calling

enabled, err := exec.Command("ipfs", "config", "Experimental.Libp2pStreamMounting").Output()
if err != nil || strings.TrimSpace(string(enabled)) != "true" {
    return errors.New("run: ipfs config --json Experimental.Libp2pStreamMounting true and restart daemon")
}

Try / catch

if _, err := runP2PMount(ctx); err != nil {
    if strings.Contains(err.Error(), "stream mounting not enabled") {
        // guide user to enable the experimental config flag
    }
    return err
}

Prevention

When it happens

Trigger: Running `ipfs p2p stream listen`/`dial` mount flows (e.g. mounting a remote filesystem over libp2p) when `Experimental.Libp2pStreamMounting` is false/absent in the daemon's config.

Common situations: Fresh node setups where the experimental flag was never enabled; running the command against a daemon whose config predates the feature; copy-pasted commands from tutorials without the config step.

Related errors


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