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

Tray icon no longer or don't appears for crontab jobs (1.5.3, 1.3.3) #1955

Open
protist opened this issue Dec 2, 2024 · 5 comments
Open
Assignees
Labels
Bug HELP-WANTED Used by 24pullrequests.com to suggest issues High Notifications desktop, email, GUI/tray status messages

Comments

@protist
Copy link

protist commented Dec 2, 2024

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
Copy link
Member

buhtz commented Dec 2, 2024

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?

@buhtz buhtz added Bug Notifications desktop, email, GUI/tray status messages HELP-WANTED Used by 24pullrequests.com to suggest issues labels Dec 2, 2024
@protist
Copy link
Author

protist commented Dec 3, 2024

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
Copy link
Member

buhtz commented Dec 3, 2024

Thank you for trying and reporting back.

@buhtz buhtz changed the title [Regression] Tray icon no longer appears for crontab Tray icon no longer appears for crontab jobs Dec 3, 2024
@buhtz buhtz added the High label Dec 13, 2024
@buhtz
Copy link
Member

buhtz commented Dec 13, 2024

Hey protist,
did the systray icon appeared in the past? Is this a new behavior/bug for you?

Stumbled across a similar behavior in older BIT 1.3.3. No backups are taken on a desktop system (Debian 12, XFCE) for weeks. I never noticed a warning in a systray bubble.

This reminds me on some other issues and comments about how BIT does (not) inform users about failing backups. There are multiple ways but systray is one of them.

This part of the code base is unknown to me so I have to investigate it first. Regarding to some other issues and the release plan this might not happen very soon. But I a modified the milestone and increased the priority of that issue.

@buhtz buhtz changed the title Tray icon no longer appears for crontab jobs Tray icon no longer or don't appears for crontab jobs (1.5.3, 1.3.3) Dec 13, 2024
@buhtz buhtz self-assigned this Dec 13, 2024
@protist
Copy link
Author

protist commented Dec 15, 2024

did the systray icon appeared in the past? Is this a new behavior/bug for you?

Yes, this is a regression. In my original report:

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

This reminds me on some other issues and comments about how BIT does (not) inform users about failing backups.

I totally agree. I've had a few occasions where backups haven't worked for various reasons. Usually it's where there are bugs in the code, or a network disconnection. However, the last time was when I wrote bad code in my user-callback script, and I didn't have any backups for 5 months. This was on a server though, so here a tray icon wouldn't have helped. I'd love the option of specifying how to get errors reported to the user, e.g. via system mail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug HELP-WANTED Used by 24pullrequests.com to suggest issues High Notifications desktop, email, GUI/tray status messages
Projects
None yet
Development

No branches or pull requests

2 participants