{"record":{"id":"0e9bee1bf890851e","repo":"Billionmail/BillionMail","slug":"failed-to-create-email-sender-w","errorCode":null,"errorMessage":"failed to create email sender: %w","messagePattern":"failed to create email sender: %w","errorType":"http","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"core/internal/controller/campaign/campaign_v1_form.go","lineNumber":121,"sourceCode":"\tdomain := \"\"\n\tif u, err := url.Parse(baseURL); err == nil && u.Hostname() != \"\" {\n\t\tdomain = u.Hostname()\n\t} else {\n\t\t// Fallback: try to get from environment\n\t\tif hostname, err := public.DockerEnv(\"BILLIONMAIL_HOSTNAME\"); err == nil && hostname != \"\" {\n\t\t\tdomain = hostname\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"unable to determine domain for noreply email\")\n\t\t}\n\t}\n\n\t// Construct noreply email address\n\tnoreplyEmail := fmt.Sprintf(\"noreply@%s\", domain)\n\n\t// Create email sender\n\tsender, err := mail_service.NewEmailSenderWithLocal(noreplyEmail)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create email sender: %w\", err)\n\t}\n\tdefer sender.Close()\n\n\t// Create confirmation email content\n\tsubject := \"Welcome! Your subscription has been confirmed\"\n\tcontent := fmt.Sprintf(`\n<!DOCTYPE html>\n<html>\n<head>\n    <meta charset=\"utf-8\">\n    <title>Subscription Confirmed</title>\n    <style>\n        body { font-family: Arial, sans-serif; line-height: 1.6; color: #333; }\n        .container { max-width: 600px; margin: 0 auto; padding: 20px; }\n        .header { background-color: #20a53a; color: white; padding: 20px; text-align: center; }\n        .content { padding: 20px; background-color: #f9f9f9; }\n        .footer { text-align: center; padding: 20px; color: #666; font-size: 12px; }\n    </style>","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/Billionmail/BillionMail/blob/fc36c76c050c3775c5e899faf7403cf0262d2744/core/internal/controller/campaign/campaign_v1_form.go#L103-L139","documentation":"After deriving the mountpoint from the user's home directory, RetrieveMountpointByUser verifies it exists with FileExists and throws 'mountpoint not exists' when the directory is missing on disk. The inferred prefix path (or '/' if empty) is not a real mounted directory.","triggerScenarios":"The path before '/home/' in the user's HomeDir (e.g. '/mnt/data' in '/mnt/data/home/user') does not exist on the filesystem at call time — unmounted volume, typo in home dir config, or removed directory.","commonSituations":"Data volume not yet mounted when the service starts (common in container orchestration), stale /etc/passwd entries after storage was detached, or home directories pointing at removed paths.","solutions":["Mount the storage volume that should contain the mountpoint before calling the function","Verify the path exists: ls the mountpoint and correct the user's home directory if it points at a stale path (usermod -d)","Add an existence check for the mountpoint in calling code and wait/retry until the volume is mounted","Recreate the missing directory if it was deleted and re-mount data"],"exampleFix":"// before\nmp, _ := public.RetrieveMountpointByUser(\"www\") // uses stale /mnt/old\n// after\nif _, err := os.Stat(\"/mnt/data\"); err != nil {\n\treturn fmt.Errorf(\"mount volume /mnt/data first: %w\", err)\n}\nmp, err := public.RetrieveMountpointByUser(\"www\")","handlingStrategy":"validation","validationCode":"if mp, err := public.RetrieveMountpointByUser(username); err == nil {\n\tif _, serr := os.Stat(mp); serr != nil {\n\t\treturn fmt.Errorf(\"mountpoint %s missing: mount the volume first\", mp)\n\t}\n}","typeGuard":null,"tryCatchPattern":"mp, err := public.RetrieveMountpointByUser(username)\nif err != nil {\n\tif strings.Contains(err.Error(), \"mountpoint not exists\") {\n\t\t// wait for/retry volume mount, then retry once\n\t}\n\treturn err\n}","preventionTips":["Ensure storage volumes are mounted before app startup (init containers / systemd RequiresMountsFor)","Audit user home directories for stale paths after storage changes","Add a readiness check that the mountpoint exists before serving requests","Avoid deleting mount roots while services referencing them are running"],"tags":["filesystem","mountpoint","linux","volume"],"backgroundTag":"mountpoint-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"}