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.07k stars 203 forks source link

Systray icon missing / empty #1236

Closed Anard closed 1 year ago

Anard commented 2 years ago

Hi. When backintime is recording a snapshot, I have no information about it. Should it be possible that when taking a snapshot an icon with progress bar appears in the notification bar ? OS : Gentoo 2.7, profile amd64/17.1/desktop DE : Xfce 4.16 Kernel : 5.15.26

PS : thx to emtiu for taking this project alive back :+1:

gsker commented 2 years ago

I'm surprised you don't.
Thanks for the desktop details. Can you say how you are running the snapshot?
A scheduled job? Manually via the GUI? Command line? As your regular user? Or as root? The icon changes based on my theme, but this is what it looks like now in my daily desktop (NOT Xfce4) image The 3.5" diskette icon is the backintime backup running.

My tray is trayer And running from an at job as root I see this in my ps output:

I am not logged in as root though -- so the system did something as to figure out where my X11 desktop was.

I have xfce4 4.16 installed and will try it and see if I see it there. It's not my daily environment....

Tested logged in as my regular user in xfce4 4.16 in Debian. Here's the cron line and a manaul run sudoed to a root shell: 2022-03-20_09-27

And the icon shows up in my panel: 2022-03-20_09-26

Prodeguerriero commented 2 years ago

Hi all,

I have a similar request/question: I have just started using Back in Time on a fresh Ubuntu 21.10 install, and I set it up using the GUI to run at startup. If I open the GUI, I can see the back-up running (by looking at the log), but I don't see any system indicator telling me the job is indeed running.

If I stop the snapshot and start a new one, then the icon appears on the top right and I can interact with the job (pause, stop, etc.)

emtiu commented 2 years ago

I have a similar request/question: I have just started using Back in Time on a fresh Ubuntu 21.10 install, and I set it up using the GUI to run at startup. If I open the GUI, I can see the back-up running (by looking at the log), but I don't see any system indicator telling me the job is indeed running.

If I stop the snapshot and start a new one, then the icon appears on the top right and I can interact with the job (pause, stop, etc.)

Could you share a screenshot showing the problem? Do you know which desktop environment you are using?

Prodeguerriero commented 2 years ago

2022-03-25_17-00

See the icon on the top right corner, that appears if I manually start a sync job. But it does not appear when I boot and the job starts automatically.

My GNOME version is 40.4.0

Anard commented 2 years ago

I confirm I still have no notification in taskbar when BiT takes a snapshot. Even launched by cron task, manually via GUI or manually via command line... https://imgur.com/u2w5ZU2.png

Anard commented 2 years ago

One thing more, it could be interesting too to have an access to BackInTime in systray even if it's not taking a snapshot. As do TimeMachine on macOS, allowing to launch BiT or take a snapshot instantly without launching the app.

KMouratidis commented 2 years ago

I had this issue too (link). For me it seems to have been an issue with root's cron jobs. I fixed mine by exporting another variable in /usr/bin/backintime-qt, like this:

... LICENSE ...

#fixing gray window error
#https://launchpad.net/bugs/1493020
export QT_GRAPHICSSYSTEM="native"

### ADD THIS
export QT_QPA_PLATFORMTHEME=qt5ct

CUR_PATH="$(dirname $(readlink -m $0))"

... CODE TO LAUNCH APP ...

I also installed qt5ct but it didn't have any effect on its own. That said, I couldn't get snapshots started with root / backintime-qt_polkit to work even with that variable. It seemed like a backintime-qt_polkit or pkexec issue, but have no idea how to tell.

Anard commented 2 years ago

Still no systray icon but icons in BiT window disappeared (replaced by text) with this export QT_QPA_PLATFORMTHEME=qt5ct

emtiu commented 2 years ago

Hi, thanks for your reports. This is a very tricky issue to debug, I've tried to summarize current knowledge in #1306.

For all of those affected, it would help if you could:

  1. Check if this problem still affects you, and if yes:
  2. Please give your:
    • backintime version,
    • distro and version,
    • Desktop Environment and version (or window/tray manager if you don't have a DE)
    • graphics server (X11 or Wayland).
  3. More log output, if you find something the looks relevant.

Thanks a lot! :)

aryoda commented 1 year ago

Could you please help me to identify the reason for the missing system tray icon by following these instructions:

https://github.com/bit-team/backintime/issues/1306#issuecomment-1321230648

THX a lot!

Anard commented 1 year ago

Here is the what I got when launching a snapshot from command line, but no systray icon at all :

