Skip to main content

Troubleshooting

Rendered page shows a loading spinner​

The page is not fully loaded before PRISM captures the HTML.

Solutions:

  • Increase render.timeout_secs (the default of 10s is often too short for a heavy SPA).
  • Switch render.wait_for from "networkidle" to a selector that only appears once the page is fully rendered:
    [render]
    wait_for = "selector:#main-content"
    timeout_secs = 20
    wait_for is a single string. Valid values are "load", "domcontentloaded", "networkidle", "domidle", or "selector:<css-selector>" — anything else is rejected at startup.
  • If the page uses lazy loading, the content may never appear without scrolling. Use post_wait_js to trigger scroll or force-load the content.

Renders are incomplete​

A render is incomplete when PRISM extracted the page before it finished: the selector: never appeared, the network did not go quiet, or the wait ran into render.timeout_secs. The page is still served, so the symptom is a half-rendered page, not an error.

How to tell:

  • prism_render_incomplete_total{reason} counts them by reason (selector, network, timeout).
  • Each one logs a WARN with the URL and the reason: render is incomplete.

What to do:

  • selector: the selector is wrong, or the page never reaches that state. Check it against the rendered page.
  • network: at least one request stayed open for the whole five-second allowance, usually long polling or a chatty beacon. Use a selector: wait instead, or domidle to ignore the network.
  • timeout: raise render.timeout_secs, or wait on a selector.
  • To stop a half-rendered page being served from the cache for the full TTL, set render.incomplete_ttl_secs to a small number, or 0 to never store one.

Crawlers get the unrendered page with x-prism-fallback: left-origin​

The page's own JavaScript moved the browser to a different origin, for example a single sign-on or geo redirect, so what was rendered was not your page. PRISM serves the origin's own response and stores nothing. It logs a warning naming the URL and the origin the document went to (at most once a minute), and counts it in prism_render_left_origin_total.

Solutions:

  • Exclude the route from rendering.
  • If the other origin is this site's own public address, set server.public_base_url to it, and the document is accepted.

Empty page or content validation failure​

PRISM's content validation rejected the rendered HTML because it was too small.

Solutions:

  • Check the render.content_validation.min_html_bytes setting. If your pages are legitimately small, lower the threshold:
    [render.content_validation]
    min_html_bytes = 512
  • For testing, you can temporarily disable content validation:
    [render.content_validation]
    enabled = false
  • Check prism_content_validation_failures_total metric to see how often this occurs.
  • Use POST /render on the admin API to test a specific URL and inspect the result.

Chrome won't start​

PRISM cannot launch the headless Chrome process.

Solutions:

  • Verify Chrome or Chromium is installed and in your PATH:
    which google-chrome || which chromium-browser || which chromium
    If it is installed somewhere else, set CHROME_PATH to the full path of the executable. CHROME takes precedence over CHROME_PATH, and a CHROME_PATH that does not name an existing file is ignored with a warning in the log.
  • PRISM runs Chrome with the sandbox enabled and does not expose an option to pass extra browser flags. If Chrome fails to start with a sandbox error, the fix is to give it the namespaces it needs rather than to disable it:
    • Docker: run with --cap-add=SYS_ADMIN, or a seccomp profile that permits clone/unshare (see Docker deployment). The shipped images install the chromium-sandbox SUID helper.
    • systemd: the packaged unit allows exactly the user, pid and net namespaces Chrome's sandbox creates and filters system calls (RestrictNamespaces, SystemCallFilter). A local override that narrows either further, or a Chrome build that needs more, stops it starting; see systemd deployment.
    • Bare metal: ensure /proc/sys/kernel/unprivileged_userns_clone is 1 on distributions that gate it.
  • Check file permissions on the Chrome binary.
  • Ensure sufficient memory is available. Chrome requires at least 256 MB of free memory to start.
  • Check logs for the specific Chrome launch error message.

304 empty responses​

Chrome's internal cache returns a 304 Not Modified with no body when fetching the origin page, resulting in empty HTML being cached.

Fix: This was fixed in PRISM v1.0.0 by calling SetCacheDisabled on every new Chrome tab. If you are seeing this on v1.0.0+, check that your origin is not returning 304 responses to PRISM's proxy requests. PRISM strips conditional request headers (If-None-Match, If-Modified-Since) to prevent this, but a misconfigured origin or CDN in front of the origin could still cause it.


Render loop​

PRISM renders a page, which causes Chrome to fetch the page through PRISM, which triggers another render, creating an infinite loop.

Solutions:

  • PRISM uses an internal X-Prism-Bypass header with a random token to break the loop. This works automatically when Chrome connects through localhost.
  • If PRISM sits behind a reverse proxy (Nginx, Apache), the proxy must strip the X-Prism-Bypass header from external requests to prevent bypass forgery:
    # Nginx
    proxy_set_header X-Prism-Bypass "";
    # Apache
    RequestHeader unset X-Prism-Bypass
  • If Chrome is configured to access the origin through an external URL that routes through the reverse proxy, ensure the bypass header is preserved on the loopback path.

High memory usage​

The PRISM process or Chrome is consuming excessive memory.

