t8y2/dbx · error · IllegalArgumentException
Procedure not found: {name}
Error message
Procedure not found: {name} What it means
DatabendAgent.getObjectSource located no procedure matching the given name in the target schema, so it throws IllegalArgumentException before attempting to describe or build the source. The library treats a missing procedure as a caller error rather than returning an empty ObjectSource.
Source
Thrown at agents/drivers/databend/src/main/java/com/dbx/agent/databend/DatabendAgent.java:88
if (includeTables && !includeProcedures) {
return super.listObjects(schema, normalized);
}
if (!includeTables && !includeProcedures) {
return List.of();
}
return normalized.filterObjects(listObjects(schema));
}
@Override
public ObjectSource getObjectSource(String schema, String name, String objectType) {
if (!"PROCEDURE".equalsIgnoreCase(objectType)) {
return super.getObjectSource(schema, name, objectType);
}
return unchecked(() -> {
useSchema(schema);
ProcedureMetadata procedure = findProcedure(name);
if (procedure == null) {
throw new IllegalArgumentException("Procedure not found: " + name);
}
Map<String, String> properties = describeProcedure(name, procedure.inputTypes);
String source = buildProcedureSource(name, procedure, properties);
return new ObjectSource(name, objectType, schema, source);
});
}
private void useSchema(String schema) throws SQLException {
if (schema == null || schema.trim().isEmpty()) {
return;
}
try (java.sql.Statement stmt = requireConnected().createStatement()) {
stmt.execute(DATABEND_PROFILE.schemaSwitchSql(schema.trim()));
}
}
private List<ObjectInfo> listProcedures(String schema, MetadataListConstraints constraints) {
return unchecked(() -> {View on GitHub (pinned to c0390bff16)
Solutions
- Verify the procedure exists in the schema: run SHOW PROCEDURES IN <schema> or query information_schema for the procedure name.
- Match the identifier casing exactly as created (quote with backticks if it contains mixed case).
- Confirm the schema passed to useSchema is the schema where the procedure was created.
- Check you are connected to the correct Databend tenant/database.
Example fix
// before agent.getObjectSource(conn, "analytics", "daily_rollup", "PROCEDURE"); // after // verify first: SHOW PROCEDURES IN analytics LIKE 'daily_rollup'; agent.getObjectSource(conn, "analytics", "daily_rollup", "PROCEDURE");
Defensive patterns
Strategy: validation
Validate before calling
// Java (caller side)
try (var stmt = conn.createStatement();
var rs = stmt.executeQuery("SHOW PROCEDURES IN `" + schema + "`")) {
boolean found = false;
while (rs.next()) {
if (name.equals(rs.getString("name"))) { found = true; break; }
}
if (!found) throw new IllegalArgumentException("Procedure missing in schema: " + schema + "." + name);
}
ObjectSource src = agent.getObjectSource(conn, schema, name, "PROCEDURE"); Try / catch
try {
src = agent.getObjectSource(conn, schema, name, "PROCEDURE");
} catch (IllegalArgumentException e) {
if (e.getMessage() != null && e.getMessage().startsWith("Procedure not found")) {
LOG.warn("Databend procedure {}.{} not found; skipping", schema, name);
} else { throw e; }
} Prevention
- Confirm procedure existence (SHOW PROCEDURES / information_schema) before requesting its source.
- Match identifier casing exactly as created; use backticks for mixed-case names.
- Keep a record of procedures deployed per schema and validate names against it.
- Fail fast in CI by listing expected procedures and diffing against the live database.
When it happens
Trigger: Calling getObjectSource(schema, name, objectType) for a procedure-type object where findProcedure(name) returns null after searching Databend's procedure metadata (e.g. SHOW PROCEDURES / information_schema).
Common situations: Procedure name typo or wrong case (Databend identifiers may be case-sensitive depending on quoting); procedure created in a different schema; procedure dropped or never created; connected to a database that doesn't contain the schema.
Related errors
- Object source is not supported
- Object source is not supported
- Object source is not supported
- Unsupported object type: {objectType}
- Table not found: {schema}.{table}
AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05).
Data as JSON: /api/errors/590b186ed3c49858.
Report an issue: GitHub.