backintime icon indicating copy to clipboard operation
backintime copied to clipboard

System tray icon appears during the backup, but with no icon

Open mattalxndr opened this issue 3 years ago • 9 comments

When a backup happens, a new system tray icon appears, and when the backup finishes, it disappears. But the icon is invisible, it just looks like an empty space in between two other icons. When I right click it, I do get the backintime menu.

My crontab is leaving this in its log:

Jul 20 10:35:01 j crond[80616]: pam_unix(crond:session): session opened for user root by (uid=0)
Jul 20 10:35:01 j CROND[80617]: (root) CMD (/usr/sbin/nice -n19 /usr/sbin/ionice -c2 -n7 /usr/sbin/backintime backup-job >/dev/null)
Jul 20 10:35:01 j CROND[80616]: pam_unix(crond:session): session closed for user root
Jul 20 10:35:01 j python[80624]: backintime (root/1): INFO: Lock
Jul 20 10:35:01 j python[80624]: backintime (root/1): INFO: Take a new snapshot. Profile: 1 Main profile
Jul 20 10:35:01 j python[80624]: backintime (root/1): INFO: Call rsync to take the snapshot
Jul 20 10:35:01 j python[80629]: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
Jul 20 10:35:01 j python[80629]: QPainter::begin: Paint device returned engine == 0, type: 2
Jul 20 10:35:01 j python[80629]: QWidget::render: Cannot render with an inactive painter
Jul 20 10:35:01 j python[80629]: QSystemTrayIcon::setVisible: No Icon set
Jul 20 10:35:08 j python[80624]: backintime (root/1): INFO: Save config file
Jul 20 10:35:08 j python[80624]: backintime (root/1): INFO: Save permissions
Jul 20 10:35:16 j python[80624]: backintime (root/1): INFO: Create info file
Jul 20 10:35:18 j python[80624]: backintime (root/1): INFO: Unlock

Linux version 5.5.7-arch1-1 (linux@archlinux) (gcc version 9.2.1 20200130 (Arch Linux 9.2.1+20200130-2)) #1 SMP PREEMPT Sat, 29 Feb 2020 19:06:02 +0000

mattalxndr avatar Jul 20 '20 15:07 mattalxndr

I can confirm this

KardinalReusen avatar Feb 12 '21 07:02 KardinalReusen

What DE and icon theme are you using? It seems fine on my end

TheTimeWalker avatar Mar 11 '21 15:03 TheTimeWalker

Budgie DE with Papirus icon theme.

KardinalReusen avatar Mar 11 '21 21:03 KardinalReusen

I can confirm this too. I have no DE (running Arch + Qtile) and the icon I use are Adwaita, Breeze and Papirus (with Papirus being the main one).

karma-riuk avatar Mar 31 '21 23:03 karma-riuk

Also confirmed for KDE on Arch. For me the icon has been missing for a few years now. Similar messages in journalctl as OP.

Jun 09 12:00:02 hostname python[910373]: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
Jun 09 12:00:02 hostname python[910373]: QPainter::begin: Paint device returned engine == 0, type: 2
Jun 09 12:00:02 hostname python[910373]: QWidget::render: Cannot render with an inactive painter
Jun 09 12:00:02 hostname python[910373]: QSystemTrayIcon::setVisible: No Icon set

protist avatar Jun 09 '21 02:06 protist

I use backintime with LM 20.2 Cinnamon. For the panel I use a dark (black) theme. In all backintime.desktop files icon is set as gtk-save, which is a black/grey icon. It is invisible in a dark panel. After changing all backintime.desktop files to icon=mintbackup-software.svg the .desktops are visible. But while running backintime in the panel and the tray appear dark patches which are still the gtk-save icon. Where can I change the runtime icon?

Key-Snapper avatar Feb 10 '22 14:02 Key-Snapper

@Key-Snapper That looks like a different problem. The issue here is that there is no icon at all, not that the icon is a poor choice. I'd recommend opening a new issue, but I'm not sure how active this project is anyway.

protist avatar Feb 10 '22 21:02 protist

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! :)

emtiu avatar Sep 22 '22 21:09 emtiu

@emtiu Do you mean add this info here, or in the linked issue? If here, then, yes, I am still affected.

  • backintime 1.3.2
  • Arch Linux, up-to-date
  • KDE Plasma 5.25.5
  • X11

protist avatar Sep 23 '22 02:09 protist

@emtiu Do you mean add this info here, or in the linked issue? If here, then, yes, I am still affected.

  • backintime 1.3.2
  • Arch Linux, up-to-date
  • KDE Plasma 5.25.5
  • X11

Thanks, that's very helpful! :) I've updated the info in #1306 accordingly. I'll have to get a Virtual Machine with Arch running to try and reproduce.

From your logs, I see that your backintime systray icon is missing for a job that's running for the root user. Could you check if the same thing happens when there's a backintime job for for your regular user (the one running KDE)?

emtiu avatar Sep 23 '22 08:09 emtiu

Same issue here, with latest versions of

  • Arch
  • Cinnamon
  • X11 BiT (root) also does not have an icon in the panel image

