{"record":{"id":"a8ac5fa5822fc1b9","repo":"risingwavelabs/risingwave","slug":"protocol-error-0","errorCode":null,"errorMessage":"Protocol error: {0}","messagePattern":"Protocol error: (.+?)","errorType":"error_code","errorClass":"ErrorCode","httpStatus":null,"severity":"error","filePath":"src/frontend/src/error.rs","lineNumber":141,"sourceCode":"        expr: String,\n        #[source]\n        #[backtrace]\n        error: BoxedError,\n    },\n    #[error(transparent)]\n    CastError(\n        #[from]\n        #[backtrace]\n        CastError,\n    ),\n    #[error(\"Catalog error: {0}\")]\n    CatalogError(\n        #[source]\n        #[backtrace]\n        #[message]\n        BoxedError,\n    ),\n    #[error(\"Protocol error: {0}\")]\n    ProtocolError(#[message] String),\n    #[error(\"Scheduler error: {0}\")]\n    SchedulerError(\n        #[source]\n        #[backtrace]\n        BoxedError,\n    ),\n    #[error(\"Task not found\")]\n    TaskNotFound,\n    #[error(\"Session not found\")]\n    SessionNotFound,\n    #[error(\"Invalid reference: {0}\")]\n    InvalidReference(String),\n    #[error(\"Item not found: {0}\")]\n    ItemNotFound(String),\n    #[error(\"Duplicate Relation Name: {0}\")]\n    DuplicateRelationName(String),\n    #[error(\"Invalid insert operation: {0}\")]","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/frontend/src/error.rs#L123-L159","documentation":"RisingWave frontend's ErrorCode::ProtocolError variant, rendered as \"Protocol error: {0}\". It signals a violation of the client-server protocol expectations (e.g. pgwire protocol or internal RPC message contracts) detected in the frontend layer. It carries a plain String message describing what was unexpected.","triggerScenarios":"Malformed or out-of-order pgwire wire messages from a client; a client sends an extended-protocol sequence the frontend does not expect; internal code explicitly calls ErrorCode::ProtocolError when a message/operation violates protocol assumptions.","commonSituations":"Buggy or very old client drivers speaking an unexpected Postgres protocol flow; proxies/middleware mangling wire traffic; mismatched driver/server version behavior.","solutions":["Identify the client library and version from the connection and upgrade the driver to a current release.","Remove any TCP proxy/middleware between client and RisingWave to test a direct connection.","Capture the client traffic and compare the protocol message sequence against the Postgres wire protocol spec.","Report the reproducing driver/version to RisingWave if a supported driver triggers it."],"exampleFix":"// before (very old driver)\npg = PG.connect(host: 'rw', dbname: 'dev') # old pg gem\n// after\n# upgrade driver: gem 'pg', '~> 1.5' then reconnect","handlingStrategy":"try-catch","validationCode":"// before connecting: check driver supports Postgres wire protocol v3\nassert(driver.protocolVersion >= 3);","typeGuard":null,"tryCatchPattern":"try { await conn.query(sql) } catch (e) {\n  if (/Protocol error/.test(e.message)) { reconnect(); }\n  else throw e;\n}","preventionTips":["Keep client drivers up to date.","Avoid custom TCP proxies in front of RisingWave unless they are protocol-aware.","Test new driver versions against a dev cluster before rollout."],"tags":["protocol","pgwire","risingwave","client-server"],"backgroundTag":"unexpected-response-shape","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}