Skip to content
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

Smart-remove (cli) doesn't remove snapshots #1880

Open
khenty opened this issue Sep 22, 2024 · 6 comments
Open

Smart-remove (cli) doesn't remove snapshots #1880

khenty opened this issue Sep 22, 2024 · 6 comments
Labels
Bug Heisenbug a problem that is not reproducible but random (non-deterministic)

Comments

@khenty
Copy link

khenty commented Sep 22, 2024

My USB 3.0 backup disk, formatted ext4, ran out of space despite my putting a limit of 1TB (1000 GB) on it. So I enabled smart remove in the backintime gui, for the first time.

Then I tried to run "sudo -i backintime smart-remove" from the terminal. backintime identified 11 snapshots to delete, and proceeded to try to delete them. However, each rsync delete returned an error code, 22 I think. Sorry, I forgot to save the output. I did get about 1.3 GB back, on a 10 TB backup drive, but all the snapshots are still there: The backintime gui shows them all, and when I examine the directory containing the snapshots, they are all there too.

How do I get rid of these snapshots?

I'm rerunning "sudo -i backintime smart-remove", which has identified the same 11 snapshots for removal.

I'm attaching the diagnostic output created before this second deletion attempt. I have backintime 1.4.3 on Linux Mint Mate 22. Thanks for your help!

{
    "backintime": {
        "name": "Back In Time",
        "version": "1.4.3",
        "latest-config-version": 6,
        "local-config-file": "/home/UsernameReplaced/.config/backintime/config",
        "local-config-file-found": true,
        "global-config-file": "/etc/backintime/config",
        "global-config-file-found": false,
        "started-from": "/usr/share/backintime/common",
        "running-as-root": false,
        "user-callback": "/home/UsernameReplaced/.config/backintime/user-callback",
        "keyring-supported": true
    },
    "host-setup": {
        "platform": "Linux-6.8.0-45-generic-x86_64-with-glibc2.39",
        "system": "Linux #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024",
        "OS": {
            "/etc/os-release": "Linux Mint 22",
            "/etc/lsb-release": "DISTRIB_ID=LinuxMint\nDISTRIB_RELEASE=22\nDISTRIB_CODENAME=wilma\nDISTRIB_DESCRIPTION=\"Linux Mint 22 Wilma\"\n",
            "/etc/debian_version": "trixie/sid\n"
        },
        "display-system": "x11",
        "locale": "en_US, UTF-8",
        "PATH": "/home/UsernameReplaced/apps/staroffice6.0/adabas/bin:/home/UsernameReplaced/apps/staroffice6.0/adabas/pgm:/home/UsernameReplaced/apps/staroffice6.0/adabas/bin:/home/UsernameReplaced/apps/staroffice6.0/adabas/pgm:/home/UsernameReplaced/staroffice6.0/adabas/bin:/home/UsernameReplaced/staroffice6.0/adabas/pgm:/home/UsernameReplaced/staroffice6.0/adabas/bin:/home/UsernameReplaced/staroffice6.0/adabas/pgm:/home/UsernameReplaced/apps/adabas/bin:/home/UsernameReplaced/apps/adabas/pgm:/home/UsernameReplaced/apps/adabas/bin:/home/UsernameReplaced/apps/adabas/pgm:.:~/bin/:.:/home/UsernameReplaced/bin:/bin:/opt/firefox:/opt/thunderbird:/usr/ucb:/usr/bin:/usr/local/bin:/home/UsernameReplaced/util:/home/UsernameReplaced/fmeo/util:/home/UsernameReplaced/fmeo/bin:/usr/games:/sbin:/usr/sbin:/home/UsernameReplaced/apps/wp8/wpbin:/usr/bin/X11:/usr/X11R6/bin:/home/UsernameReplaced/apps/rvplayer5.0:/home/UsernameReplaced/apps/staroffice6.0:/home/UsernameReplaced/apps/office52:/opt/moneydance:/opt/kde/bin:/usr/local/mozilla:/opt/kde3/bin:/home/UsernameReplaced/.local/bin:/home/UsernameReplaced/anaconda3/bin:/home/linuxbrew/.linuxbrew/bin:/home/UsernameReplaced/eclipse/cpp-2021-06/eclipse:/usr/share/fslint/fslint/:/home/UsernameReplaced/.cargo/bin:~/apps/wp8/wpbin",
        "RSYNC_OLD_ARGS": "(not set)",
        "RSYNC_PROTECT_ARGS": "(not set)"
    },
    "python-setup": {
        "python": "3.12.3 main Sep 11 2024 14:17:37 CPython GCC 13.2.0",
        "python-executable": "/usr/bin/python3",
        "python-executable-symlink": true,
        "python-executable-resolved": "/usr/bin/python3.12",
        "sys.path": [
            "/usr/share/backintime/qt/plugins",
            "/usr/share/backintime/common/plugins",
            "/usr/share/backintime/plugins",
            "/usr/share/backintime/common",
            "/usr/lib/python312.zip",
            "/usr/lib/python3.12",
            "/usr/lib/python3.12/lib-dynload",
            "/usr/local/lib/python3.12/dist-packages",
            "/usr/lib/python3/dist-packages"
        ],
        "qt": {
            "Version": "PyQt 5.15.10 / Qt 5.15.13",
            "Theme": "Mint-X",
            "Theme Search Paths": [
                "/home/UsernameReplaced/.icons",
                "/home/UsernameReplaced/.local/share/icons",
                "/var/lib/flatpak/exports/share/icons",
                "/usr/share/icons",
                ":/icons"
            ],
            "Fallback Theme": "",
            "Fallback Search Paths": []
        }
    },
    "external-programs": {
        "rsync": {
            "version": "3.2.7",
            "protocol": "31.0",
            "capabilities": {
                "file_bits": 64,
                "inum_bits": 64,
                "timestamp_bits": 64,
                "long_int_bits": 64,
                "socketpairs": true,
                "symlinks": true,
                "symtimes": true,
                "hardlinks": true,
                "hardlink_specials": true,
                "hardlink_symlinks": true,
                "IPv6": true,
                "atimes": true,
                "batchfiles": true,
                "inplace": true,
                "append": true,
                "ACLs": true,
                "xattrs": true,
                "secluded_args": "optional",
                "iconv": true,
                "prealloc": true,
                "stop_at": true,
                "crtimes": false
            },
            "optimizations": {
                "SIMD_roll": true,
                "asm_roll": false,
                "openssl_crypto": true,
                "asm_MD5": false
            },
            "checksum_list": [
                "xxh128",
                "xxh3",
                "xxh64",
                "md5",
                "md4",
                "sha1",
                "none"
            ],
            "compress_list": [
                "zstd",
                "lz4",
                "zlibx",
                "zlib",
                "none"
            ],
            "daemon_auth_list": [
                "sha512",
                "sha256",
                "sha1",
                "md5",
                "md4"
            ]
        },
        "ssh": "OpenSSH_9.6p1 Ubuntu-3ubuntu13.5, OpenSSL 3.0.13 30 Jan 2024",
        "sshfs": "3.7.3",
        "encfs": "(no encfs)",
        "shell": "/bin/tcsh",
        "shell-version": "tcsh 6.24.10 (Astron) 2023-04-14 (x86_64-unknown-linux) options wide,nls,dl,al,kan,sm,rh,nd,color,filec"
    }
}

