hakandundar34coding / system-monitoring-center

Multi-featured system monitor
GNU General Public License v3.0
912 stars 84 forks source link

Processes window is empty (Flatpak), several tabs are empty (Arch Linux) #148

Closed thierrybo closed 1 year ago

thierrybo commented 1 year ago

Hi,

just installed the Flatpak version (2.8.0). I use Flatpaks only in --user mode.

All is working excepting the Process tab. There is no process.

I use no user handling package (no systemd, policykit, consolekit) excepting elogin, .

System :

OS: Devuan GNU/Linux 5 (daedalus/ceres) x86_
                     `:b$$b`.      Model: B450 AORUS ELITE
                        'P$$$d`    Kernel: 6.1.0-5-amd64
                         .$$$$$`   Uptime: 6 hours, 14 mins
                         ;$$$$$P   Packages: 3232 (dpkg), 48 (flatpak)
                      .:P$$$$$$`   Shell: bash 5.2.15
                  .,:b$$$$$$$;'    Resolution: 1920x1080, 1920x1080
             .,:dP$$$$$$$$b:'      WM: Openbox
      .,:;db$$$$$$$$$$Pd'`         WM Theme: Adwaita Revisited Dark
 ,db$$$$$$$$$$$$$$b:'`             Theme: adw-gtk3-dark [GTK3]