Solutions:

  • Set a cache memory limit:
    [cache]
    max_memory_bytes = 536870912 # 512 MB
  • Reduce the number of renders per tab before recycling (prevents Chrome tab memory leaks):
    [render.pool]
    max_renders_per_tab = 50
  • Reduce the tab pool size:
    [render.pool]
    tabs = 4
  • Monitor process_resident_memory_bytes and prism_cache_memory_bytes metrics to understand where memory is going.
  • Chrome RSS grows over time even with tab recycling. If prism_chrome_restarts_total is zero and memory keeps growing, consider setting a lower max_renders_per_tab.

Every crawler request is a cache BYPASS​

Symptoms: x-prism-cache: BYPASS on every crawler request, prism_render_total rising with crawler traffic, and a warning in the log that a page carries Cache-Control: no-cache (or max-age=0, or an Age/Date older than its lifetime).

PRISM applies your origin's caching headers to its own render cache, and it cannot revalidate. A page served with no-cache or max-age=0 is therefore never stored, and each crawler request costs a Chrome render. This is common for single-page apps, which send those headers on index.html so browsers pick up a new deploy.

  1. Check what the origin sends: curl -sI https://your-origin/page | grep -i -E 'cache-control|age|date'.
  2. Check prism_cache_refusals_total{reason}. no_cache, max_age_zero and expired point at this cause. no_store and private do not: those are always honoured.
  3. If the header is meant for browsers, set cache.ignore_origin_no_cache = true, or set it on one [[cache.rules]] entry for the affected paths. See Cache configuration.
  4. If the page really must not be shared, fix the origin or leave it: no-store and private are never ignored.

Crawlers get 503 under load​

Under a crawl burst every tab can be busy. A request that waits longer than render.pool.queue_timeout_secs (default 45s) for a tab, or arrives when render.pool.queue_max requests are already waiting, is answered with a 503 and Retry-After. These refusals show as reason="queue_full" in prism_requests_rejected_total. They are not render timeouts, are not retried and do not count against the circuit breaker.

Solutions:

  • Add replicas, or raise render.pool.tabs if memory allows. See Capacity.
  • Lengthen cache TTLs and the grace period so fewer crawler hits need a render.
  • Raise queue_timeout_secs only if the crawler tolerates a slower answer: a longer wait holds the connection open.

After a Chrome crash PRISM restarts the browser and the circuit breaker, if it had opened, lets the next render through as a probe instead of refusing until recovery_timeout_secs has passed.


Rate limiting (429 responses)​

Requests are being rejected with HTTP 429 Too Many Requests. Since 1.4.7 the response carries Retry-After: 1: both limits are per second, so a second is how long a bucket takes to hold a token again.

Solutions:

  • Check the per-IP render budget. Both limits live under [security], and both are renders per second, not per minute:
    [security]
    rate_limit_per_ip = 3 # default 3
    rate_limit_per_domain = 10 # default 10
    A single CDN or reverse proxy in front of PRISM presents every visitor as one address, so the per-IP budget applies to your whole site unless server.trusted_proxies lists that edge — check that before raising anything.
  • Which budget is shedding is answerable: prism_rate_limited_total{limiter="ip"} versus {limiter="domain"}.
  • Monitor prism_rate_limit_rejections_total for the combined frequency.
  • If legitimate traffic is being rate-limited, increase the limits or ensure your load balancer distributes traffic across multiple PRISM instances.

SSRF blocked​

Requests to certain origins are being rejected by the security filter.

Solutions:

  • Check the allowed origins configuration:
    [security]
    allowed_origins = ["example.com", "staging.example.com"]
  • By default, PRISM blocks requests to private/internal CIDRs (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 127.0.0.0/8) to prevent SSRF attacks:
    [security]
    block_private_cidrs = true # default
  • If your origin is on a private network (Docker, Kubernetes), you do not need to disable this: the configured server.origin is exempt from the check by construction, which is why the shipped Docker and Kubernetes configs keep it on and still reach their origins. Turning it off lets a hostile origin page reach every other service on that network, including PRISM's own admin API — and a shipped-config test refuses any config that does. allowed_origins is a hostname restriction, not a private-address exemption. Serve required internal resources through the configured origin or redesign their network access; adding a private hostname to the allowlist does not grant access.

Venia mega menu not visible​

When rendering PWA Studio (Venia) storefronts, the mega menu is present in the DOM but hidden via CSS.

Solution: Use post_wait_js to remove the hidden class after rendering completes:

[render]
post_wait_js = """
document.querySelectorAll('.megaMenu-root_hidden').forEach(el => {
el.classList.remove('megaMenu-root_hidden');
});
"""

Hydration flash in render-all mode​

When using mode = "render-all", human visitors may briefly see the server-rendered HTML before the JavaScript framework hydrates and takes over. This can cause a visual "flash" where content shifts or changes.

This is expected behavior when render.postprocess.strip_scripts = false (an explicit opt-in; the default is true). The rendered HTML and the hydrated DOM may differ slightly because:

  • PRISM renders an anonymous version of the page (no cookies/auth forwarded to Chrome).
  • The client-side framework re-renders with the actual user's session state.

Mitigations:

  • Use mode = "bot-only" (the default) to only render for bots, avoiding the hydration flash for human visitors entirely.
  • If you must use render-all, keep render.postprocess.strip_scripts = true to prevent hydration, but be aware this disables all client-side interactivity.