Note: Most of the time I use the backintime-qt gui, and that's where I set the 1TB free space requirement. Until now, just after I updated to Mint 22, backintime has been good about keeping the free space at or above 1 TB. Also, I do not schedule snapshots, but run them manually at random intervals.

@buhtz
Copy link
Member

buhtz commented Sep 22, 2024

Hello khenty,

Thank you for taking the time to report the bug and providing the details. I appreciate your feedback, will investigate the issue, and work on a solution to the best of my ability.

I enabled smart remove in the backintime gui, for the first time.
Then I tried to run "sudo -i backintime smart-remove" from the terminal.

Why not running the remove procedure from the GUI? Just take a snapshot. Even if no new snapshot is taken (because no modifications are detected) the remove procedure is executed. Or you can remove the snapshots manually in the GUI by selecting them and then use the remove snapshot toolbotton.

How exactly do you start the GUI?

Why do you use "sudo" to start backintime?

I did get about 1.3 GB back, on a 10 TB backup drive, but all the snapshots are still there

You freed 1.3 GB but the GUI still shows all snapshots. That is wired. I have no explanation of this.

How do I get rid of these snapshots?

Use the GUI to deleted them. Run a "Take a snapthot" or select them and use the "Remove snapshot" button or menu entry.

If you can reproduce this somehow please save the terminal output for us. Also use the --debug option to make BIT more verbose.

Not sure when we'll find the time to work on it. Please see the projects background information to get an idea about our workflow and priorities:

Best regards,
Christian

@buhtz buhtz added Bug Feedback needs user response, may be closed after timeout without a response labels Sep 22, 2024
@khenty
Copy link
Author

khenty commented Sep 23, 2024

Hi, Christian,

Thanks for getting back to me.

Unfortunately, I cannot reproduce the output, because I did not save it when the error occurred. But after I posted this problem, I ran "sudo -i backintime smart-remove" three more times. The first time successfully eliminated 6 of the 11 snapshots, the second eliminated three more, and the third eliminated the remaining two. I did confirm that the error returned was 22.

I didn't realize that doing a backup from the gui would produce the same smart-remove result. Would I have had to do that four times, I wonder? And yes, I could have selected each of the 11 snapshots and removed them, but I was trying to run smart-remove overnight, and yes, it took longer than overnight the first time.

