{"record":{"id":"94b028648f989356","repo":"dbeaver/dbeaver","slug":"can-t-read-tablespace-statistics","errorCode":null,"errorMessage":"Can't read tablespace statistics","messagePattern":"Can't read tablespace statistics","errorType":"exception","errorClass":"DBDatabaseException","httpStatus":null,"severity":"error","filePath":"plugins/org.jkiss.dbeaver.ext.altibase/src/org/jkiss/dbeaver/ext/altibase/model/AltibaseDataSource.java","lineNumber":690,"sourceCode":"    void resetStatistics() {\n        hasStatistics = false;\n    }\n\n    @Override\n    public void collectObjectStatistics(@NotNull DBRProgressMonitor monitor, boolean totalSizeOnly, boolean forceRefresh) throws DBException {\n        if (hasStatistics && !forceRefresh) {\n            return;\n        }\n\n        try {\n            for (AltibaseTablespace tbs : tablespaceCache.getAllObjects(monitor, AltibaseDataSource.this)) {\n                AltibaseTablespace tablespace = tablespaceCache.getObject(monitor, AltibaseDataSource.this, tbs.getName());\n                if (tablespace != null) {\n                    tablespace.loadSizes(monitor);\n                }\n            }\n        } catch (DBException e) {\n            throw new DBDatabaseException(\"Can't read tablespace statistics\", e, getDataSource());\n        } finally {\n            hasStatistics = true;\n        }\n    }\n\n    ///////////////////////////////////////////////\n    // Altibase Properties\n    @NotNull\n    public List<AltibaseProperty> getProperties(DBRProgressMonitor monitor)\n            throws DBException {\n        return loadPropertyList(monitor);\n    }\n\n    @NotNull\n    private List<AltibaseProperty> loadPropertyList(@NotNull DBRProgressMonitor monitor) throws DBException {\n        try (JDBCSession session = DBUtils.openMetaSession(monitor, this, \"Load properties\")) {\n            try (JDBCPreparedStatement dbStat = session.prepareStatement(\"SELECT * FROM V$PROPERTY ORDER BY NAME ASC\")) {\n                try (JDBCResultSet dbResult = dbStat.executeQuery()) {","sourceCodeStart":672,"sourceCodeEnd":708,"githubUrl":"https://github.com/dbeaver/dbeaver/blob/1e5ee1042bc61661368942aece126f3e67049955/plugins/org.jkiss.dbeaver.ext.altibase/src/org/jkiss/dbeaver/ext/altibase/model/AltibaseDataSource.java#L672-L708","documentation":"AltibaseDataSource.refreshTablespaceStatistics wraps any DBException raised while iterating and loading sizes of each AltibaseTablespace into DBDatabaseException('Can't read tablespace statistics'). The finally block still sets hasStatistics=true, so a later non-forced refresh returns early without retrying.","triggerScenarios":"Forcing a metadata/statistics refresh when one tablespace's loadSizes(monitor) fails; iterating tablespaceCache.getAllObjects raises DBException (privilege, missing system view, stale cache).","commonSituations":"Connected user lacks SELECT on the tablespace system views; Altibase version exposes different sizing columns; a tablespace is in an inconsistent state; cache was partially populated.","solutions":["Connect with a user that has privileges to read Altibase tablespace sizing views.","Force-refresh again after fixing privileges (hasStatistics is set true even on failure, so a force flag may be required).","Check the wrapped DBException cause for the specific tablespace/object that failed and address it."],"exampleFix":"// before\n} catch (DBException e) {\n    throw new DBDatabaseException(\"Can't read tablespace statistics\", e, getDataSource());\n} finally {\n    hasStatistics = true;\n}\n\n// after - only mark statistics loaded on success so a retry is possible\n} catch (DBException e) {\n    throw new DBDatabaseException(\"Can't read tablespace statistics\", e, getDataSource());\n}\nhasStatistics = true;","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    dataSource.refreshTablespaceStatistics(monitor, forceRefresh);\n} catch (DBDatabaseException e) {\n    // statistics partially unavailable; degrade gracefully, log the wrapped cause\n    log.warn(\"Tablespace statistics unavailable\", e);\n}","preventionTips":["Connect with a user that has privileges on Altibase tablespace sizing views.","Because hasStatistics is set true even on failure, pass a force refresh after fixing the root cause.","Surface the wrapped DBException cause to identify the failing tablespace."],"tags":["altibase","tablespace","statistics","metadata","privileges"],"backgroundTag":null,"analyzedSha":"1e5ee1042bc61661368942aece126f3e67049955","analyzedAt":"2026-08-13T23:31:13.467Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}