$ backintime --profile-id 1 --debug backup-job
DEBUG: [common/backintime.py:583 argParse] Arguments: {'debug': True, 'profile_id': 1, 'command': 'backup-job', 'func': <function backupJob at 0x7fa6f9709000>} | unknownArgs: []
DEBUG: [common/tools.py:2068 BackupJobDaemon.daemonize] first fork pid: 13313
DEBUG: [common/tools.py:2068 BackupJobDaemon.daemonize] first fork pid: 0
DEBUG: [common/tools.py:2077 BackupJobDaemon.daemonize] decouple from parent environment
DEBUG: [common/tools.py:2085 BackupJobDaemon.daemonize] second fork pid: 13314
DEBUG: [common/tools.py:2085 BackupJobDaemon.daemonize] second fork pid: 0
DEBUG: [common/tools.py:2094 BackupJobDaemon.daemonize] redirect standard file descriptors

Back In Time
Version: 1.3.2

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/anard/.config/backintime/config
DEBUG: [common/backintime.py:671 getConfig] share path: /home/anard/.local/share/backintime
DEBUG: [common/backintime.py:672 getConfig] profiles: 1=Profil principal
DEBUG: [common/configfile.py:529 Config.setCurrentProfile] change current profile: 1=Profil principal
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
INFO: [common/snapshots.py:634 Snapshots.backup] Lock
DEBUG: [common/tools.py:1188 inhibitSuspend] Inhibit Suspend started. Reason: take snapshot
anard@imack ☕ ~ $ DEBUG: [common/tools.py:829 keyringSupported] No appropriate keyring found. 'keyring.backends.chainer' can't be used with BackInTime
DEBUG: [common/mount.py:73 Mount.__init__] pw-cache is not running
DEBUG: [common/mount.py:81 Mount.__init__] Call command: /usr/bin/backintime pw-cache start
INFO: [common/snapshots.py:665 Snapshots.backup] Take a new snapshot. Profile: 1 Profil principal
INFO: [common/snapshots.py:1022 Snapshots.takeSnapshot] Call rsync to take the snapshot
DEBUG: [common/snapshots.py:692 Snapshots.backup] Call command "rsync --recursive --times --devices --specials --hard-links --human-readable --links --perms --executability --group --owner --info=progress2 --no-inc-recursive --delete --delete-excluded -v -i --out-format=BACKINTIME: %i %n%L --link-dest=../../20221120-200001-550/backup --chmod=Du+wx --exclude=/media/Saver --exclude=/home/anard/.local/share/backintime --exclude=.local/share/backintime/mnt --include=/home/anard/ --include=/home/ --include=/media/Medias/ --include=/media/ --exclude=.gvfs --exclude=.cache/* --exclude=.thumbnails* --exclude=.local/share/[Tt]rash* --exclude=*.backup* --exclude=*~ --exclude=.dropbox* --exclude=lost+found/* --exclude=.Private --exclude=/media/Medias/TRANSFERTS --exclude=/media/Medias/.* --exclude=/home/anard/Applications/gentoo --exclude=/media/Medias/Acquisitions/temp* --exclude=/media/Medias/Installeurs/INSTALL_macOS/CloverBootloader --include=/home/anard/** --include=/media/Medias/** --exclude=* / /media/Saver/backintime/imack/anard/1/new_snapshot/backup"
DEBUG: [common/snapshots.py:692 Snapshots.backup] Command "rsync --recursiv..." returns 0
INFO: [common/snapshots.py:838 Snapshots.backupConfig] Save config file
INFO: [common/snapshots.py:884 Snapshots.backupPermissions] Save permissions
DEBUG: [common/snapshots.py:1069 Snapshots.takeSnapshot] Call command "rsync --dry-run -r --out-format=%n /media/Saver/backintime/imack/anard/1/new_snapshot/backup/ /tmp/tmpyw59b_2v/"
DEBUG: [common/snapshots.py:276 Snapshots.userName] Failed to get user name for UID 99: 'getpwuid(): uid not found: 99'
DEBUG: [common/snapshots.py:301 Snapshots.groupName] Failed to get group name for GID 99: 'getgrgid(): gid not found: 99'
DEBUG: [common/snapshots.py:1069 Snapshots.takeSnapshot] Command "rsync --dry-run ..." returns 0
INFO: [common/snapshots.py:860 Snapshots.backupInfo] Create info file
DEBUG: [common/tools.py:1122 writeTimeStamp] write timestamp '20221121 0849' into file '/home/anard/.local/share/backintime/anacron/1_Profil_principal'
DEBUG: [common/snapshots.py:1738 Snapshots.createLastSnapshotSymlink] Create symlink /media/Saver/backintime/imack/anard/1/last_snapshot => 20221121-084740-210
DEBUG: [common/snapshots.py:1408 Snapshots.freeSpace] Remove snapshots older than: 20171101-000000
DEBUG: [common/snapshots.py:1230 Snapshots.smartRemoveList] Considered: [20221121-084740-210, 20221120-200001-550, 20221120-160001-118, 20221120-120002-372, 20221119-200001-896, 20221119-160002-329, 20221119-120001-505, 20221116-080001-900, 20221112-200001-278, 20221106-200001-940, 20221031-200002-654, 20221029-200002-532, 20220930-200001-172, 20220830-200001-764]
DEBUG: [common/snapshots.py:1121 Snapshots.smartRemoveKeepAll] Keep all >= 20221120-000000-590 and < 20221122-000000-367
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20221121-000000-759 and < 20221122-000000-607
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20221120-000000-186 and < 20221121-000000-125
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20221119-000000-768 and < 20221120-000000-739
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20221118-000000-267 and < 20221119-000000-965
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20221118-000000-434 and < 20221119-000000-304
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20221117-000000-816 and < 20221118-000000-354
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20221117-000000-783 and < 20221118-000000-868
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20221116-000000-149 and < 20221117-000000-695
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20221115-000000-208 and < 20221116-000000-155
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20221115-000000-498 and < 20221116-000000-904
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20221120-000000-383 and < 20221128-000000-322
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20221113-000000-775 and < 20221121-000000-970
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20221106-000000-121 and < 20221114-000000-731
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20221030-000000-618 and < 20221107-000000-915
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20221101-000000-738 and < 20221201-000000-252
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20221001-000000-949 and < 20221101-000000-514
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20220901-000000-808 and < 20221001-000000-944
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20220801-000000-676 and < 20220901-000000-118
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20220701-000000-546 and < 20220801-000000-471
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20220701-000000-662 and < 20220801-000000-772
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20220601-000000-102 and < 20220701-000000-507
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20220601-000000-476 and < 20220701-000000-956
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20220501-000000-439 and < 20220601-000000-409
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20220501-000000-354 and < 20220601-000000-538
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20220401-000000-986 and < 20220501-000000-948
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20220401-000000-507 and < 20220501-000000-608
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20220301-000000-525 and < 20220401-000000-446
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20220301-000000-892 and < 20220401-000000-921
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20220201-000000-593 and < 20220301-000000-863
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20220201-000000-121 and < 20220301-000000-816
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20220101-000000-655 and < 20220201-000000-154
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20220101-000000-403 and < 20220201-000000-681
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20211201-000000-443 and < 20220101-000000-556
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20211201-000000-311 and < 20220101-000000-659
DEBUG: [common/snapshots.py:1149 Snapshots.smartRemoveKeepFirst] Keep first >= 20220101-000000-901 and < 20230101-000000-139
DEBUG: [common/snapshots.py:1287 Snapshots.smartRemoveList] Keep snapshots: {20221120-120002-372, 20220930-200001-172, 20221106-200001-940, 20221112-200001-278, 20221120-200001-550, 20221031-200002-654, 20221120-160001-118, 20221116-080001-900, 20221119-200001-896, 20221121-084740-210, 20220830-200001-764}
INFO: [common/snapshots.py:1375 Snapshots.smartRemove] [smart remove] remove snapshots: [20221119-160002-329, 20221119-120001-505, 20221029-200002-532]
DEBUG: [common/snapshots.py:1379 Execute.smartRemove] Call command "rsync -a --delete /tmp/tmpsu8x3yl_/ /media/Saver/backintime/imack/anard/1/20221119-160002-329"
DEBUG: [common/snapshots.py:1379 Execute.smartRemove] Command "rsync -a --delet..." returns 0
DEBUG: [common/snapshots.py:1379 Execute.smartRemove] Call command "rsync -a --delete /tmp/tmp90f45z0b/ /media/Saver/backintime/imack/anard/1/20221119-120001-505"
DEBUG: [common/snapshots.py:1379 Execute.smartRemove] Command "rsync -a --delet..." returns 0
DEBUG: [common/snapshots.py:1379 Execute.smartRemove] Call command "rsync -a --delete /tmp/tmp11ip82qp/ /media/Saver/backintime/imack/anard/1/20221029-200002-532"
DEBUG: [common/snapshots.py:1379 Execute.smartRemove] Command "rsync -a --delet..." returns 0
DEBUG: [common/snapshots.py:1443 Snapshots.freeSpace] Keep min free disk space: 1024 MiB
DEBUG: [common/snapshots.py:1477 Snapshots.freeSpace] Keep min 2%% free inodes
DEBUG: [common/tools.py:829 keyringSupported] No appropriate keyring found. 'keyring.backends.chainer' can't be used with BackInTime
DEBUG: [common/mount.py:73 Mount.__init__] pw-cache is not running
DEBUG: [common/mount.py:81 Mount.__init__] Call command: /usr/bin/backintime pw-cache start
INFO: [common/snapshots.py:739 Snapshots.backup] Unlock
DEBUG: [common/tools.py:1208 unInhibitSuspend] Release inhibit Suspend
aryoda commented 1 year ago

