This article describes one possible reason for the below commit error.
user@switch# commit
error: /config/juniper.conf+: was not properly closed: Unknown error: 0
error: configuration check-out failed: commit to file failed during export to /config/juniper.conf+
This error message is being raised when attempting to commit configuration changes. The configuration will not be committed after such errors.
Deleting juniper.conf+ from /config does not help.
https://supportportal.juniper.net/s/article/Junos-Commit-error-error-commit-failed-commit-to-file-failed-during-export-to-config-juniper-conf
1. Check system storage:
user@switch> show system storage | match /config
/dev/da0s4d 116M 115M -9.2M 109% /config
2. Check /config for any large files. In this case case auto_image_upgrade.conf was very large.
user@switch> start shell
%
% ls -al /config | grep auto_image_upgrade
-rw-r--r-- 1 root wheel 120913920 Dec 31 2022 auto_image_upgrade.conf
3. Delete auto_image_upgrade.conf
root@switch:RE:0% rm auto_image_upgrade.conf