bit-team / backintime

Back In Time - An easy-to-use backup tool for GNU Linux using rsync in the back
https://backintime.readthedocs.io
GNU General Public License v2.0
2.03k stars 201 forks source link

Will no longer backup anything without removing old backup location. (read-only filesystem) #1798

Closed cnobile2012 closed 2 months ago

cnobile2012 commented 2 months ago

This has not happened twice to me. I'm using version 1.2.1 When I see if the backup went okay from the night before I get a message that the backup path can no longer be written to, I've changed nothing on my system before this happened. The path I think was .local/share/backintime/mnt. When I try to start a backup manually it says it's removing the leftover path, but then says "done" and no backup happens.

By-the-way when I run 'backintime --diagnostics' the app says "backintime: error: Unknown Argument(s): --diagnostics".

buhtz commented 2 months ago

Hello Carl,

Thank you for taking the time to report the bug. I appreciate your feedback. I am assuming this is not a bug.

Have you checked if your backup destination is mounted correct? Maybe it is out of space? Or it is corrupt.

Your version of BIT is quit outdated. "--diagnostics" is not implemented in this version.

You need to give us an error message or something more detailed to analyze the situation. Start BIT on terminal in debug mode via backintime-qt --debug, try to reproduce the problem and then post the output here please.

Best regards, Christian

cnobile2012 commented 2 months ago

The backup location is always mounted correctly. It is an NFS mount and it hasn't been changed in years. Corruption is surely possible but if it is it's backintime that corrupts it, nothing else. As I said this is the 2nd time this has happened and the only way to fix it was to blow away the old encrypted data and let BIT start from scratch, this is a three-day process just to let BIT copy the initial backup. It's on a 1 TB drive and only 22% is being used.

Ibackintime-qt --debug: It complained that the mount point is read-only, but it's BIT that is doing that.

Back In Time
Version: 1.2.1

