Billionmail/BillionMail · error

configuration file does not exist: %s

Error message

configuration file does not exist: %s

What it means

LoadConfigFromFile refuses to load an ACME CLI configuration when the JSON file at the given path does not exist, returning this error instead of a parsed *AcmeCLI. It is a pre-check before reading/parsing so callers get a clear message rather than a read error.

Source

Thrown at core/internal/service/acme/cli.go:274

	// Insert into database
	certId, err := public.MR("ssl", "letsencrypts").InsertAndGetId(data)
	if err != nil {
		return 0, err
	}

	return int(certId), nil
}

/**
 * @brief Load configuration from JSON file
 * @param filepath Path to JSON configuration file
 * @return *AcmeCLI, error
 */
func LoadConfigFromFile(filepath string) (*AcmeCLI, error) {
	// Check if file exists
	if !public.FileExists(filepath) {
		return nil, fmt.Errorf("configuration file does not exist: %s", filepath)
	}

	// Read file
	content, err := public.ReadFile(filepath)
	if err != nil {
		return nil, err
	}

	// Parse JSON
	var config AcmeCLI
	err = json.Unmarshal([]byte(content), &config)
	if err != nil {
		return nil, err
	}

	return &config, nil
}

View on GitHub (pinned to fc36c76c05)

Solutions

  1. Check the file exists at the exact path (ls / public.FileExists) before loading
  2. Create the config first via SaveConfigToFile or write the JSON manually
  3. Use an absolute path instead of a relative one to avoid cwd ambiguity
  4. Verify volumes/mounts when running in Docker so the config path is present

Example fix

// before
cli, err := acme.LoadConfigFromFile("acme.json")
// after
cfgPath := "/etc/billionmail/acme.json"
if !public.FileExists(cfgPath) {
    return errors.New("run apply first to create config at " + cfgPath)
}
cli, err := acme.LoadConfigFromFile(cfgPath)
Defensive patterns

Strategy: validation

Validate before calling

if !public.FileExists(cfgPath) {
    return fmt.Errorf("ACME config missing at %s; run apply first", cfgPath)
}

Try / catch

cli, err := acme.LoadConfigFromFile(cfgPath)
if err != nil {
    if strings.Contains(err.Error(), "does not exist") {
        cli, err = acme.SaveConfigToFile(defaults) // bootstrap config
    }
    if err != nil { return err }
}

Prevention

When it happens

Trigger: Calling LoadConfigFromFile with a path that was never written (SaveConfigToFile not run), a typo in the filename, or a relative path resolved from a different working directory than expected.

Common situations: First run before any config was saved; running the CLI from a different cwd so a relative config path no longer resolves; container volume not mounted so the config file is missing; config deleted by cleanup scripts.

Understand the failure class

Background: "Config file not found": what it means and how to fix it in docker-sync, Maven, Vagrant, Turborepo and other tools — this error's family across 60 libraries.

Related errors


AI-assisted analysis of Billionmail/BillionMail@fc36c76c05 (2026-09-05). Data as JSON: /api/errors/42879e5a351855cb. Report an issue: GitHub.