{"record":{"id":"9029e5f90664f3fc","repo":"t8y2/dbx","slug":"object-source-not-found","errorCode":null,"errorMessage":"Object source not found","messagePattern":"Object source not found","errorType":"exception","errorClass":"SQLException","httpStatus":null,"severity":"error","filePath":"plugins/jdbc/src/main/java/app/dbx/jdbc/DbxJdbcPlugin.java","lineNumber":3967,"sourceCode":"        ArrayNode result = MAPPER.createArrayNode();\n        indexes.values().forEach(result::add);\n        return result;\n    }\n\n    private static JsonNode getObjectSource(JsonNode connection, String database, String schema, String name, String objectType)\n        throws SQLException {\n        Connection conn = openConnection(connection);\n        if (driverQuirks(connection).useOracleMetadata()) {\n            String owner = oracleEffectiveSchema(conn, schema);\n            String metadataType = oracleMetadataObjectType(objectType);\n            String sql = \"SELECT DBMS_METADATA.GET_DDL(?, ?, ?) FROM DUAL\";\n            try (PreparedStatement ps = conn.prepareStatement(sql)) {\n                ps.setString(1, metadataType);\n                ps.setString(2, name);\n                ps.setString(3, owner);\n                try (ResultSet rs = ps.executeQuery()) {\n                    if (!rs.next()) {\n                        throw new SQLException(\"Object source not found\");\n                    }\n                    ObjectNode item = MAPPER.createObjectNode();\n                    item.put(\"name\", name);\n                    item.put(\"object_type\", objectType);\n                    putNullable(item, \"schema\", owner);\n                    putNullable(item, \"source\", rs.getString(1));\n                    return item;\n                }\n            }\n        }\n\n        if (isHive2RoutinesConnection(connection)) {\n            String routineName = stripRoutineSignature(name);\n            String normalizedType = normalizeObjectType(objectType);\n            if (\"VIEW\".equals(normalizedType) || \"TABLE\".equals(normalizedType) || \"MATERIALIZED_VIEW\".equals(normalizedType)) {\n                return hive2ShowCreateObjectSource(conn, database, schema, name, objectType);\n            }\n","sourceCodeStart":3949,"sourceCodeEnd":3985,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/plugins/jdbc/src/main/java/app/dbx/jdbc/DbxJdbcPlugin.java#L3949-L3985","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the object name and owner/schema exactly match an existing object (query SHOW TABLES / system catalog first)","Re-run the browse/list RPC for the same database to get the authoritative name and owner","Check you are connected to the correct database/catalog server","If the object was intentionally dropped, refresh the client-side metadata cache"],"exampleFix":"// before\nsourceOf(conn, \"VIEW\", \"sales_agg\", \"public\"); // throws if owner is actually \"sales\"\n// after\nsourceOf(conn, \"VIEW\", \"sales_agg\", \"sales\"); // match real owner from catalog listing","handlingStrategy":"validation","validationCode":"boolean objectExists(java.sql.Connection c, String name, String owner) throws SQLException {\n    try (PreparedStatement ps = c.prepareStatement(\n            \"SELECT 1 FROM <catalog_view> WHERE metadata_type = ? AND name = ? AND owner = ?\")) {\n        ps.setString(1, \"VIEW\"); ps.setString(2, name); ps.setString(3, owner);\n        try (ResultSet rs = ps.executeQuery()) { return rs.next(); }\n    }\n}\n// call the source RPC only if objectExists(...) is true","typeGuard":"boolean isPresent(ResultSet rs) throws SQLException { return rs.next(); }","tryCatchPattern":"try {\n    JsonNode source = rpc.objectSource(name, owner, type);\n} catch (SQLException e) {\n    if (\"Object source not found\".equals(e.getMessage())) {\n        // treat as absent object: refresh listing, skip, or surface friendly message\n    } else throw e;\n}","preventionTips":["Resolve names via the browse/list RPCs instead of typing them manually","Always send the exact owner/schema returned by the catalog listing","Refresh cached metadata after DDL changes","Confirm you are connected to the intended catalog/server"],"tags":["jdbc","metadata","not-found"],"backgroundTag":"object-not-found","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}