Back In Time comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; type `backintime --license' for details.

DEBUG: [common/backintime.py:670 getConfig] config file: /home/cnobile/.config/backintime/config
DEBUG: [common/backintime.py:671 getConfig] share path: /home/cnobile/.local/share/backintime
DEBUG: [common/backintime.py:672 getConfig] profiles: 1=Main profile
DEBUG: [common/pluginmanager.py:90 PluginManager.load] Register plugin path /usr/share/backintime/plugins
DEBUG: [common/pluginmanager.py:106 PluginManager.load] Add plugin notifyplugin.py
DEBUG: [common/pluginmanager.py:106 PluginManager.load] Add plugin qt4plugin.py
INFO: [common/snapshots.py:634 Snapshots.backup] Lock
DEBUG: [common/tools.py:1181 inhibitSuspend] Inhibit Suspend started. Reason: take snapshot
DEBUG: [common/tools.py:822 keyringSupported] No appropriate keyring found. 'keyring.backends.chainer' can't be used with BackInTime
DEBUG: [common/mount.py:677 EncFS_mount.mountProcessLockAcquire] Acquire mountprocess lock /home/cnobile/.local/share/backintime/mnt/170278.lock
INFO: [common/mount.py:416 EncFS_mount.mount] Mountpoint /home/cnobile/.local/share/backintime/mnt/88394B49/mountpoint is already mounted
DEBUG: [common/mount.py:704 EncFS_mount.mountLockAquire] Set mount lock /home/cnobile/.local/share/backintime/mnt/88394B49/locks/170278.lock
DEBUG: [common/mount.py:689 EncFS_mount.mountProcessLockRelease] Release mountprocess lock /home/cnobile/.local/share/backintime/mnt/170278.lock
INFO: [common/snapshots.py:665 Snapshots.backup] Take a new snapshot. Profile: 1 Main profile
INFO: [common/snapshots.py:987 takeSnapshot] Remove leftover 'new_snapshot' folder from last run
DEBUG: [common/snapshots.py:989 Execute.takeSnapshot] Call command "rsync -a --delete /tmp/tmpvcranrm2/ /home/cnobile/.local/share/backintime/mnt/1_170278/backintime/Nemesis/cnobile/1/new_snapshot"
WARNING: [common/snapshots.py:989 Execute.takeSnapshot] Command "rsync -a --delete /tmp/tmpvcranrm2/ /home/cnobile/.local/share/backintime/mnt/1_170278/backintime/Nemesis/cnobile/1/new_snapshot" returns 23 | rsync: failed to set permissions on "/home/cnobile/.local/share/backintime/mnt/1_170278/backintime/Nemesis/cnobile/1/new_snapshot/.": Read-only file system (30)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1205) [sender=3.1.3]
Traceback (most recent call last):
  File "/usr/share/backintime/common/snapshots.py", line 692, in backup
    ret_val, ret_error = self.takeSnapshot(sid, now, include_folders)
  File "/usr/share/backintime/common/snapshots.py", line 989, in takeSnapshot
    self.remove(new_snapshot)
  File "/usr/share/backintime/common/snapshots.py", line 583, in remove
    shutil.rmtree(sid.path())
  File "/usr/lib/python3.8/shutil.py", line 722, in rmtree
    onerror(os.rmdir, path, sys.exc_info())
  File "/usr/lib/python3.8/shutil.py", line 720, in rmtree
    os.rmdir(path)
OSError: [Errno 30] Read-only file system: '/home/cnobile/.local/share/backintime/mnt/1_170278/backintime/Nemesis/cnobile/1/new_snapshot'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/share/backintime/common/backintime.py", line 1165, in <module>
    startApp()
  File "/usr/share/backintime/common/backintime.py", line 517, in startApp
    args.func(args)
  File "/usr/share/backintime/common/backintime.py", line 739, in backup
    ret = takeSnapshot(cfg, force)
  File "/usr/share/backintime/common/backintime.py", line 94, in takeSnapshot
    ret = snapshots.Snapshots(cfg).backup(force)
  File "/usr/share/backintime/common/snapshots.py", line 697, in backup
    new.failed = True
  File "/usr/share/backintime/common/snapshots.py", line 2246, in failed
    self.makeWritable()
  File "/usr/share/backintime/common/snapshots.py", line 2385, in makeWritable
    return os.chmod(path, rw)
OSError: [Errno 30] Read-only file system: '/home/cnobile/.local/share/backintime/mnt/1_170278/backintime/Nemesis/cnobile/1/new_snapshot'
buhtz commented 2 months ago

Thank you for providing that output. Can you write to that mounted share with another program, for example just create a text file there?

Be aware that your BIT version is 5 years old. Beside a general recommendation to upgrade it I do not assume that this would solve your problem. I am not sure of course but I don't see how BIT can cause an error like this.

Again I recommend to check the filesystem and the physical device itself. Might be that the device is damaged or corrupt and that is why the FS is read only. Is it an SSD?

cnobile2012 commented 2 months ago

I don't know what happened the first time this happened last May, but after rebooting the RPI that holds my backup medium the write permissions were solved. It has a 1TB hard drive, not an SSD. I have BIT running now, but it just finished and did nothing, so not being writable wasn't the only issue.

I'll follow the instructions on how to install your PPA to get the latest version, thanks.

This is the latest traceback:

Back In Time
Version: 1.2.1

Back In Time comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; type `backintime --license' for details.