@Anard THX for the debug output! Could you please also execute the other script (python3 ...) from my comment (sorry, did not ask clear enough for this in my comment)

aryoda commented 1 year ago

Still no systray icon but icons in BiT window disappeared (replaced by text) with this export QT_QPA_PLATFORMTHEME=qt5ct

This would only work

For details see: https://github.com/bit-team/backintime/issues/1240#issuecomment-1321233476

But before trying this I would be interested in the diagnostics output of my prev. comment to "hunt down" the bug.

Anard commented 1 year ago

Oh OK, sry : Before installing qt5ct

$ python3 -c "
from PyQt5.QtGui import QIcon;
from PyQt5.QtWidgets import QSystemTrayIcon,QApplication,QStyleFactory;
import os
qapp = QApplication(['']);
env_var = 'XDG_SESSION_TYPE'; print(f'Display Server={os.environ.get(env_var)}');
print((f'QT QPA platform plugin: {qapp.platformName()}'));
env_var = 'QT_QPA_PLATFORMTHEME'; print(f'QT_QPA_PLATFORMTHEME={os.environ.get(env_var)}');
env_var = 'QT_STYLE_OVERRIDE'; print(f'QT_QPA_PLATFORMTHEME={os.environ.get(env_var)}');
print(f'QT active style: {qapp.style().objectName()}');
print(f'QT fallback style: {QIcon.fallbackThemeName()}');
print(f'QT supported styles: {QStyleFactory.keys()}');
print(f'themeSearchPaths: {str(QIcon.themeSearchPaths())}');
print(f'fallbackSearchPaths: {str(QIcon.fallbackSearchPaths())}');
print(f'Is SystemTray available: {str(QSystemTrayIcon.isSystemTrayAvailable())}');"
Display Server=x11
QT QPA platform plugin: xcb
QT_QPA_PLATFORMTHEME=None
QT_QPA_PLATFORMTHEME=None
QT active style: fusion
QT fallback style: 
QT supported styles: ['Windows', 'Fusion']
themeSearchPaths: ['/home/anard/.icons', '/home/anard/.local/share/icons', '/var/lib/flatpak/exports/share/icons', '/usr/local/share/icons', '/usr/share/icons', ':/icons']
fallbackSearchPaths: []
Is SystemTray available: True

