diff --git a/bundles/org.openhab.persistence.rrd4j/src/main/java/org/openhab/persistence/rrd4j/internal/RRD4jPersistenceService.java b/bundles/org.openhab.persistence.rrd4j/src/main/java/org/openhab/persistence/rrd4j/internal/RRD4jPersistenceService.java index d29170d508b76..147e675409470 100644 --- a/bundles/org.openhab.persistence.rrd4j/src/main/java/org/openhab/persistence/rrd4j/internal/RRD4jPersistenceService.java +++ b/bundles/org.openhab.persistence.rrd4j/src/main/java/org/openhab/persistence/rrd4j/internal/RRD4jPersistenceService.java @@ -152,7 +152,12 @@ public synchronized void store(final Item item, @Nullable final String alias) { } final String name = alias == null ? item.getName() : alias; - RrdDb db = getDB(name); + RrdDb db = null; + try { + db = getDB(name); + } catch (Exception e) { + logger.warn("Failed to open rrd4j database '{}' ({})", name, e.getClass().getName()); + } if (db == null) { return; } @@ -249,7 +254,13 @@ public void store(Item item) { public Iterable query(FilterCriteria filter) { String itemName = filter.getItemName(); - RrdDb db = getDB(itemName); + RrdDb db = null; + try { + db = getDB(itemName); + } catch (Exception e) { + logger.warn("Failed to open rrd4j database '{}' ({})", itemName, e.getClass().getName()); + return List.of(); + } if (db == null) { logger.debug("Could not find item '{}' in rrd4j database", itemName); return List.of();