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
1.93k stars 182 forks source link

with using udev: "com.ubuntu.DeviceDriver.PermissionDeniedByPolicy: net.launchpad.backintime.UdevRuleSave" #1719

Closed jalsti closed 2 months ago

jalsti commented 2 months ago

When trying to set udev rules in backintime-qt, so that it starts if the matching disk is attached, the message "com.ubuntu.DeviceDriver.PermissionDeniedByPolicy: net.launchpad.backintime.UdevRuleSave" appears, as soon as clicking 'OK', and nothing gets saved. When configuring manually via config file, to use udev, and having set up the rule manually, the same message appears already when entering the profile via GUI, after BIT start.

Devuan .deb package version 1.3.3-4
{
    "backintime": {
        "name": "Back In Time",
        "version": "1.3.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": false
    },
    "host-setup": {
        "platform": "Linux-6.1.0-21-amd64-x86_64-with-glibc2.36",
        "system": "Linux #1 SMP PREEMPT_DYNAMIC Debian 6.1.90-1 (2024-05-03)",
        "os-release": {
            "NAME": "Devuan GNU/Linux",
            "ID": "devuan",
            "PRETTY_NAME": "Devuan GNU/Linux 5 (daedalus)",
            "VERSION_ID": "5",
            "VERSION": "5 (daedalus)",
            "VERSION_CODENAME": "daedalus",
            "ID_LIKE": "debian",
            "HOME_URL": "https://www.devuan.org/",
            "SUPPORT_URL": "https://devuan.org/os/community",
            "BUG_REPORT_URL": "https://bugs.devuan.org/"
        },
        "display-system": "x11",
        "locale": "de_DE, UTF-8",
        "PATH": "/usr/local/cuda/bin:/usr/local/cuda/nsight-compute-2019.5.0:/home/UsernameReplaced/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/home/UsernameReplaced/script:/usr/games:/home/UsernameReplaced:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/:/usr/NX/bin/:/opt/cisco/anyconnect/bin/:/home/UsernameReplaced/studium/bin:/home/UsernameReplaced/.wine/drive_c/Programme/IrfanView:/opt/sage:/opt/yEd:/home/UsernameReplaced/projekte/chip/bin:/usr/lib/i386-linux-gnu/wine/wine/fakedlls/:/usr/lib/x86_64-linux-gnu/wine/wine/fakedlls/:/home/UsernameReplaced/.local/bin/:/opt/miniconda/bin/:/home/UsernameReplaced/download/gurobi/gurobi910/linux64/bin:/home/UsernameReplaced/.local/share/JetBrains/Toolbox/scripts",
        "RSYNC_OLD_ARGS": "(not set)",
        "RSYNC_PROTECT_ARGS": "(not set)"
    },
    "python-setup": {
        "python": "3.11.2 main Mar  2 2024 20:28:50 CPython GCC 12.2.0",
        "python-executable": "/usr/bin/python3",
        "python-executable-symlink": true,
        "python-executable-resolved": "/usr/bin/python3.11",
        "sys.path": [
            "/usr/share/backintime/qt/plugins",
            "/usr/share/backintime/common/plugins",
            "/usr/share/backintime/plugins",
            "/usr/share/backintime/common",
            "/usr/lib/python311.zip",
            "/usr/lib/python3.11",
            "/usr/lib/python3.11/lib-dynload",
            "/usr/local/lib/python3.11/dist-packages",
            "/usr/lib/python3/dist-packages"
        ],
        "qt": "PyQt 5.15.9 / Qt 5.15.8"
    },
    "external-programs": {
        "rsync": {
            "program": "rsync",
            "version": "3.2.7",
            "protocol": "31.0",
            "copyright": "(C) 1996-2022 by Andrew Tridgell, Wayne Davison, and others.",
            "url": "https://rsync.samba.org/",
            "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"
            ],
            "license": "GPLv3",
            "caveat": "rsync comes with ABSOLUTELY NO WARRANTY"
        },
        "ssh": "OpenSSH_9.2p1 Debian-2+deb12u2, OpenSSL 3.0.13 30 Jan 2024",
        "sshfs": "3.7.3",
        "encfs": "(no encfs)",
        "shell": "/bin/bash",
        "shell-version": "GNU bash, Version 5.2.15(1)-release (x86_64-pc-linux-gnu)"
    }
}
buhtz commented 2 months ago

Hello jalsti,

Thank you for taking the time to report the bug and providing the details.

Is this the first time you do use Back In Time or the first time you use it on a Devuan system?

Can you please ask in the Devuan community about this error message? Might be that it is a Devuan specific security setting.

Best regards, Christian

EDIT: Found the error string in #1008 but do not see how this could help.

aryoda commented 2 months ago

This is related to our serviceHelper.py and must be a configuration, installation or special hardening/setting thing:

https://github.com/bit-team/backintime/blob/c9c805ab134f62dc82c0be358b54d32465b6396a/qt/serviceHelper.py#L94-L95

https://github.com/bit-team/backintime/blob/c9c805ab134f62dc82c0be358b54d32465b6396a/qt/serviceHelper.py#L273-L310

https://github.com/bit-team/backintime/blob/c9c805ab134f62dc82c0be358b54d32465b6396a/common/tools.py#L2328-L2341

I am not sure how to find the exact reason for the exception but debugging our code won't help I guess.

buhtz commented 2 months ago

I thought the same. It seems that Devuan don't have a distro specific package for Back In Time. Debians package (incl. its maintainer) is used. My suggestion would be to first ask the Devuan community instead of opening a ticket at Debian.

jalsti commented 2 months ago

EDIT: Found the error string in #1008 but do not see how this could help.

Actually this might help(?), because I use an older config where the old backup disk does not exist anymore, and a new, empty, one is taken. So this is more like 'changing backup destination'. I will try a new backup profile and see what happens.

(By the way: Devuan is basically a Debian version with stripped systemd dependencies, so, yes, most packages are original Debian ones.)

jalsti commented 2 months ago

I will try a new backup profile and see what happens.

Does not change anything, when trying to save, the error appears. (Funnily in the meantime, even before removing config folders, I could not reproduce the part where the error pops up in switching the profile in the settings anymore, although it came up many times.)

buhtz commented 2 months ago

(By the way: Devuan is basically a Debian version with stripped systemd dependencies, so, yes, most packages are original Debian ones.)

My thought where that there might be Devuan specific security settings causing the problem. In this case a Devuan specific package maintainer would be more helpful then a Debian one. Additionally to that "our" Debian maintainer is not very responsive.

jalsti commented 2 months ago

I posted at the Devuan mailing list https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng – for now closing this here, thx all.

buhtz commented 2 months ago

Ok, thank you. Feel free to re-open if we can be of assistance.

aryoda commented 2 months ago

I think it could be helpful to extract the exact error message of dbus (not the BiT stacktrace) from the system log to help the devuan community to identify the problem:

Run BiT until the error occurs and then use journalctl --since "1 minute ago" | grep -i backintime (you can adjust the minutes accordingly). There you must find a dbus policy (or polkit) error that may be helpful.

It would also be helpful to post this log output here (for other users with the same problem to find this issue and because I am curious ;-)