usestrix/strix · error · RelayError

reverify

reverify

Error message

reverify

What it means

RelayError('reverify') raised by report_send() when POST /api/oss/report/send returns 401 — the verification token is missing, expired, or no longer accepted. Report delivery requires an active OTP verification; when the token has lapsed the caller must re-run the otp_start/otp_verify flow before retrying the send.

Source

Thrown at strix/interface/viewer/auth.py:243

    target: str,
) -> None:
    """Forward the encrypted PDF to the relay for delivery.

    The report password is NEVER part of this payload; only the encrypted PDF
    bytes travel to the relay.
    """
    payload = {
        "token": token,
        "pdf_base64": base64.b64encode(pdf_bytes).decode("ascii"),
        "filename": filename,
        "run_name": run_name,
        "target": target,
    }
    status, _ = _post_json("/api/oss/report/send", payload, timeout=_SEND_TIMEOUT)
    if status == 200:
        return
    if status == 401:
        raise RelayError("reverify")
    if status == 413:
        raise RelayError("too_large")
    if status == 403:
        raise RelayError("forbidden")
    raise RelayError("unavailable")


__all__ = [
    "AUTH_PATH",
    "RelayError",
    "feedback_submit",
    "forget",
    "is_verified",
    "otp_start",
    "otp_verify",
    "read_auth",
    "report_send",
    "write_auth",

View on GitHub (pinned to 8551339130)

Solutions

  1. Re-run verification before retrying: otp_start(email), then otp_verify(email, code), then report_send again
  2. Check is_verified() / token expiry before sending and proactively re-verify if close to expiry
  3. Regenerate the report if the run data changed in the meantime, then send under the fresh token
  4. Ensure system clock is correct (NTP) so tokens are not prematurely expired by skew

Example fix

# before
report_send(token, pdf, name, run, target)  # stale token -> reverify
# after
from strix.interface.viewer.auth import is_verified, otp_start, otp_verify
if not is_verified():
    otp_start(email); otp_verify(email, prompt_code())
report_send(fresh_token(), pdf, name, run, target)
Defensive patterns

Strategy: try-catch

Validate before calling

from strix.interface.viewer.auth import is_verified, read_auth, otp_start
import time

def needs_reverify() -> bool:
    auth = read_auth()
    return not is_verified() or auth is None

Try / catch

try:
    report_send(token, pdf, filename, run, target)
except RelayError as e:
    if e.code == "reverify":
        otp_start(email)
        otp_verify(email, prompt("code: "))
        report_send(fresh_token(), pdf, filename, run, target)
    else:
        raise

Prevention

When it happens

Trigger: Calling report_send(token, pdf, ...) with a token past its expires_at, one loaded from a stale on-disk auth file, or after the relay invalidated old tokens. The 401 maps to 'reverify' signalling the re-verification path specifically.

Common situations: User verified hours/days earlier and returns to send a report (token TTL elapsed); clock skew between client and relay expiring the token early; shared machine where another session overwrote the auth file; long report generation delay pushing send past expiry.

Related errors


AI-assisted analysis of usestrix/strix@8551339130 (2026-08-15). Data as JSON: /api/errors/40c04512be8d368b. Report an issue: GitHub.