{"record":{"id":"41391259ff3f8ab0","repo":"apache/shardingsphere","slug":"can-not-find-s-in-postgresql-identifier-tag-typ","errorCode":null,"errorMessage":"Can not find `%s` in PostgreSQL identifier tag type.","messagePattern":"Can not find `(.+?)` in PostgreSQL identifier tag type\\.","errorType":"exception","errorClass":"PostgreSQLProtocolException","httpStatus":null,"severity":"error","filePath":"database/protocol/dialect/postgresql/src/main/java/org/apache/shardingsphere/database/protocol/postgresql/packet/identifier/PostgreSQLMessagePacketType.java","lineNumber":108,"sourceCode":"    \n    PORTAL_SUSPENDED('s');\n    \n    private final char value;\n    \n    /**\n     * Value of integer.\n     *\n     * @param value integer value\n     * @return command packet type enum\n     * @throws PostgreSQLProtocolException PostgreSQL protocol exception\n     */\n    public static PostgreSQLMessagePacketType valueOf(final int value) {\n        for (PostgreSQLMessagePacketType each : values()) {\n            if (value == each.value) {\n                return each;\n            }\n        }\n        throw new PostgreSQLProtocolException(\"Can not find `%s` in PostgreSQL identifier tag type.\", value);\n    }\n}\n","sourceCodeStart":90,"sourceCodeEnd":111,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/database/protocol/dialect/postgresql/src/main/java/org/apache/shardingsphere/database/protocol/postgresql/packet/identifier/PostgreSQLMessagePacketType.java#L90-L111","documentation":"PostgreSQLMessagePacketType.valueOf(int) maps the leading byte of a backend/frontend message to a known packet type enum. An unrecognized value throws PostgreSQLProtocolException 'Can not find `%s` in PostgreSQL identifier tag type.', meaning the first byte of the message does not correspond to any known PostgreSQL command tag.","triggerScenarios":"The packet decoder reads a message tag byte that is not one of the enumerated tags — stream misalignment (reading a tag from the middle of a previous message), a truncated stream, or an unencrypted/SSL byte where a tag was expected (e.g. SSL negotiation handled incorrectly).","commonSituations":"Startup sequence handled out of order, SSLRequest vs regular startup confusion, earlier message length fields lying about payload size causing desync, or non-PostgreSQL clients connecting to the port.","solutions":["Verify the client is a real PostgreSQL-protocol client and connects with the correct startup sequence (including SSL negotiation)","Check earlier messages' length prefixes for correctness — a bad length desynchronizes the stream and surfaces here","Compare the failing byte value against the protocol spec to see which message the peer thought it was sending","Enable packet-level logging and test the same client against a vanilla PostgreSQL to isolate proxy-side desync"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"int tag = buffer.readByte() & 0xff;\nif (!PostgreSQLMessagePacketType.knownTags().contains(tag)) { /* drop connection, log tag */ }","typeGuard":null,"tryCatchPattern":"catch (PostgreSQLProtocolException e) { /* treat as protocol desync: close connection, do not retry on same stream */ }","preventionTips":["Handle SSLRequest/startup negotiation in the exact protocol order","Validate message length prefixes before consuming payloads","Reject non-PostgreSQL clients at startup handshake"],"tags":["postgresql","protocol","packet-type","stream-desync"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}