multica-ai/multica · error

invalid task-local Multica profile name

Error message

invalid task-local Multica profile name %q

What it means

Raised by validateTaskLocalProfile as a traversal/canonicality guard on profile names used under TaskConfigRootEnv: the name is '.', '..', absolute, contains path separators, or is non-canonical after filepath.Clean — any of which could escape the task-local profile directory. The input at fault is the profile name string.

Solutions

  1. Use a valid task-local profile name (letters, digits, and safe separators).
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at server/internal/cli/config.go:281 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15). Data as JSON: /api/errors/2c27bc40f0997104. Report an issue: GitHub.

Appendix: source

Thrown at server/internal/cli/config.go:281

		root := filepath.Clean(rawRoot)
		if !filepath.IsAbs(root) {
			return "", false, fmt.Errorf("%s must be an absolute path", TaskConfigRootEnv)
		}
		return root, true, nil
	}
	home, err := os.UserHomeDir()
	if err != nil {
		return "", false, err
	}
	return home, false, nil
}

func validateTaskLocalProfile(profile string) error {
	if profile == "" {
		return nil
	}
	if profile == "." || profile == ".." || filepath.IsAbs(profile) || strings.ContainsAny(profile, `/\\`) || filepath.Clean(profile) != profile {
		return fmt.Errorf("invalid task-local Multica profile name %q", profile)
	}
	return nil
}

// LoadCLIConfig reads the CLI config from disk (default profile).
func LoadCLIConfig() (CLIConfig, error) {
	return LoadCLIConfigForProfile("")
}

// LoadCLIConfigForProfile reads the CLI config for the given profile.
func LoadCLIConfigForProfile(profile string) (CLIConfig, error) {
	path, err := CLIConfigPathForProfile(profile)
	if err != nil {
		return CLIConfig{}, err
	}
	data, err := os.ReadFile(path)
	if err != nil {
		if errors.Is(err, os.ErrNotExist) {

View on GitHub (pinned to 2c0912b6ec)