---
title: Troubleshooting
description: "The failure modes people actually hit: what each one means, and the fix (including the ones that aren’t bugs)."
canonical_url: https://rebilder.com/docs/troubleshooting
last_updated: "2026-12-03"
---

# [Troubleshooting](https://rebilder.com/docs/troubleshooting)

> The failure modes people actually hit: what each one means, and the fix (including the ones that aren’t bugs).

This site answers questions directly. Ask at https://rebilder.com/ask?q=your+question instead of reading more pages.

- **Updated:** 2026-12-03
- **Author:** Rebilder
- **Section:** Reference
- **Description:** The failure modes people actually hit: what each one means, and the fix (including the ones that aren’t bugs).
- **Publisher:** Rebilder

## Rebilder at a glance

AEO gets you seen. Rebilder gets you heard. When customers ask ChatGPT about your business, your site answers with your real prices and policies.

**Common questions**

- **What does it cost?** Connecting is free. Starter is $49/mo, Pro is $99/mo and Agency is $299/mo. [Pricing](https://rebilder.com/pricing)
- **How does my site answer new questions live?** Rebilder reads your pages, products and policies. When an AI assistant asks, your site answers from them. Nothing on your site changes. [See how it works](https://rebilder.com/autopilot)
- **Can someone trick my site into a wrong price or a discount?** No. Every answer comes from your own pages and is checked against them. If your site does not say it, Rebilder does not say it. [Read security details](https://rebilder.com/security)

**How it compares**

- **Why choose Rebilder?** Choose Rebilder when you want your own site to answer AI assistants with your real facts, and to see who asked. [Compare](https://rebilder.com/compare)

| Compared with | The difference |
| --- | --- |
| Profound, Peec AI, Otterly.ai | These tools watch AI answers and tell you where you show up. Rebilder makes your own site answer when AI comes to check. |
| Cloudflare Markdown for Agents, @vercel/agent-readability, Yoast llms.txt | These tools tidy or map your pages for AI. Rebilder answers from those pages and shows you who asked. |
| Intercom Fin, Tidio Lyro | Chatbots answer the customers who contact you. Rebilder answers the AI assistants that visit your site for them. |
| SEO on its own, Shopify agentic storefronts, Writing an llms.txt yourself | Good SEO, your store platform and a simple llms.txt all help. Here is what Rebilder adds to each. |

Source: [Compare](https://rebilder.com/compare)

## Check your wiring locally

Two functions inspect your setup without fetching a website, calling a resolver, sending an event or reading a response body. Reports carry no source values.

check-gateway.ts

```ts
import { handleRequest, inspectGatewayConfig, inspectGatewayResponse } from '@rebilder/gateway'
import { gatewayConfig } from './gateway-config'

const wiring = inspectGatewayConfig(gatewayConfig)
console.table(wiring.checks)

// Use a public information page, not a transaction endpoint.
const request = new Request('https://your-site.example/services', {
  headers: { accept: 'text/markdown' },
})
const response = await handleRequest(request, gatewayConfig)
console.table(inspectGatewayResponse(response))
```

`inspectGatewayConfig(config).valid` means no configuration errors were found; it does not certify a live deployment. Every check has a stable `code`, a severity and a next step:

| Code | What to check next |
| --- | --- |
| `sources-missing` | Wire a public information resolver, unless this is deliberately a protocol-only integration. |
| `html-fallback` | Confirm the markdown `Accept` header, the URL mapping and the resolver result. Browser requests should fall through. |
| `not-markdown` | Check adapter placement: an earlier handler or cache may be serving HTML first. |
| `vary-accept-missing` | Keep `Vary: Accept` through your CDN so HTML and markdown do not share a cache entry. |
| `access-limited` | Inspect your [access policy](/docs/access-control) and retry allowance before changing source data. |
| `verification-not-configured` | Authenticate privileged protocol actions; the gateway being present is not authorization. |

## Only some pages serve markdown

Sources answer the pages you wired. Set `pages: true` and every other page gets a markdown copy made from the page your site already serves, with nothing to write per page. Keep your sources: they win for the pages they answer. In Next.js, widen `config.matcher` so the gateway sees every page. See [Automatic pages](/docs/pages).

## An agent gets HTML instead of markdown

Pass-through is the gateway’s default answer: it serves markdown only when the requester classifies as an agent *and* the page has a copy, from a source or from `pages`. Check in this order:

- **Is the path covered?** In Next.js, requests outside `config.matcher` never reach the gateway at all. Widen the matcher to include the URL.
- **Does the page have a copy?** With `pages` on, a page gets its copy from its own HTML. A page that fills in its content in the browser has nothing to copy: give it a source or render it on the server. In a container or on a hosting platform, set `pages.origin` to your site address so the server can read its own pages.
- **Did your source return data for that exact URL?** Resolvers get the request pathname verbatim, so a trailing slash, locale prefix, or rewritten path that your lookup doesn’t key on means `null`, and `null` means HTML. (On the Node adapter, sources see `originalUrl`, not a router-rewritten `url`.) Test the resolver directly with the failing pathname.
- **Did the requester actually classify as an agent?** Send the header yourself: `curl -si -H 'Accept: text/markdown' <url>`. If that returns markdown but your agent’s traffic doesn’t, the agent isn’t sending a negotiation signal. An unidentified agent with no markdown Accept (e.g. a bare `Signature` pair) deliberately gets HTML, because the gateway never guesses a format nobody asked for.
- **Is it a crawler?** Googlebot and bingbot get HTML **always**, even with `Accept: text/markdown`; that is the [cloaking guardrail](/docs/classification#the-googlebot-guardrail) working, not a bug.
- **Did the source throw?** A thrown source is contained as "no match" and the request passes through. The emitted event still fires, so check your event feed or logs.

For a stable reproduction, mount the [dedicated markdown route](/docs/adapters/nextjs#dedicated-markdown-route), which renders for any requester and returns 404 JSON when no source matches, which isolates source problems from classification problems.

## 401 from the events ingest

`401` means an unknown, revoked, or missing API key. The sink treats any 4xx as non-retryable: the batch is **dropped immediately** and reported through `onError`; serving is never affected, but those events are gone.

- **Rotated key?** Rotation invalidates the predecessor immediately. Update the deployed env with the new key from Console → Settings.
- **Missing `Authorization` header?** The sink sends `Authorization: Bearer <apiKey>`, so check the key actually reaches your config (an unset env var interpolates to an empty string).
- **Watch `onError`.** It fires for every dropped event and batch; wiring it to your logger is the difference between noticing in minutes and noticing never.

## Markdown is truncated

Output is capped at `maxBytes` (default **5120** bytes, UTF-8). Truncation is deliberate and bottom-up: description, attributes, and images go first, on whole lines only, with a fixed truncation note appended as the final line. The front-loaded facts and the variants table are never truncated, and if the facts alone exceed the budget, they are emitted anyway.

If agents need the full description, raise the budget in your config: `maxBytes: 8192`. Keep it modest: the small, front-loaded response *is* the product.

## Vercel / Next middleware matcher conflicts

Next.js allows **one** `proxy.ts` (or `middleware.ts`) per app. If you already have one (session refresh, authentication or redirects), don’t add a second; compose in the existing file: gateway first, your logic as the fallthrough.

proxy.ts: composing with existing middleware

```ts
import { createGatewayProxy } from '@rebilder/gateway/next'
import { gatewayConfig } from './lib/gateway-config'
import { updateSession } from './lib/session'

// Pass your existing middleware as the fallthrough so HTML responses carry negotiation headers.
const gateway = createGatewayProxy(gatewayConfig, (req) => updateSession(req))

export default gateway

// Union the matchers: your paths + the gateway's source paths.
export const config = { matcher: ['/products/:path*', '/policies/:path*', '/dashboard/:path*'] }
```

- The `matcher` must be the **union** of your existing middleware’s paths and the gateway’s source paths; the narrower of the two silently stops running otherwise.
- The gateway answers matching agent requests with markdown and calls your fallthrough with `Vary: Accept` and `Link` headers for everything else.
- Keep static assets (`/_next/`, images) out of the matcher; classifying them is wasted work.

## The scan says bot protection challenged it

The scanner recognises a CDN bot challenge served instead of the page (Cloudflare `cf-mitigated: challenge` or its challenge page, the Vercel Security Checkpoint, a DataDome or HUMAN block page) and reports the page as unscored rather than grading the challenge. AI agents are software too, so they are likely challenged the same way.

- Allow verified bots and the AI agents you want in the vendor’s bot settings, and check custom rules that challenge by bot score or User-Agent. Step-by-step: “Bot protection challenged the scan” in [Help](/help).
- Every scanner request identifies as Rebilder, so a firewall rule that targets one named agent is not visible to the scan. Review rules that match AI agent names or bot scores. The site report’s “Can it be found and fetched” group lists what robots.txt tells each AI agent.

## How Vary: Accept interacts with CDN caching

Markdown responses carry `Vary: Accept` because the **same URL** serves HTML to browsers and markdown to agents, so caches must key on the Accept header to stay correct. Two failure shapes when they don’t:

- **A CDN that ignores `Vary: Accept`** can cache the markdown response and serve it to browsers (or cache HTML and serve it to agents). If your CDN can’t vary on Accept, exclude the gateway’s matched paths from edge caching, or configure a cache key that includes whether the Accept header contains `text/markdown`.
- **A CDN that normalizes/strips Accept before your origin** prevents agents from negotiating at all: every request looks browserish and passes through. Check what Accept value actually reaches your server (log `request.accept` from the emitted events).

The [dedicated markdown route](/docs/adapters/nextjs#dedicated-markdown-route) sidesteps both: it is its own URL with a single representation, so any cache handles it correctly, making it a good permalink to hand to agent platforms.