Sonarr/Sonarr · error · NotifiarrException
Unable to send notification. Service Unavailable
Error message
Unable to send notification. Service Unavailable
What it means
NotifiarrException("Unable to send notification. Service Unavailable") is thrown when Notifiarr responds with HTTP 502, 503, or 504. These are gateway/availability errors indicating Notifiarr's backend or its upstream is temporarily down. The original HttpException is passed as the inner exception.
Source
Thrown at src/NzbDrone.Core/Notifications/Notifiarr/NotifiarrProxy.cs:64
}
catch (HttpException ex)
{
var responseCode = ex.Response.StatusCode;
switch ((int)responseCode)
{
case 401:
_logger.Error("HTTP 401 - API key is invalid");
throw new NotifiarrException("API key is invalid");
case 400:
// 400 responses shouldn't be treated as an actual error because it's a misconfiguration
// between Sonarr and Notifiarr for a specific event, but shouldn't stop all events.
_logger.Error("HTTP 400 - Unable to send notification. Ensure Sonarr Integration is enabled & assigned a channel on Notifiarr");
break;
case 502:
case 503:
case 504:
_logger.Error("Unable to send notification. Service Unavailable");
throw new NotifiarrException("Unable to send notification. Service Unavailable", ex);
case 520:
case 521:
case 522:
case 523:
case 524:
throw new NotifiarrException("Cloudflare Related HTTP Error - Unable to send notification", ex);
default:
_logger.Error(ex, "Unknown HTTP Error - Unable to send notification");
throw new NotifiarrException("Unknown HTTP Error - Unable to send notification", ex);
}
}
}
}
}
View on GitHub (pinned to da2284d7ea)
Solutions
- Retry the notification after a few minutes; 502/503/504 are typically transient.
- Check the Notifiarr status page or Discord for ongoing incidents.
- If 504 persists, verify network throughput and that no firewall is dropping long-lived connections.
- Sonarr will retry on subsequent events automatically; no permanent config change is needed for a transient outage.
Defensive patterns
Strategy: retry
Validate before calling
// Cannot pre-validate a server outage; validate reachable URL only
if (!Uri.TryCreate("https://notifiarr.com", UriKind.Absolute, out _))
{
/* network config issue */
} Type guard
public static bool IsNotifiarrUnavailable(Exception ex) => ex is Notifiarr.NotifiarrException && ex.Message.Contains("Service Unavailable"); Try / catch
// Retry transient 502/503/504 with backoff
int attempts = 0;
while (true)
{
try { _notifiarrProxy.SendNotification(payload, settings); break; }
catch (NotifiarrException ex) when (ex.Message.Contains("Service Unavailable") && attempts++ < 3)
{
await Task.Delay(TimeSpan.FromSeconds(5 * attempts));
}
} Prevention
- Implement exponential backoff for 502/503/504.
- Do not treat service-unavailable as a config error; alert on repeated failures.
- Subscribe to Notifiarr status notifications.
When it happens
Trigger: ProcessNotification POSTs to Notifiarr and receives 502 Bad Gateway, 503 Service Unavailable, or 504 Gateway Timeout. The switch falls into the combined case 502/503/504 branch, logs the error, and throws.
Common situations: Notifiarr is undergoing maintenance or an outage. Notifiarr's upstream provider is degraded. The request payload is large and the gateway timed out (504). Transient network congestion between Sonarr's host and Notifiarr.
Understand the failure class
- HTTP status errors: handling 4xx and 5xx responses — how to handle 4xx and 5xx responses properly.
Related errors
- Cloudflare Related HTTP Error - Unable to send notification
- Unknown HTTP Error - Unable to send notification
- Unable to connect to Mailgun. Status code: {0}
- API key is invalid
- Unable to send text message: {0}
AI-assisted analysis of Sonarr/Sonarr@da2284d7ea (2026-08-13).
Data as JSON: /api/errors/308c025ece4fcdc0.
Report an issue: GitHub.