louislam/uptime-kuma · error · Error
Database connection/query failed: ${error.message}
Error message
Database connection/query failed: ${error.message} What it means
Catch-all wrapper in OracledbMonitorType.check: any error whose message does NOT contain 'did not meet the specified conditions' is re-thrown as 'Database connection/query failed: <original>'. This wraps oracledb getConnection/connectivity errors, ORA- errors, TNS errors, and credential failures.
Source
Thrown at server/monitor-types/oracledb.js:63
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")) {
throw error;
}
throw new Error(`Database connection/query failed: ${error.message}`);
}
}
/**
* Run a query on Oracle Database.
* @param {string} connectionString The Oracle DB connection string
* @param {string} query The query to execute
* @param {string} username Oracle DB username
* @param {string} password Oracle DB password
* @returns {Promise<string>} Row count or execution message
*/
async oracledbQuery(connectionString, query, username, password) {
let connection;
try {
connection = await oracledb.getConnection({
connectString: connectionString.trim(),
user: username.trim(),
password: password.trim(),View on GitHub (pinned to 6b5ea01557)
Solutions
- Connect with sqlplus / SQLcl from the Uptime Kuma host using the identical connect string.
- For Thick mode, install Oracle Instant Client and set LD_LIBRARY_PATH; for Thin mode, ensure the connectString uses the host:port/service form.
- Verify wallet/TLS for Autonomous Database (connect_string points at tnsnames alias with tls config).
- Confirm the user can SELECT the target object (grant privileges, correct schema prefix).
- Check listener reachability on port 1521/1522 and firewall rules.
Example fix
// before: connectString='ORCL' (Thick mode, no Instant Client -> DPI-1047) // after (Thin mode, no client needed): connectString='10.0.0.5:1521/ORCLPDB1'
Defensive patterns
Strategy: retry
Validate before calling
function portOpen(host, port, ms=2000) { /* same TCP probe as MSSQL */ }
// Parse connectString host:port/service and probe 1521/1522 before relying on the monitor. Try / catch
async function withRetry(fn, retries=3, base=1000) {
for (let i=0;i<=retries;i++){ try { return await fn(); } catch(e){
if (/Database connection\/query failed/.test(e.message) && i<retries) await sleep(base*2**i); else throw e; } }
} Prevention
- Test the connect string with sqlplus/SQLcl from the Kuma host.
- Install Instant Client for Thick mode or use Thin host:port/service form.
- Configure wallet/TLS for Autonomous Database; verify listener port reachability.
- Wrap transient errors with bounded retry; alert on repeated failures.
When it happens
Trigger: oracledb.getConnection({connectString,user,password}) rejects (ORA-12154 TNS, ORA-12541 no listener, ORA-01017 invalid credentials, DPI-1080), connection.execute rejects (ORA-00942 table not found, ORA-00936 syntax), or the single-value validation errors fire. The substring guard forwards condition-mismatch messages unchanged.
Common situations: connectString format wrong for the installed mode (Thin vs Thick); tnsnames.ora missing/misconfigured; Oracle Instant Client not installed for Thick mode; wallet/TLS not configured for cloud Autonomous DB; wrong schema so objects are not visible; listener port 1521 blocked.
Related errors
- Query result did not meet the specified conditions (${result
- Database connection/query failed: ${error.message}
- Database connection/query failed: ${error.message}
- 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/f0fd637f6ed756bf.
Report an issue: GitHub.