-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Error creating backup: unexpected end of data #134881
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
Comments
Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) backup documentation |
Please update to the latest Core version and try creating an automatic backup. You can do that from the GUI. Please use the following logger integration YAML settings: logger:
default: warning
logs:
homeassistant.components.backup: debug
homeassistant.components.hassio: debug |
Hi - I've updated to 2025.2.5, logger configured as requested. Tried to do a manual backup - failed. Log says:
Interesting so, it seems the backups are getting created, at least they seem to be in the backup folder:
Also to mention: It requires a restart of HA to see these backups in the gui. (did not test if these backups would work). |
I think there might be some file in the data folder which can't be read when we create the backup. |
Any chance to find out which file / folder this might be? |
PR #139273, which will be included in the Home Assistant Core beta 2025.3.0b0 scheduled for release today, improves logging of file I/O errors. |
Many thanks - 2025.3.0b0 provided the information which file causes the issue. |
I doubt it's that simple, empty files are generally not a problem. Do you by chance have a way to restore the offending file? |
Yes I have ... I can give I try later this day. |
I restored my configuration from a backup - which brought back the (actual) two files I had deleted yesterday:
If I trigger a backup - without restarting the docker container - the backup works without problems. After restarting the container, I get the same error message as I got before:
Backup fails almost immediately. A backup file is created (but only 310kb in size - instead 30 MB). After removing this "temp" file, backup works again ... |
Does it mean that before you restart the container, the backup is successfully done, and it contains both the |
Can you try to check if anything has the |
ok. Did the test again.
The file does not seem to be open by any process, at least lsof / fsuser does not report anything. Not sure whats going on here :) |
OK, so as soon as the "temp" file is there, the backup fails to be created, it doesn't fail only after you restart the container? |
Please open a shell in the Home Assistant container and try the snippet below, then paste the output here.
|
Aaaargh ... sorry, I guess its sort of a "layer 8 problem" :(
Seems that the backup process cannot process this "file". /config # python3 --version
I guess I need to map the temperature reading somewhere outside of the "config" folder. |
OK, I see. However, the Python tarfile library should not try to copy non regular files. Also, this should reveal what Python thinks:
|
My "temp" file was actually /sys/class/thermal/thermal_zone0/temp ... I guess this counts as "special regular file". |
The problem
Creating manual or automated backups fails with the error message "Failed to create backup".
What version of Home Assistant Core has the issue?
2025.1.0
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Container
Integration causing the issue
homeassistant.components.backup
Link to integration documentation on our website
No response
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
The backup is actually created - at least there are files generated in the backup-folder, but the UI does not show or list these files.
Tries already to remove the backup folder and restart - this regenerates the folder, but does not change anything.
The text was updated successfully, but these errors were encountered: