louislam/uptime-kuma · error · Error
Query result did not meet the specified conditions (${result
Error message
Query result did not meet the specified conditions (${result}) What it means
Thrown by OracledbMonitorType.check when conditions are configured and the single-value result does not satisfy evaluateExpressionGroup({result: String(result)}). Same semantics as the MSSQL/MySQL variants: the only exposed variable is 'result', stringified before the condition evaluates.
Source
Thrown at server/monitor-types/oracledb.js:42
const conditions = monitor.conditions ? ConditionExpressionGroup.fromMonitor(monitor) : null;
const hasConditions = conditions && conditions.children && conditions.children.length > 0;
const startTime = dayjs().valueOf();
try {
if (hasConditions) {
const result = await this.oracledbQuerySingleValue(
monitor.databaseConnectionString,
query,
monitor.basic_auth_user,
monitor.basic_auth_pass
);
heartbeat.ping = dayjs().valueOf() - startTime;
const conditionsResult = evaluateExpressionGroup(conditions, { result: String(result) });
if (!conditionsResult) {
throw new Error(`Query result did not meet the specified conditions (${result})`);
}
heartbeat.status = UP;
heartbeat.msg = "Query did meet specified conditions";
} else {
const result = await this.oracledbQuery(
monitor.databaseConnectionString,
query,
monitor.basic_auth_user,
monitor.basic_auth_pass
);
heartbeat.ping = dayjs().valueOf() - startTime;
heartbeat.status = UP;
heartbeat.msg = result;
}
} catch (error) {
heartbeat.ping = dayjs().valueOf() - startTime;
if (error.message.includes("did not meet the specified conditions")) {View on GitHub (pinned to 6b5ea01557)
Solutions
- Run the query in SQL Developer/SQLcl with the same user and NLS, and inspect the value's string form.
- Cast explicitly: TO_CHAR(col), CAST(col AS NUMBER), or ROUND(col,n) so the output is deterministic and NLS-independent.
- Use TO_CHAR(datecol,'YYYY-MM-DD HH24:MI:SS') for dates instead of relying on NLS_DATE_FORMAT.
- Reference only the 'result' variable; prefer numeric range operators over '==' for numbers.
Example fix
-- before: SELECT last_sync FROM config; (NLS-formatted DATE) -- after: SELECT TO_CHAR(last_sync,'YYYY-MM-DD HH24:MI:SS') FROM config;
Defensive patterns
Strategy: try-catch
Validate before calling
const scalar = await oracleMonitor.oracledbQuerySingleValue(connStr, query, user, pass);
const ok = evaluateExpressionGroup(group, { result: String(scalar) }); Type guard
function conditionUsesResultVar(group) { return group.children.every(c => c.variable === 'result'); } Try / catch
try { await oracleMonitor.check(monitor, heartbeat, server); }
catch (e) { if (/did not meet the specified conditions/.test(e.message)) { heartbeat.status = DOWN; heartbeat.msg = e.message; } else throw e; } Prevention
- Cast/TO_CHAR in SQL so the value is NLS-independent (TO_CHAR(date,'YYYY-MM-DD HH24:MI:SS'), ROUND).
- Reference only 'result'; use numeric range operators for NUMBER columns.
- Beware NLS decimal/date formatting and CLOB streaming in single-value mode.
When it happens
Trigger: monitor.conditions has children, oracledbQuerySingleValue returns a scalar, and evaluateExpressionGroup over {result: String(result)} is false. Oracle-specific gotchas: NUMBER stringification, NLS date/decimal formatting, CLOB returned as a stream object, and case-sensitive column naming.
Common situations: NUMBER column returning '12,34' under a European NLS; DATE formatted by NLS_DATE_FORMAT; CLOB not converted to string; condition references the wrong variable; condition literal doesn't match Oracle's coercion.
Related errors
- Database connection/query failed: ${error.message}
- Query result did not meet the specified conditions (${result
- Query result did not meet the specified conditions (${result
- Query returned no results
- Multiple values were found, expected only one value
AI-assisted analysis of louislam/uptime-kuma@6b5ea01557 (2026-08-12).
Data as JSON: /api/errors/46afe16544a5eb27.
Report an issue: GitHub.