bitfocus / companion

Bitfocus Companion enables the reasonably priced Elgato Stream Deck and other controllers to be a professional shotbox surface for an increasing amount of different presentation switchers, video playback software and broadcast equipment.
http://bitfocus.io/companion
Other
1.63k stars 505 forks source link

[BUG] Configuration broken after power fail of computer #3112

Open technogrady opened 4 weeks ago

technogrady commented 4 weeks ago

Is this a bug in companion itself or a module?

Is there an existing issue for this?

Describe the bug

We believe we lost power on our companion machine. We run a NUC bridge computer between our LAN and outside internet. We came back and all machines were reset. We turned on the NUC and started companion, and every screen and connection had been reset, but the interface we were running companion on( we have 5 interfaces on this computer) and custom port did not change. Companion satellite still automatically connected and had a blank screen with no buttons, only navigation.

Steps To Reproduce

Not sure but probably pull power on a machine running compainon

Expected Behavior

I expected all settings to stay the same

Environment (please complete the following information)

Additional context

No response

dnmeid commented 4 weeks ago

I'm very sorry for you but I think that is not a bug we can reliably handle. Companion stores the configuration data in some files. The listening port is in one file and all the connections and buttons and so on in a different database file. Especially if you have frequently changing variables, like timers with seconds the database is changed often. If there is a power fail during a write operation it depends on your hardware setup how that is handled. There are drives with a battery back-upped write cache, that will make sure that all pending write operations are finished even in case of power fail. A standard NUC doesn't feature that. The modern file systems only ensure that in case of a power fail the filesystem doesn't get corrupt, but it is possible that scheduled write operations are not finished and then the file content will be corrupt.

Companion automatically generates a backup of your configuration for such cases. If you didn't change the configuration after the power fail, the backup should still hold a quite recent state. You can find it in the Companion configuration folder with a right click on the Companion tray icon. Close Companion and remove the corrupt "db" file and rename "db.bak" to "db".

Julusian commented 3 weeks ago

I think the risk of this should be lower in the betas, due to the change in storage format.

I'm not sure what we can do for 3.4, this issue has been around for ages but stopped happening for a while, no idea why it has started cropping up again recently.

I did have a quick look at it today, but the only change I could think of (calling fsync) would require larger changes that introduce risk of making this even worse