{"record":{"id":"94c96f4d904fc158","repo":"sqlmapproject/sqlmap","slug":"backend-message-too-large-d-bytes","errorCode":null,"errorMessage":"backend message too large (%d bytes)","messagePattern":"backend message too large \\((.+?) bytes\\)","errorType":"exception","errorClass":"InterfaceError","httpStatus":null,"severity":"error","filePath":"extra/dbwire/monetdb.py","lineNumber":43,"sourceCode":"from extra.dbwire import connection_lost\nfrom extra.dbwire import handshake_done\nfrom extra.dbwire import keepalive\nfrom extra.dbwire import recvn\nfrom extra.dbwire import ProgrammingError\n\n_MAX_BLOCK = 0xffff >> 1\n_MAX_MESSAGE_LENGTH = 0x40000000  # cap on a (re-assembled) response, to bound a hostile/corrupt stream\n\ndef _getblock(sock):\n    # the block length is a 15-bit field, so bounding IT is pointless - a peer that never sets the last-flag\n    # simply streams blocks forever. Bound the accumulated response instead (as the other wire modules do).\n    chunks, total = [], 0\n    while True:\n        (header,) = struct.unpack(\"<H\", recvn(sock, 2))\n        length, last = header >> 1, header & 1\n        total += length\n        if total > _MAX_MESSAGE_LENGTH:\n            raise InterfaceError(\"backend message too large (%d bytes)\" % total)\n        chunks.append(recvn(sock, length))\n        if last:\n            break\n    return b\"\".join(chunks).decode(\"utf-8\", \"replace\")\n\ndef _putblock(sock, text):\n    data = text.encode(\"utf-8\")\n    off = 0\n    while True:\n        chunk = data[off:off + _MAX_BLOCK]\n        off += _MAX_BLOCK\n        last = off >= len(data)\n        try:\n            sock.sendall(struct.pack(\"<H\", (len(chunk) << 1) | (1 if last else 0)) + chunk)\n        except (socket.error, OSError) as ex:\n            raise connection_lost(ex)\n        if last:\n            break","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/sqlmapproject/sqlmap/blob/0a35b20e3953d341be6c7ac75ccb0b3362540c8d/extra/dbwire/monetdb.py#L25-L61","documentation":"Error \"backend message too large (%d bytes)\" thrown in sqlmapproject/sqlmap.","triggerScenarios":"Thrown at extra/dbwire/monetdb.py:43 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0a35b20e3953d341be6c7ac75ccb0b3362540c8d","analyzedAt":"2026-08-26T23:02:52.002Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}