{"record":{"id":"a07325be4c5ee5f5","repo":"knadh/listmonk","slug":"non-ok-response-from-postback-server-d","errorCode":null,"errorMessage":"non-OK response from Postback server: %d","messagePattern":"non-OK response from Postback server: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/messenger/postback/postback.go","lineNumber":208,"sourceCode":"\n\t// If the request method is GET or DELETE, add the params as QueryString.\n\tif method == http.MethodGet || method == http.MethodDelete {\n\t\treq.URL.RawQuery = string(reqBody)\n\t}\n\n\t// Execute the request.\n\tr, err := p.c.Do(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\t// Drain and close the body to let the Transport reuse the connection\n\t\tio.Copy(io.Discard, r.Body)\n\t\tr.Body.Close()\n\t}()\n\n\tif r.StatusCode != http.StatusOK {\n\t\treturn fmt.Errorf(\"non-OK response from Postback server: %d\", r.StatusCode)\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":190,"sourceCodeEnd":213,"githubUrl":"https://github.com/knadh/listmonk/blob/670c01717d48647093335cc23a6be6f4b79c3b6b/internal/messenger/postback/postback.go#L190-L213","documentation":"The Postback server responded to a message push with a non-200 HTTP status code, indicating the remote server rejected or failed the request.","triggerScenarios":"The HTTP response from the configured Postback endpoint has StatusCode != http.StatusOK — e.g. wrong URL path, server-side error, auth rejection, or redirect not followed.","commonSituations":"Postback URL misconfigured (wrong port/path); server restarted or down returning 502/503 from a proxy; endpoint moved; firewall/WAF returning 403; server returning 500 due to malformed payload.","solutions":["Verify the Postback server URL is correct and the endpoint returns 200 on success","Check Postback server logs for the corresponding request to see why it rejected (500/403/404)","Test the endpoint with curl using the same payload to reproduce the status code","If a proxy is in front, ensure it forwards correctly and isn't intercepting with 403/502"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"resp, err := http.Post(url, \"application/json\", body)\nif err == nil && resp.StatusCode != http.StatusOK {\n    // re-check endpoint/credentials before pushing\n}","typeGuard":null,"tryCatchPattern":"if err := pusher.Push(msg); err != nil {\n    if strings.Contains(err.Error(), \"non-OK response from Postback server\") {\n        // log status, apply backoff and retry on 5xx, alert on persistent non-200\n    }\n}","preventionTips":["Health-check the Postback endpoint before queuing pushes","Retry with exponential backoff on 5xx; do not retry 4xx","Monitor endpoint status codes and alert on non-200 responses"],"tags":["http","postback","network"],"backgroundTag":"http-non-200-response","analyzedSha":"670c01717d48647093335cc23a6be6f4b79c3b6b","analyzedAt":"2026-09-01T03:39:35.452Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}