t8y2/dbx · error · IllegalArgumentException
View source not found: " + name
Error message
View source not found: " + name
What it means
Gbase8sAgent.viewSource fetches a view's definition text; when the backing query returns no row (the view does not exist or the owner/schema does not match), it throws RuntimeException('View source not found: ' + name). The message template shown in the region confirms the name is appended.
Source
Thrown at agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:510
private String tableType(String schema, String table) {
try {
String owner = trim(schema);
List<Object> args = new ArrayList<>();
args.add(table);
StringBuilder sql = new StringBuilder("SELECT tabtype FROM systables WHERE tabid >= 100 AND tabname = ?");
if (!owner.isEmpty()) {
sql.append(" AND owner = ?");
args.add(owner);
}
try (PreparedStatement stmt = requireConnection().prepareStatement(sql.toString())) {
bind(stmt, args);
try (ResultSet rs = stmt.executeQuery()) {
return rs.next() ? tableType(rs.getString("tabtype")) : "";
}
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
private String viewSource(String schema, String name) {
try {
String owner = trim(schema);
List<Object> args = new ArrayList<>();
args.add(name);
StringBuilder sql = new StringBuilder("""
SELECT v.viewtext
FROM sysviews v
JOIN systables t ON t.tabid = v.tabid
WHERE t.tabname = ?
""".stripIndent().trim());
if (!owner.isEmpty()) {
sql.append(" AND t.owner = ?");
args.add(owner);
}View on GitHub (pinned to c0390bff16)
Solutions
- Verify the view exists with the exact schema/owner and name (query systables/sysviews)
- Correct the schema/owner casing before calling
- Handle the RuntimeException and surface a 'view not found' message to the user
Example fix
// before
String src = agent.getObjectSource(schema, name, "VIEW").source();
// after
try {
String src = agent.getObjectSource(schema, name, "VIEW").source();
} catch (RuntimeException e) {
if (e.getMessage() != null && e.getMessage().startsWith("View source not found")) {
throw new NoSuchObjectException("View " + name + " does not exist in schema " + schema);
}
throw e;
} Defensive patterns
Strategy: try-catch
Validate before calling
// confirm the view exists before requesting source // SELECT tabtype FROM systables WHERE tabname = ? AND owner = ? -> expect 'V'
Type guard
static boolean viewExists(ResultSet rs) throws SQLException { return rs.next() && "V".equals(rs.getString("tabtype")); } Try / catch
try { src = agent.getObjectSource(schema, name, "VIEW"); } catch (RuntimeException e) { if (String.valueOf(e.getMessage()).startsWith("View source not found")) { throw new NoSuchObjectException(name); } throw e; } Prevention
- Verify schema/owner casing matches what is stored in the catalog
- Refresh cached object listings after DDL changes (drops/renames)
- Confirm you are connected to the database that actually contains the view
When it happens
Trigger: viewSource is called for a schema/name whose view row is absent from the system catalog (sysviews/systables), e.g. the view was dropped or the schema/owner casing is wrong.
Common situations: Stale catalog cache listing deleted views; case-sensitive Informix-style owner names not matching the stored owner; connecting to a different database than the one holding the view.
Related errors
- agent session not found: {id}
- Object source is not supported
- MongoDB collection '<sourceName>' was not found
- Object source not found
- ETCD_NOT_FOUND
AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05).
Data as JSON: /api/errors/dec47415a7f998ab.
Report an issue: GitHub.