apache/shardingsphere · error · FirebirdProtocolException

Unknown database information request type %d

Error message

Unknown database information request type %d

What it means

Thrown when a Firebird database information request asks for an item this return-packet writer does not handle. The switch covers a small set (including ODS_MINOR_VERSION and FIREBIRD_VERSION); any other isc_info_db_* item reaches the default branch and throws with the item's numeric code.

Source

Thrown at database/protocol/dialect/firebird/src/main/java/org/apache/shardingsphere/database/protocol/firebird/packet/command/query/info/type/database/FirebirdDatabaseInfoReturnPacket.java:101

            case ODS_VERSION:
                data.writeInt1(FirebirdDatabaseInfoPacketType.ODS_VERSION.getCode());
                data.writeInt2LE(4);
                data.writeInt4LE(MAJOR_VERSION);
                break;
            case ODS_MINOR_VERSION:
                data.writeInt1(FirebirdDatabaseInfoPacketType.ODS_MINOR_VERSION.getCode());
                data.writeInt2LE(4);
                data.writeInt4LE(MINOR_VERSION);
                break;
            case FIREBIRD_VERSION:
                data.writeInt1(FirebirdDatabaseInfoPacketType.FIREBIRD_VERSION.getCode());
                data.writeInt2LE(FB_VERSION.length() + 2);
                data.writeInt1(1);
                data.writeInt1(FB_VERSION.length());
                data.writeBytes(FB_VERSION.getBytes(StandardCharsets.UTF_8));
                break;
            default:
                throw new FirebirdProtocolException("Unknown database information request type %d", type.getCode());
        }
    }
}

View on GitHub (pinned to e952770a21)

Solutions

  1. Map the numeric code from the message to the isc_info_db_* constant to see which item the client wanted
  2. Limit client database-info requests to the items the proxy implements (ODS versions, Firebird version string)
  3. Implement the missing item in FirebirdDatabaseInfoReturnPacket following the writeInt1/writeInt2LE/writeInt4LE pattern and submit it upstream
  4. Disable the client feature that issues the unsupported info request (often a connection property or metadata probe)
Defensive patterns

Strategy: validation

Validate before calling

// whitelist the database info items you know the proxy implements before issuing isc_database_info
Set<Integer> implemented = Set.of(
        FirebirdDatabaseInfoPacketType.ODS_MINOR_VERSION.getCode(),
        FirebirdDatabaseInfoPacketType.FIREBIRD_VERSION.getCode()); // extend as coverage grows
requestItems.retainAll(implemented);

Try / catch

try {
    returnPacket.write(data);
} catch (FirebirdProtocolException ex) {
    // item code is in the message; drop that item from the request set and retry the remaining items
    log.warn("dropping unsupported db info item: {}", ex.getMessage());
}

Prevention

When it happens

Trigger: Issuing isc_database_info for items not in the implemented set of FirebirdDatabaseInfoReturnPacket (e.g. isc_info_page_size, isc_info_allocation, isc_info_oldest_transaction), hitting the default case in the switch.

Common situations: Connection setup or monitoring tools that probe page size, dialect, or transaction state; drivers whose feature detection queries several db info items in one call.

Related errors


AI-assisted analysis of apache/shardingsphere@e952770a21 (2026-08-14). Data as JSON: /api/errors/7460099b614f7fbb. Report an issue: GitHub.