Troubleshooting Guide

<!--
SPDX-License-Identifier: Apache-2.0
SPDX-FileCopyrightText: 2026 ndaal Informationstechnik GmbH & Co KG, Cologne
SPDX-FileCopyrightText: Author: Pierre Gronau <Pierre.Gronau@ndaal.eu>
-->

# Troubleshooting Guide

Root-cause analysis and remediation for common failures. Each entry gives the
symptom, the cause and the fix.

## Quick reference

| Symptom                                  | Section below                             |
| ---------------------------------------- | ----------------------------------------- |
| The browser warns about the certificate  | The browser warns about the certificate   |
| The program exits at once with status 64 | A listen port is refused (exit status 64) |
| `error: cannot bind ...`                 | `error: cannot bind 127.0.0.1:8580`       |
| A file is rejected as INVALID            | An imported file is rejected as INVALID   |
| An upload fails (400, 403, 413 or 422)   | An upload is refused                      |
| `cross-check ...: N advisory issue(s)`   | `validate` reports advisory issues        |
| Export says "already exists"             | Export fails with "already exists"        |
| `--self-update` is refused               | Self-update is disabled by policy         |
| "Could not reach the update host"        | The update check cannot reach the host    |
| HTTP/3 does not work                     | HTTP/3 does not work in my client         |
| An Info page returns 404                 | An Info page returns 404                  |

## The browser warns about the certificate

**Cause:** The viewer mints a self-signed localhost certificate at every
start-up (valid for 45 days). **Remediation:** Expected: accept the warning once
per session, or front the viewer with a reverse proxy holding a CA-issued
certificate. The listener is TLS 1.3 only, so a client limited to older protocol
versions cannot connect at all.

## A listen port is refused (exit status 64)

**Symptom:** The program prints `error: invalid value '80' for '--port <PORT>'`
(or `error: SARIF_PORT: ...` when the value came from the variable), ends with
`accepted: 1025-65535`, and exits with status 64 before opening any port.
**Cause:** A listen port must be a plain decimal number in 1025-65535. What you
typed breaks that rule:

| You typed      | Why it is refused                                                   |
| -------------- | ------------------------------------------------------------------- |
| `80`, `1024`   | in the refused range 0-1024 (privileged ports, plus 1024 by policy) |
| `0`            | not a fixed port: the operating system would pick any free port     |
| `65536`        | a number above 65535 is not a TCP or UDP port                       |
| `08080`        | a leading zero (some tools read it as octal)                        |
| `+8080`        | a sign                                                              |
| `" 8080"`      | a space (surrounding whitespace is not trimmed)                     |
| `0x1f90`       | a radix prefix                                                      |
| `abc`, `8_080` | not a decimal number                                                |

**Remediation:** Use a port inside the range, written as plain digits. To serve
on 443, keep the viewer on an accepted port and put a reverse proxy on 443.
`echo $?` tells the failures apart: **64** is a refused port, **2** is any other
usage error (an unknown flag, a missing value), **1** is a runtime error such as
a port that is already in use. Releases before 1.1.14 accepted `1024`, `0`,
`08080` and `+8080`, and exited 2 for a bad number and 1 for `80`
(`Permission denied`); a script that tested `$? -eq 2` must now test for 64. One
spelling still exits 2: `--port -1` (a separate word starting with a dash is
read as a flag); `--port=-1` is refused as a port with status 64.

## `error: cannot bind 127.0.0.1:8580`

**Cause:** Another process holds the port, or a previous instance is still
running. **Remediation:** Stop the other process
(`pkill -f 'sarif-viewer serve'`) or pick another port with `--port` (or
`SARIF_PORT`). The HTTP/3 (QUIC) listener uses the UDP port one above the HTTPS
port by default; change it with `--quic-port`, or turn it off with `--no-quic`.

## An imported file is rejected as INVALID

**Cause:** The document does not conform to the SARIF schema. The most common
case is a producer that emits `null` for optional fields (for example
`tool.driver.organization`), which SARIF 2.1.0 forbids. **Remediation:** Inspect
the listed schema errors, strip the `null`-valued properties or fix the
producing tool, then re-import. `sarif-viewer validate <file>` prints the full
report and exits 1 when the file is invalid. A file that is not JSON at all is
reported as `is not valid JSON`; an unreadable path as `cannot read`.

## An upload is refused

The Upload page answers with the status that names the cause:

