{"record":{"id":"926cf21afc16f5e6","repo":"apache/shardingsphere","slug":"can-not-describe-portal-s-before-bind","errorCode":null,"errorMessage":"Can not describe portal `%s` before bind","messagePattern":"Can not describe portal `(.+?)` before bind","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"proxy/frontend/dialect/postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/Portal.java","lineNumber":128,"sourceCode":"     */\n    public void bind() throws SQLException {\n        responseHeader = proxyBackendHandler.execute();\n    }\n    \n    /**\n     * Describe portal.\n     *\n     * @return portal description packet\n     * @throws IllegalStateException illegal state exception\n     */\n    public PostgreSQLPacket describe() {\n        if (responseHeader instanceof QueryResponseHeader) {\n            return createRowDescriptionPacket((QueryResponseHeader) responseHeader);\n        }\n        if (responseHeader instanceof UpdateResponseHeader) {\n            return PostgreSQLNoDataPacket.getInstance();\n        }\n        throw new IllegalStateException(String.format(\"Can not describe portal `%s` before bind\", name));\n    }\n    \n    private PostgreSQLRowDescriptionPacket createRowDescriptionPacket(final QueryResponseHeader queryResponseHeader) {\n        return new PostgreSQLRowDescriptionPacket(createColumnDescriptions(queryResponseHeader));\n    }\n    \n    private Collection<PostgreSQLColumnDescription> createColumnDescriptions(final QueryResponseHeader queryResponseHeader) {\n        Collection<PostgreSQLColumnDescription> result = new LinkedList<>();\n        int columnIndex = 0;\n        for (QueryHeader each : queryResponseHeader.getQueryHeaders()) {\n            PostgreSQLValueFormat valueFormat = determineValueFormat(columnIndex);\n            int currentColumnIndex = ++columnIndex;\n            Integer typeOID = (Integer) each.getProtocolAttributes().get(PostgreSQLQueryHeaderBuilder.TYPE_OID);\n            result.add(PostgreSQLValueFormat.TEXT == valueFormat && null != typeOID\n                    ? new PostgreSQLColumnDescription(each.getColumnLabel(), currentColumnIndex, typeOID, each.getColumnLength(), valueFormat.getCode())\n                    : new PostgreSQLColumnDescription(each.getColumnLabel(), currentColumnIndex, each.getColumnType(), each.getColumnLength(), each.getColumnTypeName(), valueFormat.getCode()));\n        }\n        return result;","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/proxy/frontend/dialect/postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/Portal.java#L110-L146","documentation":"Error \"Can not describe portal `%s` before bind\" thrown in apache/shardingsphere.","triggerScenarios":"A Describe (portal) message arrives for a portal that has not been bound yet.","commonSituations":"Non-compliant clients or connection poolers skipping the Bind step of the extended query protocol.","solutions":["Issue a Bind for the portal before sending Describe.","Check the client driver sequence: Parse, Bind, then Describe/Execute.","Recreate the prepared statement and portal if the protocol state is lost."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}