:$$$$$$$$$$$$b:'`                  Icons: Adwaita [GTK3]
 `$$$$$bd:''`                      Terminal: terminology
   `'''`                           Terminal Font: DejaVu Sans Mono for Powerlin
                                   CPU: AMD Ryzen 5 3600 (12) @ 3.600GHz [47.8°
                                   GPU: NVIDIA GeForce GTX 1060 3GB
                                   Memory: 2648MiB / 15943MiB

Host: thierrybo-desk Kernel: 6.1.0-5-amd64 arch: x86_64 bits: 64
    Desktop: Openbox v: 3.6.1 Distro: Devuan GNU/Linux 5 (daedalus/ceres)
    daedalus ceres
Machine:
  Type: Desktop Mobo: Gigabyte model: B450 AORUS ELITE v: x.x
    serial: <superuser required> UEFI-[Legacy]: American Megatrends v: F51
    date: 12/18/2019
CPU:
  Info: 6-core model: AMD Ryzen 5 3600 bits: 64 type: MT MCP cache: L2: 3 MiB
  Speed (MHz): avg: 2406 min/max: 2200/4208 cores: 1: 2200 2: 2200 3: 2200
    4: 2053 5: 3600 6: 2053 7: 1863 8: 2800 9: 2200 10: 2200 11: 3592 12: 1914
Graphics:
  Device-1: NVIDIA GP106 [GeForce GTX 1060 3GB] driver: nvidia v: 525.85.12
  Display: server: X.Org v: 1.21.1.7 driver: X: loaded: nvidia gpu: nvidia
    resolution: 1: 1920x1080~60Hz 2: 1920x1080~60Hz
  API: OpenGL v: 4.6.0 NVIDIA 525.85.12 renderer: NVIDIA GeForce GTX 1060
    3GB/PCIe/SSE2
Audio:
  Device-1: NVIDIA GP106 High Definition Audio driver: N/A
  Device-2: AMD Starship/Matisse HD Audio driver: snd_hda_intel
  Sound API: ALSA v: k6.1.0-5-amd64 running: yes
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    driver: r8169
  IF: eth0 state: up speed: 1000 Mbps duplex: full mac: b4:2e:99:f5:e7:5b
Drives:
  Local Storage: total: 2.27 TiB used: 1001.95 GiB (43.0%)
  ID-1: /dev/nvme0n1 vendor: Western Digital model: WDS100T1XHE-00AFY0
    size: 931.51 GiB
  ID-2: /dev/nvme1n1 vendor: Fantom Drives model: VENOM8 size: 931.51 GiB
  ID-3: /dev/sda vendor: Crucial model: CT500MX500SSD1 size: 465.76 GiB
Partition:
  ID-1: / size: 31.33 GiB used: 22.35 GiB (71.3%) fs: ext4 dev: /dev/sda3
  ID-2: /home size: 905.07 GiB used: 283.74 GiB (31.3%) fs: ext4
    dev: /dev/nvme1n1p2
  ID-3: /var size: 11.27 GiB used: 3.08 GiB (27.4%) fs: ext4
    dev: /dev/nvme1n1p1
Swap:
  ID-1: swap-1 type: file size: 4 GiB used: 0 KiB (0.0%) file: /swapfile
Sensors:
  System Temperatures: cpu: 52.9 C mobo: 25.0 C gpu: nvidia temp: 37 C
  Fan Speeds (RPM): cpu: 0 fan-1: 0 fan-3: 0 gpu: nvidia fan: 55%
Info:
  Processes: 302 Uptime: 6h 2m Memory: 15.57 GiB used: 3.85 GiB (24.8%)
  Shell: Bash inxi: 3.3.25
thierrybo commented 1 year ago

But surprisingly if I run the application from the command line (just copying the .desktop command) :

/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=system-monitoring-center io.github.hakandundar34coding.system-monitoring-center

and then I have the process list!

hakandundar34coding commented 1 year ago

I installed the application by using the following command: flatpak install --user flathub io.github.hakandundar34coding.system-monitoring-center

Processes are listed when the application is run by using its shortcut and the following command: flatpak run io.github.hakandundar34coding.system-monitoring-center

Are there any permission changes for the application? What is shown for process count information on the Summary and CPU tabs (Processes-Threads information)?

Piqlet commented 1 year ago

Archlinux "totally bad". But downgrade gtk4 previous version good. But i dont know what possible bad, libadwaita ?

hakandundar34coding commented 1 year ago

Are there errors or features that do not work? What is the version number for previous version?

Piqlet commented 1 year ago

Missing (empty) pages and freezing.

$ sudo downgrade gtk4
gtk4        1:4.10.0-3   1:4.8.3-3         5,56 MiB
hakandundar34coding commented 1 year ago

Are there errors on the terminal output? Command: system-monitoring-center

I did not use Gtk 4.10. It is very new. There may be bugs. The latest version is 4.8.3 for the Flatpak version. There is no empty page.

Piqlet commented 1 year ago

Ahh... good idea.

$ system-monitoring-center

(python:21502): Gtk-WARNING **: 09:18:17.532: Unknown key gtk-modules in /home/eos44/.config/gtk-4.0/settings.ini
Traceback (most recent call last):
  File "/usr/share/system-monitoring-center/systemmonitoringcenter/MainWindow.py", line 641, in on_main_gui_togglebuttons_toggled
    self.main_gui_tab_switch()
  File "/usr/share/system-monitoring-center/systemmonitoringcenter/MainWindow.py", line 689, in main_gui_tab_switch
    from .Cpu import Cpu
  File "/usr/share/system-monitoring-center/systemmonitoringcenter/Cpu.py", line 502, in <module>
    Cpu = Cpu()
  File "/usr/share/system-monitoring-center/systemmonitoringcenter/Cpu.py", line 20, in __init__
    self.tab_gui()
  File "/usr/share/system-monitoring-center/systemmonitoringcenter/Cpu.py", line 36, in tab_gui
    self.information_grid()
  File "/usr/share/system-monitoring-center/systemmonitoringcenter/Cpu.py", line 102, in information_grid
    scrolledwindow, self.average_usage_label, self.frequency_label = Common.styled_information_scrolledwindow(_tr("Average Usage"), _tr("Average CPU usage of all cores"), _tr("Frequency"), None)
  File "/usr/share/system-monitoring-center/systemmonitoringcenter/Common.py", line 693, in styled_information_scrolledwindow
    style_provider_scrolledwindow_separator()
  File "/usr/share/system-monitoring-center/systemmonitoringcenter/Common.py", line 679, in style_provider_scrolledwindow_separator
    style_provider_scrolledwindow.load_from_data(css)
TypeError: Gtk.CssProvider.load_from_data() takes exactly 3 arguments (2 given)
Traceback (most recent call last):
  File "/usr/share/system-monitoring-center/systemmonitoringcenter/MainWindow.py", line 1157, in main_gui_tab_loop
    GLib.idle_add(Cpu.cpu_loop_func)
NameError: name 'Cpu' is not defined
Traceback (most recent call last):
  File "/usr/share/system-monitoring-center/systemmonitoringcenter/MainWindow.py", line 641, in on_main_gui_togglebuttons_toggled
    self.main_gui_tab_switch()
  File "/usr/share/system-monitoring-center/systemmonitoringcenter/MainWindow.py", line 707, in main_gui_tab_switch
    from .Memory import Memory
  File "/usr/share/system-monitoring-center/systemmonitoringcenter/Memory.py", line 586, in <module>
    Memory = Memory()
  File "/usr/share/system-monitoring-center/systemmonitoringcenter/Memory.py", line 21, in __init__
    self.tab_gui()
  File "/usr/share/system-monitoring-center/systemmonitoringcenter/Memory.py", line 37, in tab_gui
    self.information_grid()
  File "/usr/share/system-monitoring-center/systemmonitoringcenter/Memory.py", line 107, in information_grid
    scrolledwindow, self.ram_used_label, self.ram_available_label = Common.styled_information_scrolledwindow(_tr("Used"), None, _tr("Available"), None)
  File "/usr/share/system-monitoring-center/systemmonitoringcenter/Common.py", line 693, in styled_information_scrolledwindow
    style_provider_scrolledwindow_separator()
  File "/usr/share/system-monitoring-center/systemmonitoringcenter/Common.py", line 679, in style_provider_scrolledwindow_separator
    style_provider_scrolledwindow.load_from_data(css)
TypeError: Gtk.CssProvider.load_from_data() takes exactly 3 arguments (2 given)
hakandundar34coding commented 1 year ago

Can you follow these steps?

Open Common.py file in src folder Add # character at the beginning of the lines 679 and 684.

Result:

    #style_provider_scrolledwindow.load_from_data(css)
    #style_provider_separator.load_from_data(css)

Run the application from terminal and check the output for errors.

Piqlet commented 1 year ago

Ahh...perfect. Only last System page problematic (empty).

$ system-monitoring-center

(python:22707): Gtk-WARNING **: 10:10:37.614: Unknown key gtk-modules in /home/eos44/.config/gtk-4.0/settings.ini
Traceback (most recent call last):
  File "/usr/share/system-monitoring-center/systemmonitoringcenter/MainWindow.py", line 641, in on_main_gui_togglebuttons_toggled
    self.main_gui_tab_switch()
  File "/usr/share/system-monitoring-center/systemmonitoringcenter/MainWindow.py", line 851, in main_gui_tab_switch
    from .System import System
  File "/usr/share/system-monitoring-center/systemmonitoringcenter/System.py", line 828, in <module>
    System = System()
  File "/usr/share/system-monitoring-center/systemmonitoringcenter/System.py", line 23, in __init__
    self.tab_gui()
  File "/usr/share/system-monitoring-center/systemmonitoringcenter/System.py", line 37, in tab_gui
    self.information_grid()
  File "/usr/share/system-monitoring-center/systemmonitoringcenter/System.py", line 76, in information_grid
    style_provider_grid.load_from_data(css)
TypeError: Gtk.CssProvider.load_from_data() takes exactly 3 arguments (2 given)
Traceback (most recent call last):
  File "/usr/share/system-monitoring-center/systemmonitoringcenter/MainWindow.py", line 641, in on_main_gui_togglebuttons_toggled
    self.main_gui_tab_switch()
  File "/usr/share/system-monitoring-center/systemmonitoringcenter/MainWindow.py", line 851, in main_gui_tab_switch
    from .System import System
  File "/usr/share/system-monitoring-center/systemmonitoringcenter/System.py", line 828, in <module>
    System = System()
  File "/usr/share/system-monitoring-center/systemmonitoringcenter/System.py", line 23, in __init__
    self.tab_gui()
  File "/usr/share/system-monitoring-center/systemmonitoringcenter/System.py", line 37, in tab_gui
    self.information_grid()
  File "/usr/share/system-monitoring-center/systemmonitoringcenter/System.py", line 76, in information_grid
    style_provider_grid.load_from_data(css)
TypeError: Gtk.CssProvider.load_from_data() takes exactly 3 arguments (2 given)
hakandundar34coding commented 1 year ago

You can add # at the beginning of line 76 in the System.py file in the src folder. But this will prevent showing a border for information on this page. Previous changes prevent radius of borders of some information on Performance tab sub-tabs.

There may be an update for fixing this.

hakandundar34coding commented 1 year ago

The application is updated. The latest version is v2.8.1. It may be updated in the repositories and Flatpak in about 3-4 hours.


Currently, there is no change for the process list issue that is written in the first comment.

Currently, there is no answer to the questions in this comment.

thierrybo commented 1 year ago

What is shown for process count information on the Summary and CPU tabs (Processes-Threads information)?

Both are displayed with numbers

thierrybo commented 1 year ago

I tried changing the line "Terminal=false" to true in the .desktop:

(python3:2): Gtk-WARNING **: 21:52:42.706: Unable to acquire session bus: Erreur lors de la génération de la ligne de commande « dbus-launch --autolaunch=5b02122d0d4cd66681405f626408e3eb --binary-syntax --close-stderr » : Le processus fils s’est terminé avec le code 1
Can't find bus: Erreur lors de la génération de la ligne de commande « dbus-launch --autolaunch=5b02122d0d4cd66681405f626408e3eb --binary-syntax --close-stderr » : Le processus fils s’est terminé avec le code 1

Also I recorded my desktop to show 3 different behaviors whether I Run from the Menu, from the command line, and running the .desktop file by right clicking and executing the file: https://youtu.be/QC5f5aGGLCQ

thierrybo commented 1 year ago

I tried a fourth method that works correctly as the command line : gtk-launch io.github.hakandundar34coding.system-monitoring-center.desktop

hakandundar34coding commented 1 year ago

In the video:

All runs: GUIs are similar to SMC v1.x.x. SMC v2.x.x has a different GUI. Are there multiple SMC installations on your system? It is interesting that GUIs are different than Flatpak version of the application. An example screenshot from the Flatpak version: smc_fp

Run 1: There are errors. Because two dashes (--) are shown on the GUI. Also Services tab is shown. Probably, the application could not detect the init system because of permissions. On my system, Flatpak applications are not run if desktop files in /home/[USERNAME]/.local/share/flatpak/exports/share/applications are used. They are run if:

Run 2: Services tab is not shown. It is hidden if systemd is not running. But processes are not listed. Can you share output of this command (you can share it as a file)? env LANG=C ps -eo comm:96,pid,user:80,s,rss,vsz,sz,nice,thcount,ppid,uid,gid,exe:800,command=CMDLINE

Run 3: Information on the opened tabs are shown but it writes warnings about DBus. It is used for several functions such as accessing information of the host OS. Did you changed the permission for the application or all applications? Probably, you know FlatSeal that is used for managing Flatpak permissions.

thierrybo commented 1 year ago

It is definitely not v1.x.x.x ! flatseal_version

??? I have only the flatpak version installed:

 $  flatpak list --app
Name                                          Application ID                                                     Version             Branch             Installation
Discord                                       com.discordapp.Discord                                             0.0.25              stable             user
Pinta                                         com.github.PintaProject.Pinta                                      2.1.1               stable             user
Flatseal                                      com.github.tchx84.Flatseal                                         1.8.1               stable             user
PowerISO                                      com.poweriso.PowerISO                                              1.1                 stable             user
Bouteilles                                    com.usebottles.bottles                                             51.5                stable             user
Centre de surveillance du système             io.github.hakandundar34coding.system-monitoring-center             2.8.0               stable             user
Master PDF Editor                             net.codeindustry.MasterPDFEditor                                   5.9.35              stable             user
ONLYOFFICE Desktop Editors                    org.onlyoffice.desktopeditors                                      7.3.0               stable             user

$ nala search --names monitoring
golang-github-inexio-go-monitoringplugin-dev 1.0.13-1 [Devuan/daedalus main]
└── Go lib for writing monitoring check plugins

icingaweb2-module-monitoring 2.11.4-2 [Devuan/daedalus main]
└── simple and responsive web interface for Icinga - monitoring module

libeclipse-ui-monitoring-java 1.2.300+eclipse4.26-1 [Devuan/daedalus main]
└── Eclipse UI Responsiveness Monitoring

libipmimonitoring-dev 1.6.10-1 [Devuan/daedalus main]
└── GNU IPMI - ipmimonitoring development package

libipmimonitoring6 1.6.10-1 [Devuan/daedalus main]
└── GNU IPMI - Sensor monitoring library

libmonitoring-availability-perl 0.46-1 [Devuan/ceres main]
└── Calculate Availability Data from Nagios and Icinga Logfiles

libmonitoring-icinga2-client-rest-perl 2.0.4-1 [Devuan/daedalus main]
└── Perl module providing REST integration with icinga2

libmonitoring-livestatus-class-perl 0.06-1.1 [Devuan/daedalus main]
└── Object-Oriented interface for Monitoring::Livestatus

libmonitoring-livestatus-perl 0.84-2 [Devuan/daedalus main]
└── Perl API for check_mk livestatus to access runtime

libmonitoring-plugin-perl 0.40-1 [Devuan/daedalus main]
└── family of perl modules to streamline writing Monitoring plugins

monitoring-plugins 2.3.3-3 [Devuan/daedalus main]
└── Plugins for nagios compatible monitoring systems (metapackage)

monitoring-plugins-basic 2.3.3-3 [Devuan/daedalus main]
└── Plugins for nagios compatible monitoring systems (basic)

monitoring-plugins-btrfs 13-1 [Devuan/daedalus main]
└── btrfs plugin for nagios compatible monitoring systems

monitoring-plugins-check-logfiles 4.1.1-3 [Devuan/daedalus main]
└── Nagios plugin check_logfiles

monitoring-plugins-common 2.3.3-3 [Devuan/daedalus main]
└── Common files for plugins for nagios compatible monitoring

monitoring-plugins-contrib 41.20230224 [Devuan/daedalus main]
└── Plugins for nagios compatible monitoring systems

monitoring-plugins-standard 2.3.3-3 [Devuan/daedalus main]
└── Plugins for nagios compatible monitoring systems (standard)

$ flatpak remotes
Name    Options
flathub user

$ flatpak info --show-permissions io.github.hakandundar34coding.system-monitoring-center
[Context]
shared=network;ipc;
sockets=x11;wayland;fallback-x11;
devices=all;
filesystems=host:ro;

[Session Bus Policy]
org.freedesktop.Flatpak=talk

[Environment]
GTK_THEME=Adwaita-dark
QT_STYLE_OVERRIDE=Adwaita-dark

Run1: good point, I didn't noticed the Service Tab shown only in this run. By the way it is empty. there is no "mini-system-monitor":

 $  flatpak run io.github.hakandundar34coding.mini-system-monitor
error: app/io.github.hakandundar34coding.mini-system-monitor/x86_64/master not installed

but flatpak run io.github.hakandundar34coding.system-monitoring-center

outputs

(python3:2): Gtk-WARNING **: 11:15:31.283: Unable to acquire the address of the accessibility bus: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: org.freedesktop.DBus.Error.ServiceUnknown. If you are attempting to run GTK without a11y support, GTK_A11Y should be set to 'none'.

but excepting no "Services" tab, all work and no more error navigating in the application.

Run2:

env outpout: env.txt

Run 3:

I didn't made any change to app in flatseal. Here are the app settings:

flatseal01 flatseal02 flatseal03 flatseal04 flatseal05

and here are global settings (default too):

flatsealG01 flatsealG02 flatsealG03

hakandundar34coding commented 1 year ago

It looks like the theme is changed by the following settings (cropped from one of your screenshots): fp_permissions

flatpak run io.github.hakandundar34coding.mini-system-monitor was incorrect. But you have already run this command: flatpak run io.github.hakandundar34coding.system-monitoring-center.

Currently only systemd is supported for Services tab. This tab is hidden if systemd is not running.

It looks like the warnings for permissions is printed for accessibility. Your command (in the video) and flatpak run io.github.hakandundar34coding.system-monitoring-center gives the same result.


Summary: The application works if it is run from terminal. But there are problems if the application is run from system menu shortcut even if the same command is used in the .desktop file (Run 2).

I will test the application on the same distribution on virtual machine.

hakandundar34coding commented 1 year ago

There were no problems during tests (all tabs are opened) on Devuan 5 (kernel 6.1) on virtual machine. Details: System Monitoring Center v2.8.1 (installed by using Flatpak) The application is run by using its shortcut in the system menu and its command: flatpak run io.github.hakandundar34coding.system-monitoring-center

smc_vm

smc_menu

thierrybo commented 1 year ago

Ok, I guess this is something related to my custom setup I am using, so I can live with that and it is not worth investigating more time for you. Thanks by the way for your efforts.

hakandundar34coding commented 1 year ago

I added environments variables (for theme) that are added on your system. But the behaviour did not change. The application works and processes are listed.

Can you remove the application, install it again and run it?

Methods for runs:

Note: Run the latest command (gtk-launch...) in this folder: /home/[USERNAME]/.local/share/flatpak/app/io.github.hakandundar34coding.system-monitoring-center/current/active/export/share/applications

thierrybo commented 1 year ago

the 3 runs gtk-launch command again, run from the folder /home/[USERNAME]/......

'flatpak run' and 'gtk-launch' OK

hakandundar34coding commented 1 year ago

Why there are two System Monitoring Center shortcuts in your system menu?


Can you follow these steps?

After that repeat these steps for Processes2.txt file. Rename it as Processes.py But this file has multiple [USERNAME] texts and it generates smc_errors_fp2.txt file

You can reset the changes (file, permissions, etc.) after these steps. Processes.txt Processes2.txt

thierrybo commented 1 year ago

The second SMC shortcut is there because i created a second .desktop entry manually to test other exec commands.

In the meantime I updated to SMC from 2.8.0 to 2.8.1. Are the process.py above still relevant for tests?

hakandundar34coding commented 1 year ago

There are no changes for Processes.py file. You can follow the steps.

thierrybo commented 1 year ago

the content is almost empty error_smc_fp2.txt smc_errors_fp.txt

hakandundar34coding commented 1 year ago

Can you try again? Processes2(1).txt

thierrybo commented 1 year ago

exactly the same result as the first Process2.txt

hakandundar34coding commented 1 year ago

A new print line is added after the line that prints 4. There is a problem. Can you search 4a\ text in the Processes.py in the installation directory? Is it in the file?

thierrybo commented 1 year ago

Yes, one match 4a

hakandundar34coding commented 1 year ago

There is an error between line lines that prints 4 and 5.

Can you try the attached file? It is simplified and a bug is fixed. It will generate only error_smc_fp2.txt file. Can you follow the previous steps? Before testing, delete the previously generated error_smc_fp2.txt file in the home directory. Processes.txt

thierrybo commented 1 year ago

error_smc_fp2.txt

hakandundar34coding commented 1 year ago

It gives error when a bash is run by the application if it is run by using your system GUI. Error: ERROR: ld.so: object 'libgtk3-nocsd.so.0' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.

Probably, processes will be listed when the application is run by using its shortcut after this error is fixed.

For fixing this error, there are some solutions on the web. I did not tried them. There is no similar problem on my system. You may or may not try these solutions.

thierrybo commented 1 year ago

I already seen this error on some programs, do you think this is the cause of my bug?

hakandundar34coding commented 1 year ago

Can you try the attached file? Change its extension to .py

Line that contains the error is removed by the code. But there may be multi-line errors. There may be additional changes for this situation if the attached file works.

This updated file does not write errors to a file.

Processes.txt

thierrybo commented 1 year ago

with this process.txt I see no difference withe the regular one, no process list.

hakandundar34coding commented 1 year ago

The file is updated again. Processes.txt

thierrybo commented 1 year ago

with this process.txt it finally work :-)
BUT:

hakandundar34coding commented 1 year ago

This file does not write errors to a file.

Can you open details window for an user process and check all tabs of this window if there are double dashes (--) on the GUI? You can double click on a process or right click and select details.

Can you also check users tab and user details window for an user?

thierrybo commented 1 year ago

2023-03-12_18-07 2023-03-12_18-08 2023-03-12_18-09 2023-03-12_18-09_1 2023-03-12_18-09_2 2023-03-12_18-10

hakandundar34coding commented 1 year ago

The application is updated. It may be downloadable from Flatpak in about 3-4 hours. The version number did not change. Update is generated by using the relevant code changes.

The updated code removes error text from the command output in order to avoid empty process list.