{"record":{"id":"614e17df12cf42dd","repo":"Billionmail/BillionMail","slug":"failed-to-register-user","errorCode":null,"errorMessage":"Failed to register user: {}","messagePattern":"Failed to register user: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/internal/service/acme/acme.go","lineNumber":449,"sourceCode":"\t\tcase \"godaddy\":\n\t\t\terr = SetDnsGodaddy(ctx, client, dnsProviderToken)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", \"\", errors.New(public.LangCtx(ctx, \"Failed to set Godaddy DNS verification: {}\", err.Error()))\n\t\t\t}\n\t\tdefault:\n\t\t\treturn \"\", \"\", errors.New(public.LangCtx(ctx, \"Unsupported DNS provider: {}\", dnsProvider))\n\t\t}\n\t}\n\n\t// Register or query existing user on ACME server\n\tvar reg *registration.Resource\n\t// Try to query existing registration first (same key = same account)\n\treg, err = client.Registration.QueryRegistration()\n\tif err != nil || reg == nil {\n\t\t// No existing registration, register new account\n\t\treg, err = client.Registration.Register(registration.RegisterOptions{TermsOfServiceAgreed: true})\n\t\tif err != nil {\n\t\t\treturn \"\", \"\", errors.New(public.LangCtx(ctx, \"Failed to register user: {}\", err.Error()))\n\t\t}\n\t}\n\n\t// Save user information\n\tmyUser.Registration = reg\n\n\t// Submit application\n\trequest := certificate.ObtainRequest{\n\t\tDomains: domains,\n\t\tBundle:  true,\n\t}\n\n\t// Get certificate\n\tcertificates, err := client.Certificate.Obtain(request)\n\tif err != nil {\n\t\treturn \"\", \"\", errors.New(public.LangCtx(ctx, \"Failed to apply for SSL certificate: {}\", err.Error()))\n\t}\n","sourceCodeStart":431,"sourceCodeEnd":467,"githubUrl":"https://github.com/Billionmail/BillionMail/blob/fc36c76c050c3775c5e899faf7403cf0262d2744/core/internal/service/acme/acme.go#L431-L467","documentation":"After challenge setup, the function queries the ACME account with client.Registration.QueryRegistration and, if none exists, registers a new account with client.Registration.Register(TermsOfServiceAgreed:true). This error means new-account registration with the ACME server (Let's Encrypt etc.) failed. Typical lego causes are unreachable ACME directory, rejected terms-of-service URL, invalid account key, or rate limiting.","triggerScenarios":"ApplySSLWithExistingServer (via Apply, StartRenew, ApplyLetsEncryptCertWithHttp, ApplyConsoleCert) when the saved ACME user key has no existing registration and client.Registration.Register fails — e.g. CA endpoint unreachable, CA in downtime, EAB/ToS mismatch, or the account key is corrupt.","commonSituations":"Server without outbound internet/HTTPS to acme-v02.api.letsencrypt.org; wrong CAURL configured (staging vs production); Let's Encrypt maintenance windows; system clock skew breaking JWS signatures.","solutions":["Check the wrapped err text and verify the server can reach the ACME directory URL (curl the CAURL endpoint)","Confirm the CAURL setting matches the intended environment (staging vs production) and that the account private key file exists and is valid","Synchronize system time (NTP) and retry; if rate-limited, wait or switch to the staging CA while testing"],"exampleFix":"// before\nCAURL: \"https://acme-v02.api.letsencrypt.org/directory\" // unreachable from airgapped host\n// after\n// open egress to CA, or for testing:\nCAURL: lego.LEDirectoryStaging","handlingStrategy":"retry","validationCode":"// reachability + time sanity before applying\nresp, err := http.Get(caURL + \"/directory\")\nif err != nil || resp.StatusCode != 200 {\n    return fmt.Errorf(\"ACME directory unreachable: %v\", err)\n}\nif time.Now().UTC().Sub(lastNTPCheck) > time.Hour { /* resync clock */ }","typeGuard":"func acmeUserReady(u *AcmeUser) bool {\n    return u != nil && u.Email != \"\" && u.Registration != nil || (u != nil && u.key != nil)\n}","tryCatchPattern":"cert, _, err := ApplySSLWithExistingServer(ctx, ...)\nif err != nil && strings.Contains(err.Error(), \"Failed to register user\") {\n    // transient CA outages are common: back off and retry\n    time.Sleep(30 * time.Second)\n    return retryApply(ctx, 3)\n}","preventionTips":["Verify outbound HTTPS to the ACME directory before applying","Keep NTP active to avoid JWS timestamp rejection","Use the staging CA for testing to dodge production rate limits"],"tags":["acme","registration","letsencrypt","network"],"backgroundTag":"acme-account-registration-failed","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"}