[Borgbackup] Local Exception

Boris Kirkorowicz bkborg at kirk.de
Sun Jul 17 11:19:24 EDT 2022


Hello,

Am 14.07.22 um 22:38 schrieb Thomas Waldmann:
>> / is on BTRFS, /home is on XFS, both support chmod.
> 
> And the repo is not on a separate fs, but also on XFS?

yes; the only filesystems used here are btrfs and xfs. I plan to use
ext4 via sshfs after my tests work reliably.


>> One week before, it worked on the same machine. Maybe something is
>> broken. If I only could find the one (?) file that is broken/missing?
> 
> borg <= 1.2.0 had a bug (or rather "unpretty behaviour") and the fix 
> introduced that chmod you see in the traceback (in borg 1.2.1).

The version installed is borgbackup-1.2.1-2.1.x86_64.


> The tmp file you see there is created by borg right before it gets 
> written to, chmoded and renamed over the old config file. This is to 
> avoid empty or partially written config files in case something goes 
> wrong. The rename op is atomic, so you either keep the old config file 
> or you will have the new config file, but other states are not possible.
> 
> And as a file owner, one is allowed to chmod ones own files.

So everything should work fine.


> The chmod is because the python stdlib "make a tempfile" code uses very 
> strict permissions on the temp file. But in the end, we want the mode to 
> look like on a normally created file (which is 666 & ~umask).

umask is 0022


>>>>> Local Exception
>>>>> Traceback (most recent call last):
>>>>>     File "/usr/lib64/python3.10/site-packages/borg/archiver.py", line 5115, in main
>>>>>       exit_code = archiver.run(args)
>>>>>     File "/usr/lib64/python3.10/site-packages/borg/archiver.py", line 5046, in run
>>>>>       return set_ec(func(args))
>>>>>     File "/usr/lib64/python3.10/site-packages/borg/archiver.py", line 168, in wrapper
>>>>>       with repository:
>>>>>     File "/usr/lib64/python3.10/site-packages/borg/repository.py", line 198, in __enter__
>>>>>       self.create(self.path)
>>>>>     File "/usr/lib64/python3.10/site-packages/borg/repository.py", line 297, in create
>>>>>       self.save_config(path, config)
>>>>>     File "/usr/lib64/python3.10/site-packages/borg/repository.py", line 322, in save_config
>>>>>       with SaveFile(config_path) as fd:
>>>>>     File "/usr/lib64/python3.10/site-packages/borg/platform/base.py", line 248, in __exit__
>>>>>       os.chmod(self.tmp_fname, mode=0o666 & ~ umask)
>>>>> PermissionError: [Errno 1] Operation not permitted: '/home/boris/Dokumente/temp/BorgBackup/config-bsdwfcdw.tmp'
> _______________________________________________
> Borgbackup mailing list
> Borgbackup at python.org
> https://mail.python.org/mailman/listinfo/borgbackup
> 

-- 
Mit freundlichem Gruß                                 Best regards
                                 Kirkorowicz


More information about the Borgbackup mailing list