OtterMind/Chat2DB · error · IllegalArgumentException

Invalid Oscar length unit: ${unit}

Error message

Invalid Oscar length unit: ${unit}

What it means

Error "Invalid Oscar length unit: ${unit}" thrown in OtterMind/Chat2DB.

Source

Thrown at chat2db-community-server/chat2db-community-plugins/chat2db-community-oscar/src/main/java/ai/chat2db/plugin/oscar/OscarSqlGuards.java:132

                    return false;
                }
                i = end;
            } else if (Character.isLetterOrDigit(c) || c == '_' || c == '$' || c == '.'
                    || c == ',' || Character.isWhitespace(c)) {
                i++;
            } else {
                return false;
            }
        }
        return false;
    }

    /**
     * Validates a CHAR/VARCHAR length unit (BYTE/CHAR) emitted verbatim into DDL.
     */
    public static String requireLengthUnit(String unit) {
        if (StringUtils.isBlank(unit)) {
            throw new IllegalArgumentException("Invalid Oscar length unit: " + unit);
        }
        String value = unit.trim();
        if ("BYTE".equalsIgnoreCase(value) || "CHAR".equalsIgnoreCase(value)) {
            return value;
        }
        throw new IllegalArgumentException("Invalid Oscar length unit: " + unit);
    }

    /**
     * Validates an index column sort order (ASC/DESC) emitted verbatim into DDL.
     */
    public static String requireSortOrder(String ascOrDesc) {
        if (StringUtils.isBlank(ascOrDesc)) {
            throw new IllegalArgumentException("Invalid Oscar sort order: " + ascOrDesc);
        }
        String value = ascOrDesc.trim();
        if ("ASC".equalsIgnoreCase(value) || "DESC".equalsIgnoreCase(value)) {
            return value;

View on GitHub (pinned to 5ee1e990e7)

Solutions

  1. Use a supported Oscar length unit for the column type, or omit the unit.

When it happens

Trigger: An Oscar column length used an unsupported unit.

Common situations: See trigger scenarios.


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