{"record":{"id":"51c8d031fc59ecc5","repo":"Billionmail/BillionMail","slug":"missing-services-in-config","errorCode":null,"errorMessage":"missing 'services' in config","messagePattern":"missing 'services' in config","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/internal/service/multi_ip_domain/config_manager.go","lineNumber":471,"sourceCode":"\t\tresult = append(result, lines[postfixNetworksEndIdx:]...)\n\t}\n\n\treturn result, nil\n}\n\n// deepCopy performs a deep copy of any value using YAML marshal/unmarshal\nfunc deepCopy(src interface{}) interface{} {\n\tdata, _ := yaml.Marshal(src)\n\tvar copy interface{}\n\tyaml.Unmarshal(data, &copy)\n\treturn copy\n}\n\n// rebuildPostfixServiceNetworks Rebuild Postfix service network configuration\nfunc (m *ConfigManager) rebuildPostfixServiceNetworks(config map[string]interface{}, configs []map[string]interface{}) error {\n\tservices, ok := config[\"services\"].(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"missing 'services' in config\")\n\t}\n\n\tpostfix, ok := services[\"postfix-billionmail\"].(map[string]interface{})\n\tif !ok {\n\t\treturn fmt.Errorf(\"postfix-billionmail service not found\")\n\t}\n\n\t// Get current networks (preserve original)\n\tnetworks, ok := postfix[\"networks\"].(map[string]interface{})\n\tif !ok {\n\t\tnetworks = make(map[string]interface{})\n\t}\n\n\t// === 1. Remove all custom networks (except default billionmail-network) ===\n\tfor name := range networks {\n\t\tif name != \"billionmail-network\" {\n\t\t\tdelete(networks, name)\n\t\t\tg.Log().Debugf(context.Background(), \"Removed old custom network: %s\", name)","sourceCodeStart":453,"sourceCodeEnd":489,"githubUrl":"https://github.com/Billionmail/BillionMail/blob/fc36c76c050c3775c5e899faf7403cf0262d2744/core/internal/service/multi_ip_domain/config_manager.go#L453-L489","documentation":"Type assertion guard at the top of rebuildPostfixServiceNetworks: the parsed docker-compose config map has no 'services' key of type map[string]interface{}, so the YAML is missing (or has a differently shaped) top-level services section and the Postfix service networks cannot be rebuilt. This is a structural check on the parsed compose document, not a runtime IO failure.","triggerScenarios":"Thrown at core/internal/service/multi_ip_domain/config_manager.go:471 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Validate docker-compose.yml structure (services key present at top level) before calling rebuild functions","Fix or restore the compose file so 'services:' exists with service mappings underneath","Use a stricter YAML schema check on load to reject malformed compose files early with a clearer message"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}