Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HABridge loosing config #1401

Open
lollett opened this issue Feb 19, 2024 · 0 comments
Open

HABridge loosing config #1401

lollett opened this issue Feb 19, 2024 · 0 comments

Comments

@lollett
Copy link

lollett commented Feb 19, 2024

I'm running HA-Bridge 5.4.1 in docker from DockerHub linuxserver/habridge:latest

Everything is working well except randomly it stops working because it's lost /config/ha-bridge.config
Either the file is zero length or completely missing...

There's no scripts in the docker image to suggest its doing anything, but coincidently I see a habridge.config.old-[date]-[time] created the same day it fails.

The only thing I can think might happing is the HA-Bridge code (below) is routinely creating this backup by moving the "ha-bridge.config to habridge.config.old-[date]-[time] " and failing to recreate "ha-bridge.config"

target = FileSystems.getDefault().getPath(filePath.getParent().toString(), "habridge.config.old." + getCurrentDate());
			Files.move(filePath, target);
		}
		Files.write(filePath, content.getBytes(), StandardOpenOption.CREATE);

It's probably a permission issue, but wouldn't it be safer to Files.copy instead of Files.move ???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant