{"record":{"id":"559b8ce4b4d416dc","repo":"windmill-labs/windmill","slug":"unknown-replication-message-byte","errorCode":null,"errorMessage":"unknown replication message byte `{}`","messagePattern":"unknown replication message byte `(.+?)`","errorType":"exception","errorClass":"ConversionError::Io (InvalidInput)","httpStatus":null,"severity":"error","filePath":"backend/windmill-trigger-postgres/src/replication_message.rs","lineNumber":192,"sourceCode":"        for _ in 0..number_of_columns {\n            let byte = buf.read_u8()?;\n            let tuple_data = match byte {\n                TUPLE_DATA_NULL_BYTE => TupleData::Null,\n                TUPLE_DATA_TOAST_BYTE => TupleData::UnchangedToast,\n                TUPLE_DATA_TEXT_BYTE => {\n                    let len = buf.read_i32::<BigEndian>()?;\n                    let mut data = vec![0; len as usize];\n                    buf.read_exact(&mut data)?;\n                    TupleData::Text(data.into())\n                }\n                TUPLE_DATA_BINARY_BYTE => {\n                    let len = buf.read_i32::<BigEndian>()?;\n                    let mut data = vec![0; len as usize];\n                    buf.read_exact(&mut data)?;\n                    TupleData::Binary(data.into())\n                }\n                byte => {\n                    return Err(ConversionError::Io(io::Error::new(\n                        io::ErrorKind::InvalidInput,\n                        format!(\"unknown replication message byte `{}`\", byte),\n                    )));\n                }\n            };\n\n            tuples.push(tuple_data);\n        }\n\n        Ok(tuples)\n    }\n}\n\n#[derive(Debug)]\npub enum TransactionBody {\n    Insert(InsertBody),\n    Update(UpdateBody),\n    Delete(DeleteBody),","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/windmill-trigger-postgres/src/replication_message.rs#L174-L210","documentation":"The Postgres logical-replication message parser dispatches on a leading byte identifying the message/tuple-data type. When it encounters a byte it has no match arm for, it raises InvalidInput 'unknown replication message byte `{}`'. This indicates the stream contains a message type this parser doesn't implement (or the stream is misaligned/corrupt).","triggerScenarios":"Postgres sends a logical replication message type (or TupleData sub-message byte) not covered by the parser's match — e.g. a newer Postgres version emitting unsupported message kinds, or the buffer being read at a wrong offset after a partial/failed parse.","commonSituations":"Upgrading the Postgres server to a version emitting new replication message types; parsing a pgoutput stream with a plugin/format mismatch; corrupted or misaligned replication slot stream after a previous parse error.","solutions":["Check which byte value was reported and compare against the pgoutput protocol to identify the unhandled message type.","Upgrade the windmill-trigger-postgres parser (or Windmill itself) to a version supporting that message type.","Drop and recreate the replication slot/publication so the stream restarts aligned.","Verify wal_level=logical and the pgoutput protocol options match what the parser expects."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match parse(msg_bytes) {\n    Err(ConversionError::Io(e)) if e.to_string().contains(\"unknown replication message byte\") => {\n        tracing::warn!(\"unsupported pgoutput message: {e}; skipping and resyncing slot\");\n        // recreate slot or upgrade parser\n    }\n    Ok(msg) => handle(msg),\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Keep Windmill's postgres trigger code in sync with your Postgres server version","Verify wal_level=logical and pgoutput protocol options before enabling replication","Recreate replication slots after Postgres major upgrades","Log unknown bytes with context to identify unsupported message types quickly"],"tags":["postgres","replication","protocol","parsing"],"backgroundTag":"unknown-protocol-message-type","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}