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.14k stars 210 forks source link

Tray icon no longer appears for crontab jobs #1955

Open protist opened 1 week ago

protist commented 1 week ago

In the past, the tray icon has appeared when backup-job is run from the crontab. However, this now fails.

I can see the icon if I manually run from the CLI: /usr/bin/nice -n19 /usr/bin/ionice -c2 -n7 /usr/bin/backintime backup-job.

However, having the exact same line in my (user) crontab fails.

I also tried launching the GUI in advance, then letting the crontab trigger, but there was still no tray icon.

$ backintime --diagnostics
QSettings::value: Empty key passed
{
    "backintime": {
        "name": "Back In Time",
        "version": "1.5.3",
        "running-as-root": false,
        "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",
        "user-callback": "/home/UsernameReplaced/.config/backintime/user-callback",
        "keyring-supported": true
    },
    "host-setup": {
        "OS": {
            "/etc/os-release": "Arch Linux",
            "/etc/arch-release": "\n",
            "/etc/lsb-release": "DISTRIB_ID=\"Arch\"\nDISTRIB_RELEASE=\"rolling\"\nDISTRIB_DESCRIPTION=\"Arch Linux\"\n"
        },
        "platform": "Linux-6.12.1-arch1-1-x86_64-with-glibc2.40",
        "system": "Linux #1 SMP PREEMPT_DYNAMIC Fri, 22 Nov 2024 16:04:27 +0000",
        "display-system": "wayland",
        "locale": "en_AU, UTF-8",
        "PATH": "/home/UsernameReplaced/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl",
        "RSYNC_OLD_ARGS": "1",
        "RSYNC_PROTECT_ARGS": "(not set)"
    },
    "python-setup": {
        "python": "3.12.7 main Oct  1 2024 11:15:50 CPython GCC 14.2.1 20240910",
        "python-executable": "/usr/bin/python",
        "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/lib/python3.12/site-packages"
        ],
        "qt": {
            "Version": "PyQt 6.8.0.dev2410211537 / Qt 6.8.0",
            "Theme": "breeze",
            "Theme Search Paths": [
                "/home/UsernameReplaced/.local/share/icons",
                "/usr/share/icons",
                "/home/UsernameReplaced/.icons",
                ":/icons"
            ],
            "Fallback Theme": "breeze",
            "Fallback Search Paths": []
        }
    },
    "external-programs": {
        "rsync": {
            "version": "3.3.0",
            "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.9p1, OpenSSL 3.4.0 22 Oct 2024",
        "sshfs": "3.7.3",
        "encfs": "1.9.5",
        "shell": "/usr/bin/zsh",
        "shell-version": "zsh 5.9 (x86_64-pc-linux-gnu)"
    }
}

Installed from the AUR.

buhtz commented 1 week ago

Hello protist, Thank you for taking the time and reporting this issue. I am sorry, but currently I am not able to provide a solution nor an analysis myself. I am not deep enough into the systray topic. Currently I am more consumed by other BIT-related topics like smartremove, gocryptfs and config management.

But beside the systray thing I am interested in this line from your diagnostics output.

QSettings::value: Empty key passed

I have never seen this before. Do you have any idea what this is about? Can you reproduce it?

Maybe try backintime --diagnostics --debug.

EDIT: You can help me out. If you can reproduce the QSettings error please edit the file common/diagnostics.py around line 208. Please modify this line...

qapp = PyQt6.QtWidgets.QApplication([])

into this (adding an empty string as list element)

qapp = PyQt6.QtWidgets.QApplication([''])

Then the QSettings error should go away? Am I right?

protist commented 1 week ago

I have never seen this before. Do you have any idea what this is about?

No idea! FWIW it's displayed in STDERR, not STDOUT.

Can you reproduce it?

Yes, happens every time. In fact, I'm on a different system, and it's happening here too.

Maybe try backintime --diagnostics --debug.

Nothing changed. The same error appeared.

Then the QSettings error should go away? Am I right?

I changed the file as suggested, but the error persisted.

buhtz commented 1 week ago

Thank you for trying and reporting back.