And after :

$ python3 -c "
from PyQt5.QtGui import QIcon;
from PyQt5.QtWidgets import QSystemTrayIcon,QApplication,QStyleFactory;
import os
qapp = QApplication(['']);
env_var = 'XDG_SESSION_TYPE'; print(f'Display Server={os.environ.get(env_var)}');
print((f'QT QPA platform plugin: {qapp.platformName()}'));
env_var = 'QT_QPA_PLATFORMTHEME'; print(f'QT_QPA_PLATFORMTHEME={os.environ.get(env_var)}');
env_var = 'QT_STYLE_OVERRIDE'; print(f'QT_QPA_PLATFORMTHEME={os.environ.get(env_var)}');
print(f'QT active style: {qapp.style().objectName()}');
print(f'QT fallback style: {QIcon.fallbackThemeName()}');
print(f'QT supported styles: {QStyleFactory.keys()}');
print(f'themeSearchPaths: {str(QIcon.themeSearchPaths())}');
print(f'fallbackSearchPaths: {str(QIcon.fallbackSearchPaths())}');
print(f'Is SystemTray available: {str(QSystemTrayIcon.isSystemTrayAvailable())}');"
Display Server=x11
QT QPA platform plugin: xcb
QT_QPA_PLATFORMTHEME=None
QT_QPA_PLATFORMTHEME=None
QT active style: fusion
QT fallback style: 
QT supported styles: ['qt5ct-style', 'Windows', 'Fusion']
themeSearchPaths: ['/home/anard/.icons', '/home/anard/.local/share/icons', '/var/lib/flatpak/exports/share/icons', '/usr/local/share/icons', '/usr/share/icons', ':/icons']
fallbackSearchPaths: []
Is SystemTray available: True

Maybe I need to logout and login again now

Anard commented 1 year ago

After reboot, I have

QT_QPA_PLATFORMTHEME=qt5ct
QT_QPA_PLATFORMTHEME=None
QT active style: qt5ct-style

but still no systray icon when launching BiT with command line

aryoda commented 1 year ago

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

In the debug log output I cannot see that the required qt4plugin.py is loaded which is triggering the sys tray icon.

Could you please check if the qt4plugin.py file exists in the folder /usr/share/backintime/plugins

If it does not exist we have to check how the Gentoo pkg maintainer installs this. Edit: If you have installed BiT with qt5 via this package I think the installation should be correct: https://gitweb.gentoo.org/repo/gentoo.git/tree/app-backup/backintime/backintime-1.3.2.ebuild

Please also check xdpyinfo > /dev/null && echo $? which must show an exit code of 0 (zero). This util is used internally by BiT to discover the existence of an X11 server and without that the qt4plugin is not loaded...

https://github.com/bit-team/backintime/blob/713590f45cb83d1192a104ec77b735626b573006/qt/plugins/qt4plugin.py#L42-L47

