{"record":{"id":"c29bc2fc41a20b94","repo":"Billionmail/BillionMail","slug":"failed-to-send-confirmation-email-w","errorCode":null,"errorMessage":"failed to send confirmation email: %w","messagePattern":"failed to send confirmation email: %w","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/internal/controller/campaign/campaign_v1_form.go","lineNumber":169,"sourceCode":"            <p>Best regards,<br>The Team</p>\n        </div>\n        <div class=\"footer\">\n            <p>This email was sent to %s</p>\n            <p>Powered by BillionMail</p>\n        </div>\n    </div>\n</body>\n</html>`, name, email)\n\n\t// Create email message\n\tmessage := mail_service.NewMessage(subject, content)\n\tmessage.SetMessageID(sender.GenerateMessageID())\n\tmessage.SetRealName(\"Newsletter Team\")\n\n\t// Send the email\n\terr = sender.Send(message, []string{email})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to send confirmation email: %w\", err)\n\t}\n\n\tg.Log().Info(ctx, \"Confirmation email sent successfully to %s\", email)\n\treturn nil\n}\n","sourceCodeStart":151,"sourceCodeEnd":175,"githubUrl":"https://github.com/Billionmail/BillionMail/blob/fc36c76c050c3775c5e899faf7403cf0262d2744/core/internal/controller/campaign/campaign_v1_form.go#L151-L175","documentation":"Chgrp looks up a group by name via user.LookupGroup and then recursively changes the target path's group to the found GID. It throws 'group not exists: <name>' when the GID parsed from the group entry is < 1 — i.e. the lookup yielded no valid GID (the record is empty/invalid). A truly unknown group would already fail earlier at LookupGroup, so this guards malformed group entries.","triggerScenarios":"Calling Chgrp(path, groupName) where the group record returned by the system has an empty or zero Gid string — corrupt /etc/group entry, NSS plugin returning an empty Gid, or a group named '0'/'-1' edge case.","commonSituations":"Broken /etc/group after manual editing; LDAP/SSSD directory issues returning incomplete group records; running in minimal containers with an incomplete group database.","solutions":["Verify the group exists with a valid GID: getent group <name>","Fix the corrupt /etc/group entry (or NSS/LDAP record) so Gid is a positive integer","If the group is truly missing, create it: groupadd -g <gid> <name>","Alternatively call ChgrpWithGidRecursive directly with a known-good numeric GID to bypass the name lookup"],"exampleFix":"// before\nerr := public.Chgrp(\"/var/www\", \"deployers\") // corrupt group entry, gid=0\n// after\nif out, err := exec.Command(\"getent\", \"group\", \"deployers\").Output(); err != nil || len(out) == 0 {\n\treturn fmt.Errorf(\"group deployers missing/invalid\")\n}\nerr := public.ChgrpWithGidRecursive(\"/var/www\", 1001)","handlingStrategy":"validation","validationCode":"if grp, err := user.LookupGroup(groupName); err != nil || gconv.Int(grp.Gid) < 1 {\n\treturn fmt.Errorf(\"group %s has no valid GID; fix /etc/group or groupadd it\", groupName)\n}","typeGuard":null,"tryCatchPattern":"if err := public.Chgrp(path, groupName); err != nil {\n\tif strings.Contains(err.Error(), \"group not exists\") {\n\t\t// create the group or use ChgrpWithGidRecursive with a numeric GID\n\t}\n\treturn err\n}","preventionTips":["Verify groups with 'getent group <name>' before programmatic chgrp","Keep /etc/group valid when provisioning images; avoid hand-editing without validation","Provision required groups in the container image, not at runtime","Prefer numeric GIDs (ChgrpWithGidRecursive) in environments with unreliable NSS/LDAP"],"tags":["filesystem","permissions","linux","group"],"backgroundTag":"group-not-found","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"}