eclipse-archived / smarthome

Eclipse SmartHome™ project
https://www.eclipse.org/smarthome/
Eclipse Public License 2.0
862 stars 783 forks source link

Noisy logging of JsonStorage on a fresh installation #3428

Closed kaikreuzer closed 7 years ago

kaikreuzer commented 7 years ago

A fresh installation welcomes the user with this logging:

15:12:10.463 [INFO ] [e.smarthome.storage.json.JsonStorage] - Json storage file at '/Users/kai/Downloads/oh/userdata/jsondb/org.eclipse.smarthome.core.items.Item.json' was not read.
15:12:10.600 [INFO ] [e.smarthome.storage.json.JsonStorage] - Json storage file at '/Users/kai/Downloads/oh/userdata/jsondb/org.eclipse.smarthome.core.thing.link.ItemChannelLink.json' was not read.
15:12:10.604 [INFO ] [e.smarthome.storage.json.JsonStorage] - Json storage file at '/Users/kai/Downloads/oh/userdata/jsondb/org.eclipse.smarthome.core.thing.link.ItemThingLink.json' was not read.
15:12:10.606 [INFO ] [e.smarthome.storage.json.JsonStorage] - Json storage file at '/Users/kai/Downloads/oh/userdata/jsondb/org.eclipse.smarthome.core.thing.Thing.json' was not read.
15:12:11.081 [INFO ] [e.smarthome.storage.json.JsonStorage] - Json storage file at '/Users/kai/Downloads/oh/userdata/jsondb/org.eclipse.smarthome.config.discovery.DiscoveryResult.json' was not read.

It is perfectly valid that there aren't yet any database files, so I consider this a bug.

kaikreuzer commented 7 years ago

Introduced by https://github.com/eclipse/smarthome/pull/3407

philomatic commented 7 years ago

First of all, you're absolutely right that this noisy logging for a fresh installation is a bug. Sorry for that.

However, the point is, ext3 / ext4 seems to delete files (or at least hide from userspace) which became invalid. So, backups will be never used for these cases.

How about checking the backup folder and restoring only if there is a valid backup? If no backup folder (respective backup files) are existent, then nothing should appear in the logs?

I guess #3407 was too short handed and merged :(