https://github.com/bit-team/backintime/blob/713590f45cb83d1192a104ec77b735626b573006/common/tools.py#L466-L480

Anard commented 1 year ago

Hi. Yes I have the python qt4 plugin but not the xdpyinfo command :

$ ls /usr/share/backintime/plugins/
__pycache__  notifyplugin.py  qt4plugin.py  usercallbackplugin.py
$ xdpyinfo > /dev/null && echo $?
bash: xdpyinfo : commande introuvable
$

Thanks

aryoda commented 1 year ago

@anard Strike :-)

Could you please edit the file /usr/share/backintime/plugins/qt4plugin.py

https://github.com/bit-team/backintime/blob/713590f45cb83d1192a104ec77b735626b573006/qt/plugins/qt4plugin.py#L42-L47

and comment (disable) the above lines 45 and 46

#     if not tools.checkXServer(): 
#         return False 

You should now see the sys tray icon eg. by calling backintime --profile-id 1 --debug backup-job...

PS: If you do not want to edit the installed qt4plugin.py file you could also install the package x11-utils which contains xdpyinfo (this is the package name on Ubuntu, it may be different for your distro). Edit: x11-apps pkg on Gentoo...

Edit: I have updated above code change (was totally wrong) but is OK now. Installing the package with xdpyinfo is the easiest way anyhow.

aryoda commented 1 year ago

@Prodeguerriero

See the icon on the top right corner, that appears if I manually start a sync job. But it does not appear when I boot and the job starts automatically.

Could please give me more background:

  1. How do you start Bit GUI (as user or root)?
  2. How do you manually start the job (I need the exact cmd line)?
  3. How does the job start automatically after booting? Via cron job? Please show the relevant cron job entry (crontab -e) and if it is running as root or user
  4. Please provide me with the output of the diagnostics scripts from my other comment at the master issue
Anard commented 1 year ago

Nice :) thanks :+1: Anyway, commenting 45 & 46 lines in /usr/share/backintime/plugins/qt4plugin.py works (of course).

Finally, I found xdpyinfo in gentoo's overlay which is x11-apps/xdpyinfo package (x11-apps is category, xdpyinfo is the package). It should be added to BackInTime's ebuild for Gentoo in RDEPEND variable.

EDIT : With this package installed, systray icon now works well without commented lines in qt4plugins.py. Thanks again.

aryoda commented 1 year ago

Finally, I found xdpyinfo in gentoo's overlay which is x11-apps/xdpyinfo package (x11-apps is category, xdpyinfo is the package).

Great to hear that + thx for your bug hunting support and publishing the missing package here! I will extend our dependency description here in the Github README.md to make this weak dependency explicit.

It should be added to BackInTime's ebuild for Gentoo in RDEPEND variable.

This is out of my (our) control here, we are "just" the BiT developers, not package maintainers.

I tried to find the Gentoo package maintainer but it seems the package is orphaned:

https://packages.gentoo.org/packages/app-backup/backintime

-> email to: maintainer-needed@gentoo.org

Do you know more (eg. is the pkg maintainer displayed in the pkg mgmt tool in Gentoo)?

My next steps:

  1. TODO Check if the xdpyinfo call is required at all since the on my Manjaro KDE Plasma VM the sys tray icon is also shown on Wayland (not only X11)
  2. TODO Extend our dependency description here in the Github README.md with xdpyinfo (if the X11 restriction should be required at all)
  3. TODO Prepare a fix
Anard commented 1 year ago

No maintainer recorded :

$ equery m backintime
 * app-backup/backintime [gentoo]
Maintainer:  None specified
Upstream:    None specified
Homepage:    https://backintime.readthedocs.io/en/latest/
Homepage:    https://github.com/bit-team/backintime/
Location:    /var/db/repos/gentoo/app-backup/backintime
Keywords:    1.3.1:0: 
Keywords:    1.3.2:0: amd64 x86
Keywords:    9999:0: 
License:     GPL-2

But I just sent a bug on bugs.gentoo.org : https://bugs.gentoo.org/882529

Anard commented 1 year ago

Hi back. It works now fine when launching BiT from command line or from gui. But launched from crontab, it show a blank icon in systray : https://imgur.com/MHqmh0r.png

aryoda commented 1 year ago

But launched from crontab, it show a blank icon in systray

Can you please show me the relevant cron job entry (crontab -e) and indicate if it is running as root or user?

Cron jobs are a little bit tricky since the shell environment may not be exactly the same as run as user and env vars may be different or missing.

Perhaps you could add

env > ~/cron_env.txt

into the starter script /usr/bin/backintime which is normally called by the cron job.

After the cron job has started at least once (do NOT start BiT manually after that until you have executed below code) you could compare the shell environment of the cron job with that of your user login via:

env > ~/user_env.txt
diff <(sort cron_env.txt) <(sort user_env.txt)

