sqlmapproject/sqlmap · error · ValueError

frame type and flags must fit in one octet

Error message

frame type and flags must fit in one octet

What it means

Error "frame type and flags must fit in one octet" thrown in sqlmapproject/sqlmap.

Source

Thrown at lib/request/http2.py:268

def _as_bytes(value):
    if isinstance(value, bytes):
        return value
    if isinstance(value, bytearray):
        return bytes(value)
    if isinstance(value, text_type):
        return value.encode("latin-1")
    raise TypeError("expected bytes/text value, got %s" % type(value).__name__)


def encode_frame(ftype, flags, stream_id, payload=b""):
    """Serialize an HTTP/2 frame.

    >>> decode_frame_header(encode_frame(HEADERS, FLAG_END_HEADERS, 1, b'abc')[:9])
    (3, 1, 4, 1)
    """
    payload = _as_bytes(payload)
    if not (0 <= ftype <= 0xff and 0 <= flags <= 0xff):
        raise ValueError("frame type and flags must fit in one octet")
    if not (0 <= stream_id <= MAX_STREAM_ID):
        raise ValueError("stream id must be between 0 and 2^31-1")
    if len(payload) > MAX_FRAME_SIZE:
        raise ValueError("frame payload exceeds 24-bit length")
    header = struct.pack("!I", len(payload))[1:]
    header += struct.pack("!BBI", ftype, flags, stream_id)
    return header + payload


def decode_frame_header(nine):
    """Parse a 9-byte frame header into (length, type, flags, stream_id).

    >>> decode_frame_header(encode_frame(DATA, 0, 1, b'')[:9])
    (0, 0, 0, 1)
    """
    if len(nine) != 9:
        raise ValueError("frame header must be exactly 9 bytes")
    length = struct.unpack("!I", b"\x00" + nine[:3])[0]

View on GitHub (pinned to 0a35b20e39)

When it happens

Trigger: Thrown at lib/request/http2.py:268 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sqlmapproject/sqlmap@0a35b20e39 (2026-08-26). Data as JSON: /api/errors/a5c49f3cb7e0ad77. Report an issue: GitHub.