OtterMind/Chat2DB · error · IllegalArgumentException

Invalid Oracle index sort direction: {value}

Error message

Invalid Oracle index sort direction: {value}

What it means

Error "Invalid Oracle index sort direction: {value}" thrown in OtterMind/Chat2DB.

Source

Thrown at chat2db-community-server/chat2db-community-plugins/chat2db-community-oracle/src/main/java/ai/chat2db/plugin/oracle/OracleSqlGuards.java:74

    }

    public static String requireUnit(String unit) {
        String trimmed = StringUtils.trimToEmpty(unit);
        if (!"CHAR".equalsIgnoreCase(trimmed) && !"BYTE".equalsIgnoreCase(trimmed)) {
            throw new IllegalArgumentException("Unsupported Oracle VARCHAR unit: " + unit);
        }
        return trimmed;
    }

    public static String requireAscOrDesc(String value) {
        String trimmed = StringUtils.trimToEmpty(value);
        if ("ASC".equalsIgnoreCase(trimmed)) {
            return "ASC";
        }
        if ("DESC".equalsIgnoreCase(trimmed)) {
            return "DESC";
        }
        throw new IllegalArgumentException("Invalid Oracle index sort direction: " + value);
    }

    /**
     * Returns the raw hex digits represented by {@code value}. Non-hex input is
     * replaced with the caller-provided base16 encoding, which is verified too.
     */
    public static String normalizeHexLiteral(String value, String fallbackHex) {
        if (value == null) {
            return null;
        }
        String candidate = value.startsWith("0x") ? value.substring(2) : value;
        if (isHex(candidate)) {
            return candidate;
        }
        if (fallbackHex != null && isHex(fallbackHex)) {
            return fallbackHex;
        }
        throw new IllegalArgumentException("Invalid Oracle RAW/BLOB hex value");

View on GitHub (pinned to 5ee1e990e7)

Solutions

  1. Use ASC or DESC as the index column sort direction.

When it happens

Trigger: An Oracle index definition contained an unrecognized sort direction.

Common situations: See trigger scenarios.


AI-assisted analysis of OtterMind/Chat2DB@5ee1e990e7 (2026-08-14). Data as JSON: /api/errors/0babaa8388260166. Report an issue: GitHub.