knadh/listmonk · error

non-OK response from Postback server: %d

Error message

non-OK response from Postback server: %d

What it means

The Postback server responded to a message push with a non-200 HTTP status code, indicating the remote server rejected or failed the request.

Source

Thrown at internal/messenger/postback/postback.go:208

	// If the request method is GET or DELETE, add the params as QueryString.
	if method == http.MethodGet || method == http.MethodDelete {
		req.URL.RawQuery = string(reqBody)
	}

	// Execute the request.
	r, err := p.c.Do(req)
	if err != nil {
		return err
	}
	defer func() {
		// Drain and close the body to let the Transport reuse the connection
		io.Copy(io.Discard, r.Body)
		r.Body.Close()
	}()

	if r.StatusCode != http.StatusOK {
		return fmt.Errorf("non-OK response from Postback server: %d", r.StatusCode)
	}

	return nil
}

View on GitHub (pinned to 670c01717d)

Solutions

  1. Verify the Postback server URL is correct and the endpoint returns 200 on success
  2. Check Postback server logs for the corresponding request to see why it rejected (500/403/404)
  3. Test the endpoint with curl using the same payload to reproduce the status code
  4. If a proxy is in front, ensure it forwards correctly and isn't intercepting with 403/502
Defensive patterns

Strategy: retry

Validate before calling

resp, err := http.Post(url, "application/json", body)
if err == nil && resp.StatusCode != http.StatusOK {
    // re-check endpoint/credentials before pushing
}

Try / catch

if err := pusher.Push(msg); err != nil {
    if strings.Contains(err.Error(), "non-OK response from Postback server") {
        // log status, apply backoff and retry on 5xx, alert on persistent non-200
    }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of knadh/listmonk@670c01717d (2026-09-01). Data as JSON: /api/errors/a07325be4c5ee5f5. Report an issue: GitHub.