Then please post this output here so that we can try to find a solution.

Anard commented 1 year ago

Sorry for late :)

Crontab entry : 0 */4 * * * /usr/bin/nice -n19 /usr/bin/ionice -c2 -n7 /usr/bin/backintime backup-job >/dev/null Send from user, but I have the same problem with root's crontab

$ diff <(sort cron_env.txt) <(sort user_env.txt)
0a1,3
> COLORTERM=truecolor
> CONFIG_PROTECT=/usr/share/gnupg/qualified.txt /usr/share/config /usr/lib64/libreoffice/program/sofficerc
> CONFIG_PROTECT_MASK=/etc/sandbox.d /etc/php/cli-php7.4/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/apache2-php7.4/ext-active/ /etc/php/fpm-php7.4/ext-active/ /etc/php/phpdbg-php7.4/ext-active/ /etc/php/cli-php8.1/ext-active/ /etc/php/cgi-php8.1/ext-active/ /etc/php/apache2-php8.1/ext-active/ /etc/php/fpm-php8.1/ext-active/ /etc/php/phpdbg-php8.1/ext-active/ /etc/fonts/fonts.conf /etc/gentoo-release /etc/terminfo /etc/dconf /etc/ca-certificates.conf /etc/revdep-rebuild
1a5,6
> DCC_EMAILLOG_WHOM_TO_BLAME=
> DESKTOP_SESSION=xfce
3c8,22
< GNOME_KEYRING_CONTROL=/home/anard/.cache/keyring-DE0HX1
---
> DISTCC_ENABLE_DISCREPANCY_EMAIL=
> DISTCC_FALLBACK=1
> DISTCC_SAVE_TEMPS=0
> DISTCC_SSH=
> DISTCC_TCP_CORK=
> DISTCC_VERBOSE=0
> EDITOR=nano
> GCC_SPECS=
> GDMSESSION=xfce
> GDM_LANG=fr_FR.utf8
> GEM_HOME=/home/anard/gems
> GIT_SUBREPO_ROOT=/home/anard/Applications/git-subrepo
> GNOME_KEYRING_CONTROL=/home/anard/.cache/keyring-4K9YX1
> GSETTINGS_BACKEND=dconf
> GTK_MODULES=canberra-gtk-module
4a24,27
> INFOPATH=/usr/share/gcc-data/x86_64-pc-linux-gnu/11/info:/usr/share/binutils-data/x86_64-pc-linux-gnu/2.38/info:/usr/share/info
> JAVAC=/home/anard/.gentoo/java-config-2/current-user-vm/bin/javac
> JAVA_HOME=/home/anard/.gentoo/java-config-2/current-user-vm
> JDK_HOME=/home/anard/.gentoo/java-config-2/current-user-vm
6a30,32
> LESS=-R -M --shift 5
> LESSOPEN=|lesspipe %s
> LEX=flex
8,11c34,51
< PATH=/usr/bin:/bin
< PWD=/
< SHELL=/bin/sh
< SHLVL=3
---
> LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.avif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.cfg=00;32:*.conf=00;32:*.diff=00;32:*.doc=00;32:*.ini=00;32:*.log=00;32:*.patch=00;32:*.pdf=00;32:*.ps=00;32:*.tex=00;32:*.txt=00;32:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.swp=00;90:*.tmp=00;90:*.dpkg-dist=00;90:*.dpkg-old=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:
> LV2_PATH=/usr/lib64/lv2
> MAIL=/var/mail/anard
> MANPAGER=manpager
> MANPATH=/home/anard/Applications/git-subrepo/man:/home/anard/.gentoo/java-config-2/current-user-vm/man:/usr/share/gcc-data/x86_64-pc-linux-gnu/11/man:/usr/share/binutils-data/x86_64-pc-linux-gnu/2.38/man:/etc/java-config-2/current-system-vm/man/:/usr/lib64/php7.4/man/:/usr/lib64/php8.1/man/:/usr/local/share/man:/usr/share/man:/usr/lib/rust/man:/usr/lib/llvm/15/share/man:/usr/lib/llvm/14/share/man
> MOTD_SHOWN=pam
> MOZ_GMP_PATH=/usr/lib64/nsbrowser/plugins/gmp-gmpopenh264/system-installed
> PAGER=/usr/bin/less
> PANEL_GDK_CORE_DEVICE_EVENTS=0
> PATH=/home/anard/Applications/git-subrepo/lib:/home/anard/Applications/git-subrepo/lib:/home/anard/gems/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/11/bin
> PWD=/home/anard
> SESSION_MANAGER=local/imack:@/tmp/.ICE-unix/2739,unix/imack:/tmp/.ICE-unix/2739
> SHELL=/bin/bash
> SHLVL=1
> SSH_ASKPASS=/usr/bin/ssh-askpass-fullscreen
> SSH_AUTH_SOCK=/home/anard/.cache/keyring-4K9YX1/ssh
> TERM=xterm-256color
> UNCACHED_ERR_FD=
12a53,56
> VBOX_APP_HOME=/usr/lib64/virtualbox
> VISUAL=nano
> VTE_VERSION=7002
> WINDOWID=111149063
13a58,71
> XDG_CONFIG_DIRS=/etc/xdg:/etc/xdg
> XDG_CURRENT_DESKTOP=XFCE
> XDG_DATA_DIRS=/home/anard/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/usr/share
> XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/anard
> XDG_MENU_PREFIX=xfce-
> XDG_RUNTIME_DIR=/run/user/1000
> XDG_SEAT=seat0
> XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
> XDG_SESSION_CLASS=user
> XDG_SESSION_DESKTOP=xfce
> XDG_SESSION_ID=1
> XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
> XDG_SESSION_TYPE=x11
> XDG_VTNR=7
aryoda commented 1 year ago

