itsmepetrov / homebridge-zigbee

ZigBee Platform plugin for HomeBridge
https://itsmepetrov.github.io/homebridge-zigbee/
MIT License
106 stars 36 forks source link

Uncaught Exception Error: More than 10% of the data file is corrupt, the wrong beforeDeserialization hook may be used. Cautiously refusing to start NeDB to prevent dataloss #10

Closed cimc0n closed 5 years ago

cimc0n commented 5 years ago

Uncaught Exception Error: More than 10% of the data file is corrupt, the wrong beforeDeserialization hook may be used. Cautiously refusing to start NeDB to prevent dataloss at Persistence.treatRawData (/usr/lib/node_modules/homebridge-zigbee/node_modules/nedb/lib/persistence.js:242:11) at /usr/lib/node_modules/homebridge-zigbee/node_modules/nedb/lib/persistence.js:281:38 at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:525:3)

itsmepetrov commented 5 years ago

Hi @cimc0n there is something wrong with your database file. Maybe you had added some changes manually to that file, may you don't have access in the folder where you want to store it. You can just remove the file and try again.

cimc0n commented 5 years ago

This problem appeared after raspberry was suddenly rebooted. Manual changes did not made. I don't even know where is this file.

itsmepetrov commented 5 years ago

It looks like this file wasn't properly saved and that caused the problem. If you doesn't have database record in your homebridge config file, you can locate db file in the same folder with the config file. The default name is zigbee.db. Example: ~/.homebridge/zigbee.db.

cimc0n commented 5 years ago

1) cd /usr/lib/node_modules/homebridge-zigbee/node_modules/nedb/lib/ 2) mkdir del 3) mv persistence.js del/ 4) restart service homebridge (exist with error) 5) mv persistence.js ../ 6) restart service homebridge works for me.

itsmepetrov commented 5 years ago

lol, ok