- **`422`** The file is valid JSON or text but not a SARIF log. The page shows
  why (for example `"runs" is a required property`); fix the file and upload it
  again, or run `sarif-viewer validate <file>` for the full report. Bytes that
  are not JSON at all are reported as `not valid JSON`.
- **`400`** The request was not a multipart form with exactly one non-empty file
  part. This is a script or proxy problem, not a SARIF problem: send the file
  in a field named `file`.
- **`403`** The request looks cross-site: `Sec-Fetch-Site` was not `same-origin`
  or `none`, or `Origin` did not equal the `Host`. A browser form on the
  viewer's own page always passes. Behind a reverse proxy, forward the original
  `Host` (nginx: `proxy_set_header Host $http_host;`) or a client that sends
  only `Origin` fails.
- **`413`** The body is over 64 MiB. A plain-text `request body rejected` comes
  from the viewer; an HTML error page comes from a reverse proxy in front of it,
  whose own limit is lower (nginx defaults to 1 MiB, `client_max_body_size`).

Uploading the same file name twice keeps both logs; the second gets a `-2`
suffix. Releases before 1.2.19 have no Upload page.

## `validate` reports advisory issues but the file is valid

**Symptom:** The output contains `cross-check (...): N advisory issue(s)` and
the exit code is 0. **Cause:** A document is validated against its own schema
(2.1.0 or 2.2) and then cross-checked against the other one. A cross-check
finding is advisory: it tells you the file would not also pass the other
version, and it does not make the file invalid. **Remediation:** None needed
unless you must support both versions. Fix the listed paths if you do.

## Export fails with "already exists"

**Cause:** An output file of the same name exists and overwrite was not
requested. **Remediation:** Enable **Overwrite existing files** (web) or pass
`--overwrite` (CLI), or remove the existing files.

An export of an invalid document writes nothing, by design: the schema gate runs
before any file is created. Fix the document first.

## Self-update is disabled by policy

**Symptom:**
`error: --self-update is disabled by policy (--no-self-update / SARIF_NO_SELF_UPDATE)`,
exit code 1. **Cause:** `--no-self-update` was passed or the
`SARIF_NO_SELF_UPDATE` environment variable is set to a true value (for example
in a package-managed or locked-down install). **Remediation:** Unset the
variable and run `--self-update` again, or update through your package manager
or a fresh download. `--check-update` is read-only and keeps working under the
policy.

## The update check cannot reach the host

**Symptom:**
`Could not reach the update host; leaving the current version unchanged.`
**Cause:** No route to `gitlab.com` (offline host, proxy, firewall).
**Remediation:** Nothing was changed. Check connectivity and any proxy settings,
then retry. The update download is checksum-verified before the running binary
is replaced, so a failed or tampered download leaves the installed version
untouched.

## HTTP/3 does not work in my client

**Cause:** HTTP/3 requires a QUIC-capable client; the system `curl` on some
platforms has no HTTP/3. Another cause: the listener is off because `--no-quic`
was given. **Remediation:** The HTTPS (TCP) listener on `--port` always works.
For HTTP/3 use a QUIC-capable client (a modern browser, or a `curl` built with
ngtcp2/nghttp3). The viewer advertises h3 via `Alt-Svc`, so browsers upgrade
automatically after the first visit; with `--no-quic` it neither binds UDP nor
advertises it.

Releases before 1.1.12 sent HTTP/3 responses without any security headers (no
Content-Security-Policy, no X-Frame-Options and so on). Update to 1.1.12 or
later if you serve over QUIC.

## An Info page returns 404

**Cause:** The Administrator Guide and User Guide moved in 1.1.14 from
`/administrator-guide` and `/user-guide` to `/administrator` and `/user`, to
match the ndaal Info menu. The old paths are not redirected. **Remediation:**
Update the bookmark or link. The Info menu always points at the current paths.

## The PDF export shows boxes instead of characters

**Cause:** A glyph outside the embedded Roboto subset. **Remediation:** The PDF
renderer maps common substitutes; report persistent cases to <security@ndaal.eu>
with the offending text.

## The build fails compiling aws-lc-rs

**Cause:** No C/assembler toolchain on the build host. **Remediation:** Install
a C compiler and a recent assembler (for example `nasm` on some platforms), then
rebuild.

## Nothing is persisted after restart

**Cause:** Loaded logs live in memory only; this is by design. **Remediation:**
Export the logs you need (artifacts are written to the export directory), or
pre-load them at start-up with `--import`.

## Getting more detail

Run with `RUST_LOG=debug` for verbose structured logs on stderr. The default
level is `info`.