@Anard I have re-read all your postings here incl. the logs to find out why BiT shows only an empty systray icon when started via cron (as user as well as as root).

I could not find any direct indication for the reason.

I suspect a missing env var when started via cron but could not find any relevant env var. I need to know which qt5 style is active for that.

Would it be possible for you to install our new release (candidate) v1.3.3 from source?

This code includes better debug log output of qt5 styles and would really help me to "tame the systray icon beast".

Edit: One final idea for a quick test: Could you install the "oxygen" icon theme since this is the fallback for missing icons in BiT? If it is not installed and the current theme cannot be determined an empty icon would be shown which matches your symptoms. The pkg name should be oxygen-icon-theme or oxygen-icons normally...

Anard commented 1 year ago

Hi back (in time) OK. I just updated BiT for "unstable" version. Which is compiled from Git master branch. And Oxygen icon theme. It works fine :) Then, I next uninstall Oxygen icons... Systray icon is invisible again when launched from cron. What is strange is that even when installed, Oxygen was not my selected icon theme when cron job worked... Thanks for your searches :)

aryoda commented 1 year ago

Perfect, I think I can try to reproduce the bug this way now to find out why cron does not find the active theme but uses the oxygen fallback.

Could you please launch the (non-root) BiT GUI from a console with the --debug switch and post the console output here? I need to know which Qt QPA plugin and theme is active causing the problem with cron.

Anard commented 1 year ago

OK. This /usr/bin/nice -n19 /usr/bin/ionice -c2 -n7 /usr/bin/backintime --debug backup-job or only /usr/bin/backintime --debug backup-job ?

Anard commented 1 year ago
$ /usr/bin/nice -n19 /usr/bin/ionice -c2 -n7 /usr/bin/backintime --debug backup-job
DEBUG: [common/backintime.py:589 argParse] Arguments: {'debug': True, 'command': 'backup-job', 'func': <function backupJob at 0x7f56ca5172e0>} | unknownArgs: []
DEBUG: [common/tools.py:2286 BackupJobDaemon.daemonize] first fork pid: 668
DEBUG: [common/tools.py:2286 BackupJobDaemon.daemonize] first fork pid: 0
DEBUG: [common/tools.py:2295 BackupJobDaemon.daemonize] decouple from parent environment
DEBUG: [common/tools.py:2303 BackupJobDaemon.daemonize] second fork pid: 669
DEBUG: [common/tools.py:2303 BackupJobDaemon.daemonize] second fork pid: 0
DEBUG: [common/tools.py:2312 BackupJobDaemon.daemonize] redirect standard file descriptors

Back In Time
Version: 1.3.3

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.
aryoda commented 1 year ago

@Anard Sorry, I forgot to give you the correct command to create the output:

backintime-qt --debug

Anard commented 1 year ago

OK. Seem that it immediately stopped the snapshot (maybe no difference vs previous one as I didn't use the PC between last crontab's snapshot and command line test snapshot).

$ backintime-qt --debug
DEBUG: [common/backintime.py:589 argParse] Arguments: {'debug': True} | unknownArgs: []

