{"record":{"id":"10e24163608180e5","repo":"Billionmail/BillionMail","slug":"model-not-found","errorCode":null,"errorMessage":"Model not found","messagePattern":"Model not found","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/internal/controller/askai/askai_v1_supplier.go","lineNumber":41,"sourceCode":"func (c *ControllerV1) Models(ctx context.Context, req *v1.ModelsReq) (res *v1.ModelsRes, err error) {\n\tres = &v1.ModelsRes{}\n\tres.Data = askai.Models(req.SupplierName)\n\tres.SetSuccess(public.LangCtx(ctx, \"List of models retrieved successfully\"))\n\treturn res, nil\n}\n\nfunc (c *ControllerV1) AddModel(ctx context.Context, req *v1.AddModelReq) (res *v1.AddModelRes, err error) {\n\tres = &v1.AddModelRes{}\n\tres.Data = askai.AddModel(req.SupplierName, req.Title, req.ModelId, req.MaxTokens, req.Capability)\n\tres.SetSuccess(public.LangCtx(ctx, \"Model added successfully\"))\n\treturn res, nil\n}\n\nfunc (c *ControllerV1) RemoveModel(ctx context.Context, req *v1.RemoveModelReq) (res *v1.RemoveModelRes, err error) {\n\tres = &v1.RemoveModelRes{}\n\tres.Data = askai.RemoveModel(req.SupplierName, req.ModelId)\n\tif res.Data == nil {\n\t\tres.SetError(errors.New(public.LangCtx(ctx, \"Model not found\")))\n\t\treturn res, nil\n\t}\n\tres.SetSuccess(public.LangCtx(ctx, \"Model removed successfully\"))\n\treturn res, nil\n}\n\nfunc (c *ControllerV1) SetSupplierConfig(ctx context.Context, req *v1.SetSupplierConfigReq) (res *api_v1.StandardRes, err error) {\n\tres = &api_v1.StandardRes{}\n\tresult := askai.SetSupplierConfig(req.SupplierName, req.BaseUrl, req.ApiKey)\n\tif result == nil {\n\t\tres.Data = result\n\t\tres.SetSuccess(public.LangCtx(ctx, \"Supplier configuration updated successfully\"))\n\t} else {\n\t\tres.SetError(result)\n\t}\n\n\treturn res, nil\n}","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/Billionmail/BillionMail/blob/fc36c76c050c3775c5e899faf7403cf0262d2744/core/internal/controller/askai/askai_v1_supplier.go#L23-L59","documentation":"modifyPostfixNetworksText found the 'postfix-billionmail:' service line but no 'networks:' block inside that service's definition. Because the function edits the existing networks section in place rather than synthesizing the whole service block, it refuses to proceed and returns the file unchanged.","triggerScenarios":"The postfix-billionmail service exists in docker-compose.yml but has no 'networks:' key under it (the scanner looks for a line containing 'networks:' after the service start index).","commonSituations":"Compose files where the service was written without an explicit networks section (relying on the default network), or where networks was removed during customization.","solutions":["Add a 'networks:' section (even with one entry) to the postfix-billionmail service in docker-compose.yml","Keep the networks key at the indentation the scanner expects (8 spaces / two tab levels under services)","Run the rebuild-based path (rebuildPostfixServiceNetworks) instead, which works on parsed YAML and can add missing networks","Regenerate docker-compose.yml from the original BillionMail template"],"exampleFix":"# before\nservices:\n  postfix-billionmail:\n    image: billionmail/postfix\n# after\nservices:\n  postfix-billionmail:\n    image: billionmail/postfix\n    networks:\n      billionmail-network:\n        aliases:\n          - postfix","handlingStrategy":"validation","validationCode":"if !strings.Contains(string(data), \"networks:\") {\n\t// ensure the postfix service declares a networks section before the text edit\n}","typeGuard":null,"tryCatchPattern":"lines, err := m.modifyPostfixNetworksText(lines, configs)\nif err != nil && strings.Contains(err.Error(), \"networks section not found\") {\n\t// fall back to the parsed-YAML rebuild path which can add networks\n}","preventionTips":["Always define a networks: key under postfix-billionmail, even minimal","Prefer rebuildPostfixServiceNetworks (parsed YAML) over text patching for files without networks","Regenerate compose files from the official template instead of editing them ad hoc","Test multi-IP configuration on a copy of the compose file first"],"tags":["docker-compose","multi-ip","config","yaml"],"backgroundTag":"networks-section-missing","analyzedSha":"fc36c76c050c3775c5e899faf7403cf0262d2744","analyzedAt":"2026-09-05T21:28:54.019Z","contentChangedAt":"2026-09-05T21:28:54.019Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}