But the icon is there when opening BiT (non-root) image

msjr65 avatar Sep 24 '22 01:09 msjr65

On Debian 11 (stable).

Running as root the icon in systray looks like this grafik The same icon is used in the toolbar of "root" backintime-qt.

As user the icon looks like this grafik The same icon is used in the toolbar of "user" backintime". This "user" icon is also used as the application icon (?) in the applications menu of XFCE. Also the "Back In Time (root)" entry in that menu use the user icon.

I couldn't find any of that icons in "qt/icons". So I assume this are default icons used by the desktop environment and its theme.

Because of that I assume that user and root do use different themes on the same desktop environment. Or root doesn't use any theme but the desktop environments fallback theme because no explicit theme is configured for root. Root usually doesn't use the desktop environment.

For me the title of that Issue is misleading.

This is a Qt thing. BIT use a name/constant to get an icon. It doesn't load a file. Qt itself does load the correct icon based on the used desktop environment and configured theme (or system icon folder). The icons name is "document-save". https://github.com/bit-team/backintime/blob/ab24e105e618b8b1f5d779e0d4713a6296ca46d3/qt/icon.py#L25

Maybe the https://github.com/PapirusDevelopmentTeam/papirus-icon-theme people have an idea about it?

buhtz avatar Sep 24 '22 07:09 buhtz

Thanks, @msjr65, that's very helpful! I've updated my summary in #1306.

@buhtzz: See #1306 for my current best understanding of the situation. It's very similar to yours.

emtiu avatar Sep 24 '22 08:09 emtiu

From your logs, I see that your backintime systray icon is missing for a job that's running for the root user. Could you check if the same thing happens when there's a backintime job for for your regular user (the one running KDE)?

I just created a job for my regular user, and the tray icon does display in this case. I agree that's it's likely some issue with the root user not having a theme defined.

Again, I'm not sure if I should comment here to prevent polluting #1306, but I tested installing qt5ct, exporting the variable in backintime, then restarting. However, this didn't fix the icon for me (although it did make all the text in the main window massive).

Also, I slightly disagree with your comments in #1306, specifically

6 rolling-release/DIY distros, thus difficult to reproduce

I've been experiencing this in Arch Linux for at least the last four years, so I think it's pretty easy to reproduce, at least based purely on distro!

protist avatar Sep 25 '22 04:09 protist

@KardinalReusen @karma-riuk @mattalexx @protist @msjr65

Could you please follow my instructions here to diagnose the problem:

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

THX!

I https://github.com/bit-team/backintime/issues/1236#issuecomment-1091120110 installing qt5ct, exporting the variable in backintime, then restarting. However, this didn't fix the icon for me (although it did make all the text in the main window massive).

For this to work you have to start the qt5ct GUI, select an icon theme and click on "apply". By default there seems to be no icon theme selected and you see only text (or empty buttons)...

aryoda avatar Nov 22 '22 22:11 aryoda

Thanks @aryoda.

Running the following

$ sudo backintime --profile-id 1 --debug backup-job

shows no icon in the tray. Oddly enough there was no empty space in the tray either. If I manually launch the GUI for backintime (root), then click "Take snapshot", then again there is no icon in the tray, but there is an empty space where it should be, and I can hover over it and see the hints. This is the normal situation.

$ xdpyinfo > /dev/null && echo $?
0

Running the command "For BiT running as root with X11 as display server:"

QStandardPaths: runtime directory '/run/user/1000' is not owned by UID 0, but a directory permissions 0700 owned by UID 1000 GID 1000
Display Server=None
QT QPA platform plugin: xcb
QT_QPA_PLATFORMTHEME=None
QT_STYLE_OVERRIDE=None
QT active style: fusion
QT fallback style: hicolor
QT supported styles: ['Breeze', 'Oxygen', 'Windows', 'Fusion']
themeSearchPaths: ['/usr/share/icons', ':/icons']
fallbackSearchPaths: ['/usr/share/pixmaps']
Is SystemTray available: True
has theme icon <document-save>: False

protist avatar Nov 23 '22 05:11 protist

@protist Exactly the same results for me

msjr65 avatar Nov 23 '22 06:11 msjr65

Running the following [as user]

$ backintime --profile-id 1 --debug backup-job

shows no icon in the tray.

You seem to use BiT (root) for backups and BiT (root) does not share the same config/profiles with BiT "user".

If no profile is configured (here: running as normal user) the sys tray icon is not shown.

To find out that no config/profile is configured just start BiT GUI as user and you will get this kind of message:

Screenshot from 2022-11-24 00-45-33

Can you confirm this?

aryoda avatar Nov 23 '22 23:11 aryoda

You seem to use BiT (root) for backups and BiT (root) does not share the same config/profiles with BiT "user".

This is correct. BiT (root) uses my config in /root/.config/backintime.

If no profile is configured (here: running as normal user) the sys tray icon is not shown.

To find out that no config/profile is configured just start BiT GUI as user and you will get this kind of message:

Can you confirm this?

