Closed Biotronic closed 12 months ago
I don't feel like this is an issue that should be addressed. As this tool can be run on multiple platforms, there is no consistent way to check how much space is available. And even if we would get that information, things like the blocksize of the filesystem would have to be considered as well. So the approach using the filesize is not an option.
The only workaround that could be working would be to first save the content into a temporary file, and then rename the file to the correct location, overwriting the original file. But during this so much could go wrong, that I don't think it's worth the effort as well.
The main problem is, that attempting to write to a file always truncates the content. That's just how file operations on this level work.
And not to forget: when your disk is full, a lot of the other data wouldn't be written to the disk as well. I'm actually surprised you didn't notice the disk being full in the first place, as many other parts of your installation should have given an indication, that your installation is unhealthy.
PS: You can see the version by first clicking on the gear-icon in the top-right corner, and then clicking on About HASS Configurator.
First reported this on the File Editor add-on, but they tell me the real issue is here. https://github.com/home-assistant/addons/issues/3206
So I left debug logging on for a while, and my drive filled up. When I tried to fix it, I got an error message when saving configuration.yaml (No space left on device). I then deleted the giant log files, and went back to the file I was editing. To my surprise, that file was now empty.
Clearly, discarding the contents of a file when attempting to save it, is an unfortunate effect and should be avoided if possible. In this case, I assume we could check if there's space, and if not, just not save and then return the error.
Steps to reproduce the issue
Interesting log contents:
I tried to figure out the version of Configurator, but I don't see it anywhere.