{"record":{"id":"42879e5a351855cb","repo":"Billionmail/BillionMail","slug":"configuration-file-does-not-exist-s","errorCode":null,"errorMessage":"configuration file does not exist: %s","messagePattern":"configuration file does not exist: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/internal/service/acme/cli.go","lineNumber":274,"sourceCode":"\n\t// Insert into database\n\tcertId, err := public.MR(\"ssl\", \"letsencrypts\").InsertAndGetId(data)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn int(certId), nil\n}\n\n/**\n * @brief Load configuration from JSON file\n * @param filepath Path to JSON configuration file\n * @return *AcmeCLI, error\n */\nfunc LoadConfigFromFile(filepath string) (*AcmeCLI, error) {\n\t// Check if file exists\n\tif !public.FileExists(filepath) {\n\t\treturn nil, fmt.Errorf(\"configuration file does not exist: %s\", filepath)\n\t}\n\n\t// Read file\n\tcontent, err := public.ReadFile(filepath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Parse JSON\n\tvar config AcmeCLI\n\terr = json.Unmarshal([]byte(content), &config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &config, nil\n}\n","sourceCodeStart":256,"sourceCodeEnd":292,"githubUrl":"https://github.com/Billionmail/BillionMail/blob/fc36c76c050c3775c5e899faf7403cf0262d2744/core/internal/service/acme/cli.go#L256-L292","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check the file exists at the exact path (ls / public.FileExists) before loading","Create the config first via SaveConfigToFile or write the JSON manually","Use an absolute path instead of a relative one to avoid cwd ambiguity","Verify volumes/mounts when running in Docker so the config path is present"],"exampleFix":"// before\ncli, err := acme.LoadConfigFromFile(\"acme.json\")\n// after\ncfgPath := \"/etc/billionmail/acme.json\"\nif !public.FileExists(cfgPath) {\n    return errors.New(\"run apply first to create config at \" + cfgPath)\n}\ncli, err := acme.LoadConfigFromFile(cfgPath)","handlingStrategy":"validation","validationCode":"if !public.FileExists(cfgPath) {\n    return fmt.Errorf(\"ACME config missing at %s; run apply first\", cfgPath)\n}","typeGuard":null,"tryCatchPattern":"cli, err := acme.LoadConfigFromFile(cfgPath)\nif err != nil {\n    if strings.Contains(err.Error(), \"does not exist\") {\n        cli, err = acme.SaveConfigToFile(defaults) // bootstrap config\n    }\n    if err != nil { return err }\n}","preventionTips":["Use absolute config paths immune to cwd changes","Bootstrap/default the config on first run","Verify volume mounts in containers include the config dir"],"tags":["configuration","file-not-found","acme"],"backgroundTag":"config-file-not-found","analyzedSha":"fc36c76c050c3775c5e899faf7403cf0262d2744","analyzedAt":"2026-09-05T21:28:54.019Z","contentChangedAt":"2026-09-05T21:28:54.019Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}