I'm not exactly sure what you are asking. I do have BiT configured for both root and a normal user. I cannot see the icon when running as root. When running as a normal user it appears fine.

protist avatar Nov 24 '22 00:11 protist

I'm not exactly sure what you are asking. I do have BiT configured for both root and a normal user. I cannot see the icon when running as root. When running as a normal user it appears fine.

I thought that backintime --profile-id 1 --debug backup-job does not show the sys tray icon (at least for a few seconds) so I am trying to figuring out the reason with my question.

But if you have set up a config for BiT "user" too than my assumed missing config is wrong.

Could you please show me the results this script to compare the theme settings of the user vs. root? THX!

python3 -c "
from PyQt5.QtGui import QIcon;
from PyQt5.QtWidgets import QSystemTrayIcon,QApplication,QStyleFactory;
import os
env_var = 'XDG_SESSION_TYPE'; print(f'Display Server={os.environ.get(env_var)}');
qapp = QApplication(['']);
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_STYLE_OVERRIDE={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())}');
icon_name = 'document-save'; print(f'has theme icon <document-save>: {str(QIcon.hasThemeIcon(icon_name))}');"

aryoda avatar Nov 24 '22 00:11 aryoda

Sorry @aryoda I realise now I was unclear. I'll go back and edit, but yes, above I was running backintime --profile-id 1 --debug backup-job as root. It does work (i.e. the profile is set up), but there is no icon.

Running your script (as user):

QSettings::value: Empty key passed
QSettings::value: Empty key passed
Display Server=tty
QT QPA platform plugin: xcb
QT_QPA_PLATFORMTHEME=None
QT_STYLE_OVERRIDE=None
QT active style: breeze
QT fallback style: breeze
QT supported styles: ['Breeze', 'Oxygen', 'Windows', 'Fusion']
themeSearchPaths: ['/home/protist/.local/share/icons', '/usr/share/icons', '/home/protist/.icons', ':/icons']
fallbackSearchPaths: []
Is SystemTray available: True
has theme icon <document-save>: True

protist avatar Nov 24 '22 00:11 protist

The problem is that Qt5 as root is choosing the Qt5-built-in style "fusion" as default which lacks some icons:

QT active style: fusion
QT fallback style: hicolor
QT supported styles: ['Breeze', 'Oxygen', 'Windows', 'Fusion']
has theme icon <document-save>: False

The fallback style hicolor does also not provide the BiT icon (named document-save) required for the sys tray icon.

When running BiT as user Qt5 chooses the Breeze icon theme from Arch which does contain the icon.

BiT does internally fall back by trying to use another theme that contains all icons but if none of the fall-back themes is installed it uses oxygen (even if it is not [fully] installed!):

https://github.com/bit-team/backintime/blob/675c8b4b58208e0a282d2f25371df81c556afd49/qt/icon.py#L19-L22

A user-side fix would be to install at least the oxygen icon theme of your distro which contains all standard icons required by BiT. On Arch this should be the package oxygen-icons (but I am not sure).

Could you please try to install oxygen-icons (or a package that sounds like "oxygen icons theme", see https://aur.archlinux.org/packages?O=0&L=0&C=17&K=icon-theme&SeB=nd&SB=n&SO=a&PP=50&do_Search=Go), restart and check if the sys tray icon is then correctly shown in BiT (root)?

On my side I have to fix the buggy fall-back theme activation logic somehow...

aryoda avatar Nov 24 '22 01:11 aryoda

A user-side fix would be to install at least the oxygen icon theme of your distro which contains all standard icons required by BiT. On Arch this should be the package oxygen-icons (but I am not sure).

Could you please try to install oxygen-icons (or a package that sounds like "oxygen icons theme", see https://aur.archlinux.org/packages?O=0&L=0&C=17&K=icon-theme&SeB=nd&SB=n&SO=a&PP=50&do_Search=Go), restart and check if the sys tray icon is then correctly shown in BiT (root)?

Yes, that's exactly it! The package is indeed oxygen-icons, and it's in the official repos. After installing, I actually didn't need to restart, although I killed /usr/share/backintime/qt/serviceHelper.py (whatever that is), just in case. After launching BiT again, I do indeed have a backup icon.

protist avatar Nov 24 '22 08:11 protist

Installing oxygen-icons fixed it for me too, same as for @protist Thank you so much @aryoda !!!

msjr65 avatar Nov 24 '22 13:11 msjr65

@protist @msjr65 Great to hear it works now and THX for testing!

Did the installation of the oxygen-icons change the look & feel of Arch or any other apps (I don't hope so)?

I want to update our documentation of (weak) installation dependencies...

aryoda avatar Nov 25 '22 00:11 aryoda

Did the installation of the oxygen-icons change the look & feel of Arch or any other apps (I don't hope so)?

Not on my side (Arch + Cinnamon).

msjr65 avatar Nov 25 '22 01:11 msjr65

Nothing obvious for me either @aryoda (Arch + KDE Plasma)

protist avatar Nov 25 '22 02:11 protist

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 avatar Jul 17 '23 21:07 aryoda

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)...

aryoda avatar Sep 04 '23 19:09 aryoda