Back In Time
Version: 1.3.3

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:677 getConfig] config file: /home/anard/.config/backintime/config
DEBUG: [common/backintime.py:678 getConfig] share path: /home/anard/.local/share/backintime
DEBUG: [common/backintime.py:679 getConfig] profiles: 1=Profil principal
DEBUG: [common/pluginmanager.py:240 PluginManager.load] Register plugin path /usr/share/backintime/plugins
DEBUG: [common/pluginmanager.py:257 PluginManager.load] Add plugin notifyplugin.py
DEBUG: [common/pluginmanager.py:257 PluginManager.load] Add plugin qt4plugin.py
DEBUG: [qt/qttools.py:175 createQApplication] QT QPA platform plugin: xcb
DEBUG: [qt/qttools.py:176 createQApplication] QT_QPA_PLATFORMTHEME=<not set>
DEBUG: [qt/qttools.py:178 createQApplication] QT_STYLE_OVERRIDE=<not set>
DEBUG: [qt/qttools.py:179 createQApplication] QT active style: fusion
DEBUG: [qt/qttools.py:180 createQApplication] QT fallback style: 
DEBUG: [qt/qttools.py:181 createQApplication] QT supported styles: ['Windows', 'Fusion']
DEBUG: [qt/qttools.py:182 createQApplication] themeSearchPaths: ['/home/anard/.icons', '/home/anard/.local/share/icons', '/var/lib/flatpak/exports/share/icons', '/usr/local/share/icons', '/usr/share/icons', ':/icons']
DEBUG: [qt/qttools.py:183 createQApplication] fallbackSearchPaths: []
DEBUG: [qt/qttools.py:185 createQApplication] Is SystemTray available: True
DEBUG: [qt/qttools.py:197 createQApplication] Trying to set App ID for non-privileged user
DEBUG: [common/tools.py:862 keyringSupported] Available keyring backends:
DEBUG: [common/tools.py:865 keyringSupported] keyring.backends.kwallet.DBusKeyring (priority: 4.9)
DEBUG: [common/tools.py:865 keyringSupported] keyring.backends.chainer.ChainerBackend (priority: 10)
DEBUG: [common/tools.py:865 keyringSupported] keyring.backends.libsecret.Keyring (priority: 4.8)
DEBUG: [common/tools.py:865 keyringSupported] keyring.backends.fail.Keyring (priority: 0)
DEBUG: [common/tools.py:865 keyringSupported] keyring.backends.SecretService.Keyring (priority: 5)
DEBUG: [common/tools.py:878 keyringSupported] Metaclass keyring.backends.Gnome.Keyring not found: AttributeError("module 'keyring.backends' has no attribute 'Gnome'")
DEBUG: [common/tools.py:880 keyringSupported] Metaclass keyring.backends.kwallet.Keyring not found: AttributeError("module 'keyring.backends.kwallet' has no attribute 'Keyring'")
DEBUG: [common/tools.py:884 keyringSupported] Metaclass keyring.backend.SecretServiceKeyring not found: AttributeError("module 'keyring.backend' has no attribute 'SecretServiceKeyring'")
DEBUG: [common/tools.py:886 keyringSupported] Metaclass keyring.backend.GnomeKeyring not found: AttributeError("module 'keyring.backend' has no attribute 'GnomeKeyring'")
DEBUG: [common/tools.py:888 keyringSupported] Metaclass keyring.backend.KDEKWallet not found: AttributeError("module 'keyring.backend' has no attribute 'KDEKWallet'")
DEBUG: [common/tools.py:899 keyringSupported] Available supported backends: [<class 'keyring.backends.SecretService.Keyring'>, <class 'keyring.backends.kwallet.DBusKeyring'>]
DEBUG: [common/tools.py:905 keyringSupported] No appropriate keyring found. 'keyring.backends.chainer' can't be used with BackInTime
DEBUG: [common/mount.py:73 Mount.__init__] pw-cache is not running
DEBUG: [common/mount.py:81 Mount.__init__] Call command: /usr/bin/backintime pw-cache start
DEBUG: [common/tools.py:1410 readCrontab] Read 14 lines from users crontab
DEBUG: [common/config.py:1518 Config.removeOldCrontab] Clearing system Back In Time entries
DEBUG: [common/config.py:1552 Config.cronLine] Profile: Profil principal | Automatic backup: Toutes les 4 heures
DEBUG: [common/tools.py:1447 writeCrontab] Wrote 14 lines to users crontab

Is it helpful for u ?

aryoda commented 1 year ago

Is it helpful for u ?

Yes, thanks a lot for your assistance!

I can see "xcb" and "fusion" in the log during init. That is most valuable for me (no need to really create a new snapshot).

I will discuss a fix or other solutions internally now, mainly:

Relevant code parts:

https://github.com/bit-team/backintime/blob/979b757d2cbbe65b332c5fd15244d400a9d80983/qt/icon.py#L19-L26

https://github.com/bit-team/backintime/blob/979b757d2cbbe65b332c5fd15244d400a9d80983/qt/qtsystrayicon.py#L27-L28

Furthermore

aryoda commented 1 year ago

I have fixed all known issues (hopefully) with my PR #1480 and this issue should be fixed too with that now.

Re-testing and feed-back welcome (currently only on dev branch)!

aryoda commented 1 year ago

I am closing this now as fixed.

Please open a new issue in case of any problems (to get rid of this and the other related issues that are old and have along history of discussions)...

Anard commented 1 year ago

Sry I didn't found time for testing. I'll see on next gentoo's BiT update (right now still on 1.3.3). I just need to remember to remove my portage configuration to keep intalled xdpyinfo & oxygen-icons. Anyway, thx 4 your work