Skip to content

A Response Rule Failed

Your site answered DownBad with a good status code, but the answer broke one of the monitor’s response rules: the checks you added on what the page must, or must not, contain. This page helps you see what the rule expected, decide whether the page or the rule is wrong, fix it, and watch the incident close.

An incident is open for a URL monitor, with the failure type assertion (an assertion is another word for a rule the response must meet). It shows a reason in this shape:

Response rule <n> failed: expected <rule>, got <what the response had>
  • <n> is the rule’s place in the monitor’s list of rules, counting from 1.
  • <rule> is the rule in words, such as header Strict-Transport-Security to be present.
  • <what the response had> is what DownBad found instead, cut to its first 200 characters, with … at the end when there was more.

Here are real reasons, one for each kind of rule:

Response rule 1 failed: expected header Strict-Transport-Security to be present, got no Strict-Transport-Security header
Response rule 2 failed: expected the body to contain "Welcome", got "<html><h1>Sign in</h1><p>Database error</p></html>"
Response rule 3 failed: expected $.status to equal "ok", got "degraded"
Response rule 1 failed: expected the body to be valid JSON, got the body is not valid JSON (Unexpected token '<', "<html><h1>"... is not valid JSON)

DownBad runs the rules in order, and the reason names only the first rule that failed. Rules after it weren’t judged on that check, so once you fix this one, the next check can stop at a later rule that also fails.

The rules run only when the status code passed: a page that answers with an error code fails on that instead, as described in Website Returns an Error Status Code. They judge the last answer, after any redirects the check followed.

Usually it is the page. DownBad didn’t open this incident on one answer: when a check fails, DownBad checks again from up to three other places in the United States, and those checks run the same rules. It opens the incident only when at least half of the places that answered also found the rule broken.

There are three common exceptions, where the page is fine for you but not for DownBad:

  • The header changes on every request. Some headers are different each time, or differ between the servers of a CDN (a service such as Cloudflare that keeps copies of your site in many places). A rule that wants an exact value for one of them fails at random. See A header rule failed.
  • DownBad gets a different page from you. DownBad reads the page as your server sends it. It doesn’t run the page’s JavaScript, isn’t signed in, and keeps no cookies. Text that only appears after the page’s scripts run, or only once you sign in, isn’t in what DownBad reads. The exception is a monitor with Include JavaScript rendering on: its body and JSON rules read the page as a browser shows it, after its scripts run. See Check a Page as a Browser Shows It. A site with bot protection can also send DownBad a challenge page instead of yours: see Bot Protection or a CDN Turns DownBad Away.
  • The rule itself is wrong. A typo, different capital letters, or a value that was right before a change to the site.

To look without a terminal (the window where you type commands: Terminal on a Mac, PowerShell on Windows), open the page in Chrome, Edge or Firefox and press F12 (on a Mac, Cmd+Option+I) to open the browser’s developer tools. In the Network tab, reload the page and choose the first row to see its response headers. To see the text your server sends, before any scripts run, choose View Page Source from the page’s right-click menu. Your browser is signed in and keeps cookies, so it can still see more than DownBad does.

These commands ask for the page the way DownBad’s check does, from your own computer. They only read, and change nothing.

They use curl, a tool for fetching web addresses, which comes with macOS, most kinds of Linux, and every installation of Windows 10 and 11. -A sends DownBad’s user agent (the name a program gives itself to the sites it visits), -m 23 gives up after 23 seconds, the longest a DownBad check waits, and -L --max-redirs 5 follows up to five redirects, as DownBad does. If the monitor’s Follow Redirects is off, leave out -L --max-redirs 5. If the monitor’s HTTP Headers has a User-Agent entry, put its value in place of DownBad’s. Put the monitor’s URL in place of https://example.com/.

The example outputs on the macOS and Linux tabs are real runs. The output on the Windows tab is illustrative: Windows ships the same curl, which prints what the server sent, so it is copied from those runs rather than from a run on Windows. The JSON example in step 3 is from https://httpbin.org/json, a public test address that answers with JSON, as each example’s title says.

1. For a header rule, look for the header. Put the rule’s header name in place of strict-transport-security. Header names match whatever their capital letters.