DEBUG: [common/backintime.py:670 getConfig] config file: /home/cnobile/.config/backintime/config
DEBUG: [common/backintime.py:671 getConfig] share path: /home/cnobile/.local/share/backintime
DEBUG: [common/backintime.py:672 getConfig] profiles: 1=Main profile
DEBUG: [common/pluginmanager.py:90 PluginManager.load] Register plugin path /usr/share/backintime/plugins
DEBUG: [common/pluginmanager.py:106 PluginManager.load] Add plugin notifyplugin.py
DEBUG: [common/pluginmanager.py:106 PluginManager.load] Add plugin qt4plugin.py
INFO: [common/snapshots.py:634 Snapshots.backup] Lock
DEBUG: [common/tools.py:1181 inhibitSuspend] Inhibit Suspend started. Reason: take snapshot
DEBUG: [common/tools.py:822 keyringSupported] No appropriate keyring found. 'keyring.backends.chainer' can't be used with BackInTime
DEBUG: [common/mount.py:677 EncFS_mount.mountProcessLockAcquire] Acquire mountprocess lock /home/cnobile/.local/share/backintime/mnt/192486.lock
INFO: [common/mount.py:416 EncFS_mount.mount] Mountpoint /home/cnobile/.local/share/backintime/mnt/88394B49/mountpoint is already mounted
DEBUG: [common/mount.py:704 EncFS_mount.mountLockAquire] Set mount lock /home/cnobile/.local/share/backintime/mnt/88394B49/locks/192486.lock
DEBUG: [common/mount.py:689 EncFS_mount.mountProcessLockRelease] Release mountprocess lock /home/cnobile/.local/share/backintime/mnt/192486.lock
INFO: [common/snapshots.py:665 Snapshots.backup] Take a new snapshot. Profile: 1 Main profile
INFO: [common/snapshots.py:987 takeSnapshot] Remove leftover 'new_snapshot' folder from last run
DEBUG: [common/snapshots.py:989 Execute.takeSnapshot] Call command "rsync -a --delete /tmp/tmp8uhnyuap/ /home/cnobile/.local/share/backintime/mnt/1_192486/backintime/Nemesis/cnobile/1/new_snapshot"
DEBUG: [common/snapshots.py:989 Execute.takeSnapshot] Command "rsync -a --delet..." returns 0: cannot delete non-empty directory: backup/home/cnobile/snap/discord/196/.config/discord/Code Cache/js
cannot delete non-empty directory: backup/home/cnobile/snap/discord/196/.config/discord/Code Cache
cannot delete non-empty directory: backup/home/cnobile/snap/discord/196/.config/discord/Code Cache
cannot delete non-empty directory: backup/home/cnobile/snap/discord/196/.config/discord
cannot delete non-empty directory: backup/home/cnobile/snap/discord/196/.config/discord
cannot delete non-empty directory: backup/home/cnobile/snap/discord/196/.config
cannot delete non-empty directory: backup/home/cnobile/snap/discord/196/.config
cannot delete non-empty directory: backup/home/cnobile/snap/discord/196
cannot delete non-empty directory: backup/home/cnobile/snap/discord/196
cannot delete non-empty directory: backup/home/cnobile/snap/discord
cannot delete non-empty directory: backup/home/cnobile/snap/discord
cannot delete non-empty directory: backup/home/cnobile/snap
cannot delete non-empty directory: backup/home/cnobile/snap
cannot delete non-empty directory: backup/home/cnobile
cannot delete non-empty directory: backup/home/cnobile
cannot delete non-empty directory: backup/home
cannot delete non-empty directory: backup/home
cannot delete non-empty directory: backup
Traceback (most recent call last):
  File "/usr/share/backintime/common/backintime.py", line 1165, in <module>
    startApp()
  File "/usr/share/backintime/common/backintime.py", line 517, in startApp
    args.func(args)
  File "/usr/share/backintime/common/backintime.py", line 739, in backup
    ret = takeSnapshot(cfg, force)
  File "/usr/share/backintime/common/backintime.py", line 94, in takeSnapshot
    ret = snapshots.Snapshots(cfg).backup(force)
  File "/usr/share/backintime/common/snapshots.py", line 692, in backup
    ret_val, ret_error = self.takeSnapshot(sid, now, include_folders)
  File "/usr/share/backintime/common/snapshots.py", line 989, in takeSnapshot
    self.remove(new_snapshot)
  File "/usr/share/backintime/common/snapshots.py", line 583, in remove
    shutil.rmtree(sid.path())
  File "/usr/lib/python3.8/shutil.py", line 718, in rmtree
    _rmtree_safe_fd(fd, path, onerror)
  File "/usr/lib/python3.8/shutil.py", line 655, in _rmtree_safe_fd
    _rmtree_safe_fd(dirfd, fullname, onerror)
  File "/usr/lib/python3.8/shutil.py", line 655, in _rmtree_safe_fd
    _rmtree_safe_fd(dirfd, fullname, onerror)
  File "/usr/lib/python3.8/shutil.py", line 655, in _rmtree_safe_fd
    _rmtree_safe_fd(dirfd, fullname, onerror)
  [Previous line repeated 6 more times]
  File "/usr/lib/python3.8/shutil.py", line 659, in _rmtree_safe_fd
    onerror(os.rmdir, fullname, sys.exc_info())
  File "/usr/lib/python3.8/shutil.py", line 657, in _rmtree_safe_fd
    os.rmdir(entry.name, dir_fd=topfd)
