t8y2/dbx · error · SQLException

Object source not found

Error message

Object source not found

What it means

Thrown by the object-source lookup for Hive/Inceptor catalog objects when the metadata query (SELECT ... FROM the vendor catalog view filtered by type, name and owner) returns no rows, meaning no source definition exists for the requested object. It is surfaced as a plain java.sql.SQLException with a user-facing message instead of a dedicated error code, so the RPC layer reports it as a generic query failure.

Source

Thrown at plugins/jdbc/src/main/java/app/dbx/jdbc/DbxJdbcPlugin.java:3967

        ArrayNode result = MAPPER.createArrayNode();
        indexes.values().forEach(result::add);
        return result;
    }

    private static JsonNode getObjectSource(JsonNode connection, String database, String schema, String name, String objectType)
        throws SQLException {
        Connection conn = openConnection(connection);
        if (driverQuirks(connection).useOracleMetadata()) {
            String owner = oracleEffectiveSchema(conn, schema);
            String metadataType = oracleMetadataObjectType(objectType);
            String sql = "SELECT DBMS_METADATA.GET_DDL(?, ?, ?) FROM DUAL";
            try (PreparedStatement ps = conn.prepareStatement(sql)) {
                ps.setString(1, metadataType);
                ps.setString(2, name);
                ps.setString(3, owner);
                try (ResultSet rs = ps.executeQuery()) {
                    if (!rs.next()) {
                        throw new SQLException("Object source not found");
                    }
                    ObjectNode item = MAPPER.createObjectNode();
                    item.put("name", name);
                    item.put("object_type", objectType);
                    putNullable(item, "schema", owner);
                    putNullable(item, "source", rs.getString(1));
                    return item;
                }
            }
        }

        if (isHive2RoutinesConnection(connection)) {
            String routineName = stripRoutineSignature(name);
            String normalizedType = normalizeObjectType(objectType);
            if ("VIEW".equals(normalizedType) || "TABLE".equals(normalizedType) || "MATERIALIZED_VIEW".equals(normalizedType)) {
                return hive2ShowCreateObjectSource(conn, database, schema, name, objectType);
            }

View on GitHub (pinned to c0390bff16)

Solutions

  1. Verify the object name and owner/schema exactly match an existing object (query SHOW TABLES / system catalog first)
  2. Re-run the browse/list RPC for the same database to get the authoritative name and owner
  3. Check you are connected to the correct database/catalog server
  4. If the object was intentionally dropped, refresh the client-side metadata cache

Example fix

// before
sourceOf(conn, "VIEW", "sales_agg", "public"); // throws if owner is actually "sales"
// after
sourceOf(conn, "VIEW", "sales_agg", "sales"); // match real owner from catalog listing
Defensive patterns

Strategy: validation

Validate before calling

boolean objectExists(java.sql.Connection c, String name, String owner) throws SQLException {
    try (PreparedStatement ps = c.prepareStatement(
            "SELECT 1 FROM <catalog_view> WHERE metadata_type = ? AND name = ? AND owner = ?")) {
        ps.setString(1, "VIEW"); ps.setString(2, name); ps.setString(3, owner);
        try (ResultSet rs = ps.executeQuery()) { return rs.next(); }
    }
}
// call the source RPC only if objectExists(...) is true

Type guard

boolean isPresent(ResultSet rs) throws SQLException { return rs.next(); }

Try / catch

try {
    JsonNode source = rpc.objectSource(name, owner, type);
} catch (SQLException e) {
    if ("Object source not found".equals(e.getMessage())) {
        // treat as absent object: refresh listing, skip, or surface friendly message
    } else throw e;
}

Prevention

When it happens

Trigger: Calling the object-source RPC for a VIEW/ROUTINE whose (metadataType, name, owner) tuple does not match any row in the catalog view: wrong object name, wrong owner/schema casing or value, or the object was dropped.

Common situations: Typos in the object name; querying a view that exists in a different database than the one passed as owner; stale client cache referencing a dropped object; case-sensitivity mismatch because the query compares exact values.

Related errors


AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05). Data as JSON: /api/errors/9029e5f90664f3fc. Report an issue: GitHub.