Terminal window
curl -sS -L --max-redirs 5 -m 23 -A "DownBad/1.0 (Uptime Monitor; +https://downbad.app/docs/resources/checker/)" -o /dev/null -D - https://example.com/ | grep -i "^strict-transport-security:"
If it works
strict-transport-security: max-age=31536000; includeSubdomains; preload
If the header is missing
(nothing is printed)

To see every header instead, leave out everything from the | on. When the check followed redirects, the headers of each answer are printed in turn, and the rule judged the last group.

2. For a body rule, count the lines that hold the text. Put the rule’s text in place of Welcome. Like a rule, this search minds capital letters.

Terminal window
curl -sS -L --max-redirs 5 -m 23 -A "DownBad/1.0 (Uptime Monitor; +https://downbad.app/docs/resources/checker/)" https://example.com/ | grep -c "Welcome"
If the text is there
1
If the text is missing
0

For a rule that says the body must not contain the text, it’s the other way round: 0 is what you want.

3. For a JSON rule, print the response. JSON is a plain-text format that programs use to send data, written with {, }, [ and ]. This prints the whole response, so you can find the value the rule’s path points at.

Terminal window
curl -sS -L --max-redirs 5 -m 23 -A "DownBad/1.0 (Uptime Monitor; +https://downbad.app/docs/resources/checker/)" https://example.com/
If it is JSON (output for https://httpbin.org/json)
{
"slideshow": {
"author": "Yours Truly",
"date": "date of publication",
If it is not JSON (output for https://example.com/)
<!doctype html><html lang=en><head><meta charset=utf-8>

Without a terminal: use the browser’s developer tools and View Page Source, as in Is it you or us?. For JSON, open the address in Firefox, which shows a JSON response as a tree you can fold, with a Raw Data tab for the text itself.

Find the section for the kind of rule the reason names. A reason that starts expected header is a header rule; expected the body to is a body rule; and expected $ or expected the body to be valid JSON is a JSON rule. Each section lists what DownBad found, from the most common case to the least.

A header is a line of information a server sends before the page, such as content-type: text/html. Header rules match the header’s name whatever its capital letters, and compare its value with capital letters minding, unless the rule ends (ignoring case).

  • expected header <name> to be present, got no <name> header: the header wasn’t in the answer. Either your server doesn’t send it, or something in front of your server, such as a CDN, removes it. A rule that wants a value gets the same got no <name> header when the header is missing.
  • expected header <name> to equal "<value>", expected header <name> to contain "<value>" or expected header <name> to match /<pattern>/, then got "<what it had>": the header was there, with a value other than the one the rule wants.
  • expected header <name> to be absent, got "<what it had>": the header was there, and the rule says it mustn’t be. got shows its value.
  • expected header <name> not to equal "<value>" or expected header <name> not to contain "<value>", then got "<what it had>": the header had exactly the value, or held the text, that the rule forbids. The rule did its job: your site sent the value you wanted to keep out, such as x-cache: MISS or a server header naming an old version.
  • got the pattern cannot be used (…): see DownBad won’t save the changed rule.
  • got a response this rule could not read (…): DownBad couldn’t apply the rule to the answer, which points to a rule stored in a form DownBad can’t use. Remove the rule and add it again. If it comes back, send us the reason as Still stuck says.

Headers that change on every request. Date (the time of the answer), Age (how long a CDN has held its copy), cache status headers such as cf-cache-status or x-cache (whether the CDN had a copy: HIT or MISS), and request IDs such as cf-ray or x-request-id are different from one answer to the next, and from one CDN server to the next. These two answers from the same page came seven seconds apart:

date: Thu, 26 Nov 2026 22:12:52 GMT
age: 6044
cf-ray: a60c3cb1aa5923b7-CLE
date: Thu, 26 Nov 2026 22:12:59 GMT
age: 6051
cf-ray: a60c3cde6c382726-CLE

A rule that wants one exact value for a header like these fails whenever the value moves on, so it alerts when nothing is wrong. Ask only whether such a header is present, or leave it out of your rules.

  1. Run step 1 of Check it yourself with the rule’s header name, and compare what it prints with the rule.

  2. If the header should be there and isn’t, add it where your site sets its headers: your app, or your web server’s settings on nginx or Apache. If a CDN sits in front of your site, check that it passes the header on; on Cloudflare, see Transform Rules for response headers.

  3. If the header has a value the rule forbids, or is there when it mustn’t be, change or remove it in the same places.

  4. If the header is one that changes on every request, or the value it now has is right, edit the monitor’s response rules and change this one: ask whether the header is present instead of what it equals, or put in the new value.

  5. Run step 1 of Check it yourself again, then follow Confirm DownBad sees the fix.

The body is the page itself: the text and HTML your server sends after the headers. Body rules compare with capital letters minding, unless the rule ends (ignoring case). The reason shows the start of the body, or, for a rule that the body must not contain some text, the part around where that text was found.

  • expected the body to contain "<text>": the text wasn’t in the page DownBad read. Common causes are that the page changed, that your site sent an error or sign-in page with a good status code (look at what the reason shows after got), or that the text only appears after the page’s JavaScript runs, which DownBad doesn’t do unless the monitor has Include JavaScript rendering on.
  • expected the body not to contain "<text>": the page held text the rule forbids, such as Database error. The rule did its job: got shows the part of the page around that text.
  • expected the body to match /<pattern>/: no part of the page fitted the rule’s regular expression (a pattern for text, such as Order #\d+ for “Order #” and a number).
  • expected the body to equal "<text>": the whole page had to be exactly this text, and wasn’t. “Equals” compares the entire body, so it suits only a very short answer, such as a health-check address that returns OK. For a normal page, use a “contains” rule.
  • expected the body not to equal "<text>": the whole page was exactly the text the rule forbids, such as an answer of only ERROR.
  • got the pattern cannot be used (…): see DownBad won’t save the changed rule.
  • got a response this rule could not read (…): DownBad couldn’t apply the rule to the answer, which points to a rule stored in a form DownBad can’t use. Remove the rule and add it again. If it comes back, send us the reason as Still stuck says.

DownBad reads the first megabyte (1 MB) of a page for body and JSON rules, and nothing after it. Text that sits beyond that point counts as missing, with no reason of its own. To see how big your page is, run this; anything over 1048576 is more than DownBad reads:

Terminal window
curl -sS -L --max-redirs 5 -m 23 -A "DownBad/1.0 (Uptime Monitor; +https://downbad.app/docs/resources/checker/)" -o /dev/null -w "%{size_download}\n" https://example.com/

On Windows, type curl.exe and -o NUL in place of curl and -o /dev/null.

If it works
577
  1. Run step 2 of Check it yourself with the rule’s text, and read what the reason shows after got.

  2. If the page is wrong, fix the page: the error it shows, or the change that took the text away.

  3. If the page is right and the rule is out of date, edit the monitor’s response rules and change this rule’s text. Pick text that your server sends in the page itself, near its top, and that doesn’t change from visit to visit.

  4. Run step 2 again, then follow Confirm DownBad sees the fix.

A JSON rule picks one value out of a JSON response with a JSON path, such as $.status for the status field at the top, or $.data.items[0].id for the id of the first item in a list. The “valid JSON” rule only asks that the whole response is JSON.

In the wordings below, <path> is the rule’s JSON path, and <what it had> is the value found there, written as JSON: text in quotes, or a number, true, false, null, a list or an object. Text is compared with capital letters minding, unless the rule ends (ignoring case).

  • expected <path> to equal "<value>", expected <path> to contain "<value>" or expected <path> to match /<pattern>/, then got <what it had>: the value at the path is different from the one the rule wants. “Equals” compares the kind of value too, so the number 1 isn’t the text "1":

    Response rule 1 failed: expected $.count to equal "1", got 1
  • expected <path> to be present, got no value at <path>: nothing is at that path. A field may have been renamed or moved, or a list may be empty. A rule that wants a value gets the same got no value at <path>.

  • expected <path> to be absent, got <what it had>: there was a value at the path, and the rule says there mustn’t be. got shows it.

  • expected <path> not to equal "<value>" or expected <path> not to contain "<value>", then got <what it had>: the value at the path was exactly, or held, what the rule forbids, such as expected $.status not to equal "down", got "down". The rule did its job: your app reported the state the rule watches for.

  • expected the body to be valid JSON, got the body is not valid JSON (…), or any JSON rule that got the body is not valid JSON (…): the response isn’t JSON, often because an error page or a sign-in page came back in its place. Step 3 of Check it yourself shows what came back.

  • got the body is longer than the 1 MB a check reads, so it could not be read as JSON: DownBad reads the first megabyte of a response, and a JSON response cut off there can’t be read.

  • got the JSON path <path> cannot be read; use dots and brackets such as $.data.items[0].status: the path uses something DownBad’s paths don’t support. A path starts with $ and then uses only .name, ['name'] and [0]; wildcards such as [*], filters and .. aren’t supported.

  • got a response nested too deeply to read: the JSON has lists or objects inside each other so many levels deep that DownBad can’t read it. A normal response is never like this, so check what the address sends.

  • got the pattern cannot be used (…): see DownBad won’t save the changed rule.

  • got a response this rule could not read (…): DownBad couldn’t apply the rule to the answer, which points to a rule stored in a form DownBad can’t use. Remove the rule and add it again. If it comes back, send us the reason as Still stuck says.

  1. Run step 3 of Check it yourself and find the value the rule’s path points at.

  2. If the response is wrong, fix the app that sends it.

  3. If the response is right and the rule isn’t, edit the monitor’s response rules and change this one: its path, its value, or the kind of value it compares (a number or text). For a response over 1 MB, point the monitor at a smaller address, such as a health-check address that returns only a status.

  4. Run step 3 again, then follow Confirm DownBad sees the fix.

Two things stop DownBad saving a change to a monitor’s rules. Each shows a message when you save.

The pattern can’t be used. DownBad runs regular expressions with RE2, which has no lookahead, lookbehind or backreferences, such as (?=…), (?<=…) or \1. The message reads:

Assertion rule 1 has a regular expression that cannot be used. Patterns run on RE2, which does not support lookahead, lookbehind or backreferences such as \1; rewrite the pattern without them.

If a rule that’s already saved has such a pattern, it fails every check with got the pattern cannot be used (…). Rewrite the pattern without those parts, or use a “contains” rule instead.

Response rules need a paid plan. On a plan without them, saving new or changed rules is refused with:

Response assertions need a paid plan, so this monitor was not saved. Upgrade your plan on the Account page (/backstage/account#plan) to use them, or remove the assertion rules and save again.

You can still change the monitor’s other settings while its rules stay as they are. To change a rule, upgrade your plan on the Account page first, or remove the rules and save.

  1. Fix the cause first. A check that still fails while you work only adds to the time the incident takes to close.

  2. Open the incident and press Test Now. DownBad checks again within a few seconds instead of waiting for the next scheduled check.

  3. Wait a minute, then reload the incident page, which doesn’t update by itself. The incident closes by itself once enough checks in a row pass. You can’t close an incident by hand.

How many passing checks it takes. While an incident is open, DownBad checks less often after repeated failures. This is called back-off. Each failed check adds one step of back-off, up to 14. Each passing check takes one step away and asks for the next check straight away. When no steps are left, one more passing check closes the incident. So after a steady outage it takes one more passing check than there were failed checks while the incident was open, counting the one that opened it, and never more than 15.

These are the defaults. The monitor’s notification profile can change them for each monitor type under Backoff Config, and its settings are the ones that count: Recovery is how many passing checks in a row, with no back-off left, close the incident (2 by default, counting the check that takes the last step away), and Start after, Rate and Max interval decide when back-off starts and how far it goes. If the profile changes them, the step counts above and the waits below change with them.

How long that takes. After you press Test Now, those passing checks run back to back, a few seconds apart, so the incident usually closes within a minute. It takes longer when checks are slow to finish, such as a page that takes several seconds to load.

If you don’t press Test Now, the first passing check waits for the next scheduled one. With the default settings, from the third failed check on, DownBad waits 5 more minutes for each failure, up to an hour more than the monitor’s usual interval:

Monitor checks everyAfter 1 or 2 failed checksAfter 3After 6After 14 or more
1 minute1 minute6 minutes21 minutes61 minutes
5 minutes5 minutes10 minutes25 minutes65 minutes
1 hour1 hour1 hour 5 minutes1 hour 20 minutes2 hours
1 day1 day1 day 5 minutes1 day 20 minutes1 day 1 hour

Before you ask for help, collect:

  • the link to the incident, and the reason it shows, word for word
  • the monitor’s rules as you set them
  • the output of the commands in Check it yourself, and when you ran them
  • the name of any service in front of your site, such as a CDN

Then send all of it to us through Contact Us.