OSError: [Errno 39] Directory not empty: 'js'
buhtz commented 2 months ago

Thank you for reporting back.

I'll follow the instructions on how to install your PPA to get the latest version, thanks.

This is not "our" PPA. It is not recommended to use PPA, AUR, Snap, Flatpack or any other 3rd party source. Use the official repository of your GNU/Linux distribution please.

The error output you provide seems to be something new. It is still not clear what happens on your site. I do assume that the same errors do appear with a newer version of BIT. But the newer version are more verbose and might help diagnosing the problem.

Try to find the new_snapshot folder in your backup destination and delete it manually.

Which operating system and version do you use?

cnobile2012 commented 2 months ago

I'm using Ubuntu 20.04.6 LTS I will not be updating until they fix the compositor which seems to be broken in later versions. I need to write in languages other than English which also does not work properly in the newer versions of Ubuntu. I also have a laptop with the newest LTS version and both things above are broken. I'm also a software developer and have been using Python since version 1.51 which was more than 20 years ago.

Your BIT version on 20.04 is the one I have installed, they have never updated to your latest version unhappily, so I'm kind of stuck with this if you don't recommend the PPA.

Is it possible to install from the GIT repo?

So I tried to delete the new_snapshot directory and at some point during the process the mount became unwritable again. I'm going in circles. When I try to umount the mount point it says it's busy, so I guess I need to reboot again, bummer.

I'll keep you updated. And sorry for the rambling above, LOL

buhtz commented 2 months ago

I'm using Ubuntu 20.04.6 LTS

This is two LTS versions behind. I never understood why Ubuntu users doing it like this. If you need a stable distro you should stick to Debian GNU/Linux.

Your BIT version on 20.04 is the one I have installed, they have never updated to your latest version unhappily

Canonical never offered Back In Time. They just copy the Debian packages and serve it via the "universe" repository which is maintained by the community.

Is it possible to install from the GIT repo?

Not with this outdated Ubuntu version. I also wouldn't recommend that because the latest development version is unstable and you risk your data.

So I tried to delete the new_snapshot directory and at some point during the process the mount became unwritable again. I'm going in circles.

You tried to delete it without using BIT, am I right? But it became unwriteable again? So it is not BIT. You see? When a volume/mount switch to read-only it is often an indicator that something is wrong with the filesystem and/or the physical device itself.

I suggest to contact your community and running diagnosis on this drive.

cnobile2012 commented 2 months ago

I'm in the middle of a huge project, so updating my primary computer right now is a non-starter. I will try to analyze the hard drive to see if it has issues. Thanks for the ideas. I'll keep you updated on what I find.

cnobile2012 commented 2 months ago

You were right on the money, the 1TB hard drive that I was using had serious issues. I've bought an SSD drive for the Raspberry Pi 4 that I'm using. It's now NFS4 mounted on my main machine. I'm doing an initial backup which will take a while.

Thanks again You can go ahead and close this ticket if you like.

emtiu commented 2 months ago

Thank you for reporting back!