odysseus-dev/odysseus · error · HTTPException

Signature PNG is empty

Error message

Signature PNG is empty

What it means

Error "Signature PNG is empty" thrown in odysseus-dev/odysseus.

Source

Thrown at routes/signature_routes.py:48


def _normalize_signature_png(raw: str) -> str:
    raw = (raw or "").strip()
    m = _DATA_URL_RE.match(raw)
    if m:
        b64 = m.group("data")
    elif _ANY_IMAGE_DATA_URL_RE.match(raw):
        raise HTTPException(400, "Signature data must be a PNG image")
    else:
        b64 = raw
    if len(b64) > _MAX_SIGNATURE_B64:
        raise HTTPException(400, "Signature PNG is too large")
    try:
        payload = base64.b64decode(b64, validate=True)
    except Exception:
        raise HTTPException(400, "Signature data must be base64-encoded PNG bytes")
    if not payload:
        raise HTTPException(400, "Signature PNG is empty")
    if len(payload) > _MAX_SIGNATURE_BYTES:
        raise HTTPException(400, "Signature PNG is too large")
    if not payload.startswith(_PNG_MAGIC):
        raise HTTPException(400, "Signature data must be a PNG image")
    return base64.b64encode(payload).decode("ascii")


def _signature_dimension(value: Optional[int]) -> Optional[int]:
    if value is None:
        return None
    if not isinstance(value, int) or value < 1 or value > _MAX_SIGNATURE_DIMENSION:
        raise HTTPException(400, "Signature dimensions are invalid")
    return value


class SignatureCreate(BaseModel):
    name: Optional[str] = None
    data: str  # base64 PNG, with or without `data:image/png;base64,` prefix

View on GitHub (pinned to f9235ebbf1)

Solutions

  1. Draw a signature before saving; the canvas was empty.
  2. Verify the captured PNG contains image data.

When it happens

Trigger: Triggered when the corresponding server-side validation or runtime check at the recorded location rejects the request or operation and returns this error message to the caller.

Common situations: See trigger scenarios.


AI-assisted analysis of odysseus-dev/odysseus@f9235ebbf1 (2026-08-14). Data as JSON: /api/errors/7b593cffa48751f8. Report an issue: GitHub.