You asked how I start the gui. With a launch button on the Desktop panel, and the button triggers "sudo -i /usr/bin/backintime-qt_polkit %f". That is a bash script that doesn't appear to do much beyond checking for Wayland, then launching backintime-qt. I'll attach that.

attach.txt

This is the way backintime was installed by Linux Mint's software manager. When the backintime gui launches, it asks for my password, I assume for root permissions. As for why I used sudo on the command line, without it I get a permissions errors on some of the files backed up. I appreciate the help, and the information about your workflow! As far as I'm concerned, this issue can be closed. Glenn

@buhtz
Copy link
Member

buhtz commented Sep 23, 2024

Thank you for reporting back.

after I posted this problem, I ran "sudo -i backintime smart-remove" three more times. The first time successfully eliminated 6 of the 11 snapshots, the second eliminated three more, and the third eliminated the remaining two. I did confirm that the error returned was 22.

That makes me wonder. I don't have an explanation for this.

You asked how I start the gui. With a launch button on the Desktop panel, and the button triggers "sudo -i /usr/bin/backintime-qt_polkit %f". That is a bash script that doesn't appear to do much beyond checking for Wayland, then launching backintime-qt. I'll attach that.

The "backintime-qt_polkit" (here in the repo) script is not intended to run as root. It use pkexec to get root rights. But I assume this is not related to your problem. But I will install a Linux Mint VM and investigate that. There might be a good reason why the Mint package maintainer did it that way.

EDIT: I am assuming your Mint is based on Ubuntu/Debian. Please show me the output of this two commands please.

 apt-cache policy backintime-common
 apt-cache policy backintime-qt

EDIT2: And this command please

cat /usr/share/applications/backintime-qt-root.desktop

@buhtz buhtz removed the Feedback needs user response, may be closed after timeout without a response label Sep 23, 2024
@khenty
Copy link
Author

khenty commented Sep 25, 2024

About backintime-qt_polkit, thanks for the explanation. I don't run that as root, I only run "backintime" as root, from the command line. And yes, the backintime-qt_polkit script does ask for a password to get root privileges. I forgot about that. Yes, this Mint is based on Ubuntu and Debian. Here's the output you requested. Thank you!

backintime-common:
  Installed: 1.4.3-1
  Candidate: 1.4.3-1
  Version table:
 *** 1.4.3-1 500
        500 http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages
        500 http://archive.ubuntu.com/ubuntu noble/universe i386 Packages
        100 /var/lib/dpkg/status
backintime-qt:
  Installed: 1.4.3-1
  Candidate: 1.4.3-1
  Version table:
 *** 1.4.3-1 500
        500 http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages
        500 http://archive.ubuntu.com/ubuntu noble/universe i386 Packages
        100 /var/lib/dpkg/status
[Desktop Entry]
Name=Back In Time (root)
GenericName=Backup
Exec=/usr/bin/backintime-qt_polkit %f
Icon=document-save
Terminal=false
X-MultipleArgs=false
Type=Application
StartupNotify=true
Categories=Qt;System;
Comment=Simple backup system
Comment[de]=Ein simples Backup-Programm inspiriert von »Time Machine«, »TimeVault« und dem »flyback project«.
Comment[sl]=Enostaven sistem ustvarjanja varnostnih kopij
Keywords=automatic;snapshot;restore;rsync;root;

@buhtz
Copy link
Member

buhtz commented Sep 26, 2024

With a launch button on the Desktop panel, and the button triggers "sudo -i /usr/bin/backintime-qt_polkit %f"

Based on your last output I would say this is not true. The installed launch button (the .desktop file) do not use "sudo" in its Exec= field.

Anyway. It might be possible but I don't think that your special way of starting BIT is the reason for the problems. Currently I have no idea why the smart remove doesn't work in your case.

@buhtz buhtz added the Heisenbug a problem that is not reproducible but random (non-deterministic) label Sep 26, 2024
@buhtz buhtz added this to the 2nd release from now milestone Sep 26, 2024
@khenty
Copy link
Author

khenty commented Oct 13, 2024

Smart remove mostly seems to be working, now that I have eliminated a number of snapshots. I would like to suggest that the gui allow more than 1TB as a requirement for available space on the backup media. If you have several systems on your desktop, 1TB might not be sufficient. I say this because although smart-remove appears to be working, and I run backintime daily now, backintime has exhausted disk space twice since my previous comment two weeks ago. There may be a better solution for this, but right now it seems to me that increasing the amount of required available space might help smart-remove.

diagnostics.txt

@buhtz buhtz changed the title command line smart-remove doesn't remove snapshots Smart-remove (cli) doesn't remove snapshots Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Heisenbug a problem that is not reproducible but random (non-deterministic)
Projects
None yet
Development

No branches or pull requests

2 participants