{"record":{"id":"951b71e0ffccbe73","repo":"Billionmail/BillionMail","slug":"rspamdadm-not-found","errorCode":null,"errorMessage":"rspamdadm not found","messagePattern":"rspamdadm not found","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/internal/service/rspamd/worker_controller.go","lineNumber":47,"sourceCode":"\tpasswordPlain := grand.S(16)\n\n\t// Generate the worker controller configuration\n\tdk, err := docker.NewDockerAPI()\n\n\tif err != nil {\n\t\treturn\n\t}\n\n\tdefer dk.Close()\n\n\tres, err := dk.ExecCommandByName(context.Background(), consts.SERVICES.Rspamd, []string{\"rspamadm\", \"pw\", \"-p\", passwordPlain}, \"root\")\n\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif res == nil {\n\t\terr = errors.New(\"rspamdadm not found\")\n\t\treturn\n\t}\n\n\t_, err = public.WriteFile(wci, `count = 1;\npassword = \"`+strings.TrimSpace(strings.SplitN(strings.TrimSpace(res.Output), \"\\n\", 2)[0])+`\";\nsecure_ip = \"127.0.0.1\";\nsecure_ip = \"::1\";\nstatic_dir = \"${WWWDIR}\";`)\n\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// Save the password\n\terr = public.OptionsMgrInstance.SetOption(context.Background(), \"rspamd_worker_controller_password\", passwordPlain)\n\n\tif err != nil {\n\t\treturn","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/Billionmail/BillionMail/blob/fc36c76c050c3775c5e899faf7403cf0262d2744/core/internal/service/rspamd/worker_controller.go#L29-L65","documentation":"InitWorkerController runs `rspamadm pw` inside the Rspamd Docker container to hash a generated controller password. If the exec call returns a nil result (no command output object), the code treats it as rspamadm being unavailable and returns this error. It guards against silently writing an empty password hash into worker-controller.inc.","triggerScenarios":"dk.ExecCommandByName succeeds without error but returns res == nil — e.g. the Rspamd container reported no result for the exec, the container is in a bad state, or the docker API returned an empty exec response.","commonSituations":"Rspamd container not fully started or restarting; rspamadm binary missing from the container image (unusual/minimal image); docker API proxy returning empty responses; running initialization before the mail stack is deployed.","solutions":["Ensure the Rspamd container is running and healthy: docker ps | grep rspamd","Verify rspamadm exists in the container: docker exec <rspamd> which rspamadm","Re-run initialization after the container is up (the error path is transient in most deploys)","Check docker API logs for the failed exec and why it returned no result","As a last resort, recreate the Rspamd container from the official BillionMail image"],"exampleFix":"// before\nres, err := dk.ExecCommandByName(ctx, consts.SERVICES.Rspamd, []string{\"rspamadm\", \"pw\", \"-p\", passwordPlain}, \"root\")\nif err != nil { return }\n// after\nif err := waitForContainerHealthy(ctx, consts.SERVICES.Rspamd); err != nil { return err }\nres, err := dk.ExecCommandByName(ctx, consts.SERVICES.Rspamd, []string{\"rspamadm\", \"pw\", \"-p\", passwordPlain}, \"root\")\nif err != nil { return }\nif res == nil { return errors.New(\"rspamadm not found\") }","handlingStrategy":"validation","validationCode":"out, err := exec.Command(\"docker\", \"exec\", rspamdContainer, \"which\", \"rspamadm\").Output()\nif err != nil || len(out) == 0 {\n    return fmt.Errorf(\"rspamadm unavailable in container %s\", rspamdContainer)\n}","typeGuard":null,"tryCatchPattern":"if err := rspamd.InitWorkerController(); err != nil {\n    if strings.Contains(err.Error(), \"rspamdadm not found\") {\n        // wait for the rspamd container then retry once\n        time.Sleep(10 * time.Second)\n        return rspamd.InitWorkerController()\n    }\n    return err\n}","preventionTips":["Ensure the official BillionMail rspamd image includes rspamadm (don't use stripped images)","Add a container healthcheck gate before running rspamd initialization","Log docker exec results (including nil-result cases) for diagnostics","Run initialization only after the full mail stack is deployed"],"tags":["rspamd","docker","exec","mail"],"backgroundTag":"binary-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"}