Skip to content

Cannot trace a failed request

Cannot trace a failed request

Symptom

An API call failed — possibly intermittently — and you cannot reproduce it on demand. Support needs a way to find the exact request in the server logs.

Likely causes

  1. Your client does not log the X-Request-Id header returned by every NovaVMS response.
  2. You captured the error message but not the header.
  3. The request was retried, so you have multiple request IDs for one logical call.

Fix

NovaVMS emits an X-Request-Id header on every response, including 2xx, 4xx, and 5xx. Log it unconditionally on the client side. When you open a support ticket, include the ID — support can pull the full server-side trace in seconds.

TypeScript / fetch

async function call(path: string, init?: RequestInit) {
const res = await fetch(`https://api.novalien.com${path}`, init);
const reqId = res.headers.get("x-request-id");
if (!res.ok) {
logger.error("novavms api failed", {
path,
status: res.status,
request_id: reqId,
});
}
return res;
}

Python / requests

import logging
import requests
def call(path: str, **kwargs) -> requests.Response:
res = requests.request(url=f"https://api.novalien.com{path}", **kwargs)
req_id = res.headers.get("x-request-id")
if not res.ok:
logging.error("novavms api failed",
extra={"path": path, "status": res.status_code, "request_id": req_id})
return res

Go / net/http

resp, err := http.DefaultClient.Do(req)
if err != nil {
return fmt.Errorf("novavms call: %w", err)
}
defer resp.Body.Close()
reqID := resp.Header.Get("X-Request-Id")
if resp.StatusCode >= 400 {
slog.Error("novavms api failed",
"path", req.URL.Path,
"status", resp.StatusCode,
"request_id", reqID)
}

curl

Terminal window
curl -D - https://api.novalien.com/events 2>&1 | grep -i x-request-id
# x-request-id: req_01HK3Z9YF7W7E8PM5QKT9DYXWR

Verify

  1. Your client logs include request_id on every failed call.
  2. Reproducing the failure yields a log line with a req_ ID.
  3. Pasting the ID into a support ticket lets support retrieve the server-side trace.

If none of this worked

  • If your response has no X-Request-Id, you are hitting a proxy that strips headers. Check your corporate egress proxy or CDN config.
  • See also: API error code reference.