ipfs/kubo · error

invalid configuration profile: %s

Error message

invalid configuration profile: %s

What it means

Thrown by applyProfiles during `ipfs init --profile <name>` when a profile name given by the user is not a registered key in config.Profiles. Kubo validates each comma-separated profile name before applying its transformer; an unknown name aborts initialization before any repo is created. Profiles are fixed sets of config transforms (server, datastore, flatfs, local-discovery, randomports, etc.) defined in the config package.

Source

Thrown at cmd/ipfs/kubo/init.go:138

			if err != nil {
				return err
			}
		}

		profiles, _ := req.Options[profileOptionName].(string)
		return doInit(os.Stdout, cctx.ConfigRoot, empty, profiles, conf)
	},
}

func applyProfiles(conf *config.Config, profiles string) error {
	if profiles == "" {
		return nil
	}

	for profile := range strings.SplitSeq(profiles, ",") {
		transformer, ok := config.Profiles[profile]
		if !ok {
			return fmt.Errorf("invalid configuration profile: %s", profile)
		}

		if err := transformer.Transform(conf); err != nil {
			return err
		}
	}
	return nil
}

func doInit(out io.Writer, repoRoot string, empty bool, confProfiles string, conf *config.Config) error {
	if _, err := fmt.Fprintf(out, "initializing IPFS node at %s\n", repoRoot); err != nil {
		return err
	}

	if err := checkWritable(repoRoot); err != nil {
		return err
	}

View on GitHub (pinned to 329838acdf)

Solutions

  1. Run `ipfs init --help` and use one of the listed profile names exactly (e.g. server, datastore, flatfs, local-discovery, randomports, badgerds, lowpower, test-profile).
  2. Check for stray commas or whitespace in the --profile value and fix the list (e.g. 'server,randomports').
  3. If you need config not covered by a profile, initialize without --profile and edit the repo config afterwards with `ipfs config`.

Example fix

// before
ipfs init --profile servers
// after
ipfs init --profile server
Defensive patterns

Strategy: validation

Validate before calling

// validate profile names before running init
profiles := "server,randomports"
for p := range strings.SplitSeq(profiles, ",") {
	if _, ok := config.Profiles[p]; !ok {
		return fmt.Errorf("unknown profile %q; see `ipfs init --help`", p)
	}
}
ipfsInit.Init(ipfsPath, config.Profiles(profiles))

Prevention

When it happens

Trigger: Running `ipfs init --profile <name>` (or Init initializer with Profiles option) where <name> is misspelled, does not exist, or a comma-separated list contains any single invalid entry. Note the split uses strings.SplitSeq on ',', so an empty segment (trailing comma like 'server,') also fails.

Common situations: Typos such as `--profile servers` instead of `server`; copying profile names from older docs that have since been renamed or removed; scripting with interpolated empty profile variables producing a trailing comma.

Related errors


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