ipfs/kubo · error

%s path cannot be empty

Error message

%s path cannot be empty

What it means

checkFusePath validates a configured mount path before FUSE mounting. If the path is an empty string, it returns "%s path cannot be empty" where %s is the config name (Mounts.IPFS, Mounts.IPNS, or Mounts.MFS). This catches mount points left unset in the configuration, since FUSE cannot mount at an empty path.

Source

Thrown at cmd/ipfs/kubo/daemon.go:1285

	if err != nil {
		return fmt.Errorf("mountFuse: ConstructNode() failed: %s", err)
	}

	err = nodeMount.Mount(node, fsdir, nsdir, mfsdir)
	if err != nil {
		return err
	}
	// Extra space after "MFS" so "mounted at:" lines up with IPFS and
	// IPNS in the column above. Matches MountCmd's output formatter.
	fmt.Printf("IPFS mounted at: %s\n", fsdir)
	fmt.Printf("IPNS mounted at: %s\n", nsdir)
	fmt.Printf("MFS  mounted at: %s\n", mfsdir)
	return nil
}

func checkFusePath(name, path string) error {
	if path == "" {
		return fmt.Errorf("%s path cannot be empty", name)
	}

	fileInfo, err := os.Stat(path)
	if err != nil {
		if os.IsNotExist(err) {
			return fmt.Errorf("%s path (%q) does not exist: %w", name, path, err)
		}
		return fmt.Errorf("error while inspecting %s path (%q): %w", name, path, err)
	}

	if !fileInfo.IsDir() {
		return fmt.Errorf("%s path (%q) is not a directory", name, path)
	}

	return nil
}

func maybeRunGC(req *cmds.Request, node *core.IpfsNode) (<-chan error, error) {

View on GitHub (pinned to 329838acdf)

Solutions

  1. Set the mount points in config: `ipfs config Mounts.IPFS /ipfs`, `ipfs config Mounts.IPNS /ipns`, `ipfs config Mounts.MFS /mfs`
  2. Or pass the paths on the command line: `ipfs daemon --mount --mount-ipfs=/ipfs --mount-ipns=/ipns`
  3. Inspect current values with `ipfs config Mounts.IPFS` (and IPNS/MFS) to find which one is empty

Example fix

// before (config)
"Mounts": {"IPFS": "", "IPNS": "/ipns", "MFS": "/mfs"}
// after
"Mounts": {"IPFS": "/ipfs", "IPNS": "/ipns", "MFS": "/mfs"}
Defensive patterns

Strategy: validation

Validate before calling

for name, p := range map[string]string{"Mounts.IPFS": cfg.Mounts.IPFS, "Mounts.IPNS": cfg.Mounts.IPNS, "Mounts.MFS": cfg.Mounts.MFS} {
	if p == "" {
		return fmt.Errorf("%s must be set before --mount", name)
	}
}

Prevention

When it happens

Trigger: Running `ipfs daemon --mount` (or `ipfs mount`) with cfg.Mounts.IPFS, cfg.Mounts.IPNS, or cfg.Mounts.MFS empty in the repo config and no corresponding CLI flag (--mount-ipfs / --mount-ipns / --mount-mfs) supplied.

Common situations: Fresh repo where Mounts.* were never set; a config migration or manual edit cleared the values; scripted daemon startup passing empty strings for the mount keywords.

Related errors


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