manatools / dnfdragora

dnfdragora is a dnf frontend based on libyui abstraction
GNU General Public License v3.0
137 stars 41 forks source link

Update check cannot be proceed #155

Closed Ricky-Tigg closed 4 years ago

Ricky-Tigg commented 4 years ago

OS: Fedora; Component: dnfdragora.noarch 2.0.0-2.fc32. Tested on Wayland.

Steps to reproduce: Ensure that no dnfdragora session process is going on and an internet connection is established then execute in terminal dnfdragora.

Results: The application is launched and unable to proceed the operation covering the update check. The following strings are endlessly produced till Quit is invoked which ends the session.

/usr/lib64/python3.8/site-packages/yui.py:1472: Warning: Source ID 64 was not found when attempting to remove it
  return _yui.YDialog_waitForEvent(self, timeout_millisec)
Get root backend. Locked (False)

Here is the complete output with the redundant strings truncated which is indicated there by the mention # (...).

$ dnfdragora
Try reading configuration file
From ./dnfdragora.yaml
Skipped exception: <[Errno 2] Tiedostoa tai hakemistoa ei ole: './dnfdragora.yaml'> 
From /etc/dnfdragora/dnfdragora.yaml
Finally read user settings from /home/yk/.config/dnfdragora.yaml
Logging disabled
<_M_> [ui] YUILoader.cc:50 loadUI(): DISPLAY: ":0"
<_M_> [ui] YUILoader.cc:51 loadUI(): XDG_CURRENT_DESKTOP: "GNOME"
<_M_> [ui] YUILoader.cc:52 loadUI(): YUI_PREFERED_BACKEND: ""
<_M_> [ui] YUILoader.cc:64 loadUI(): Detected a Gtk-based desktop environment.
<_M_> [ui] YUILoader.cc:64 loadUI(): Prefering Gtk-UI if available and no
<_M_> [ui] YUILoader.cc:64 loadUI(): user-selected override is present.
<_M_> [ui] YUILoader.cc:86 loadUI(): User-selected UI-plugin: ""
<_M_> [ui] YPath.cc:49 YPath(): Given filename: libyui-gtk.so.8
<_M_> [ui] YSettings.cc:74 progDir(): progDir: ""
<_M_> [ui] YPath.cc:65 YPath(): Preferring subdir: 
<_M_> [ui] YPath.cc:66 YPath(): Subdir given with filename: 
<_M_> [ui] YPath.cc:67 YPath(): Looking for: libyui-gtk.so.8
<_M_> [ui] YPath.cc:138 lsDir(): Looking in /usr/lib64/yui
<_M_> [ui] YPath.cc:118 YPath(): Found libyui-gtk.so.8 in /usr/lib64/yui
<_M_> [ui] YPath.cc:49 YPath(): Given filename: libyui-ncurses.so.8
<_M_> [ui] YSettings.cc:74 progDir(): progDir: ""
<_M_> [ui] YPath.cc:65 YPath(): Preferring subdir: 
<_M_> [ui] YPath.cc:66 YPath(): Subdir given with filename: 
<_M_> [ui] YPath.cc:67 YPath(): Looking for: libyui-ncurses.so.8
<_M_> [ui] YPath.cc:138 lsDir(): Looking in /usr/lib64/yui
<_M_> [ui] YPath.cc:118 YPath(): Found libyui-ncurses.so.8 in /usr/lib64/yui
<_M_> [ui] YPath.cc:49 YPath(): Given filename: libyui-qt.so.8
<_M_> [ui] YSettings.cc:74 progDir(): progDir: ""
<_M_> [ui] YPath.cc:65 YPath(): Preferring subdir: 
<_M_> [ui] YPath.cc:66 YPath(): Subdir given with filename: 
<_M_> [ui] YPath.cc:67 YPath(): Looking for: libyui-qt.so.8
<_M_> [ui] YPath.cc:138 lsDir(): Looking in /usr/lib64/yui
<_M_> [ui] YPath.cc:118 YPath(): Found libyui-qt.so.8 in /usr/lib64/yui
<_M_> [ui] YUILoader.cc:118 loadUI(): Using UI-plugin: "gtk"
<_M_> [ui] YSettings.cc:179 loadedUI(): Set loadedUI to "gtk"
<_M_> [ui] YSettings.cc:180 loadedUI(): loadedUI is now locked.
<_M_> [ui] YPath.cc:49 YPath(): Given filename: libyui-gtk.so.8
<_M_> [ui] YSettings.cc:74 progDir(): progDir: ""
<_M_> [ui] YPath.cc:65 YPath(): Preferring subdir: 
<_M_> [ui] YPath.cc:66 YPath(): Subdir given with filename: 
<_M_> [ui] YPath.cc:67 YPath(): Looking for: libyui-gtk.so.8
<_M_> [ui] YPath.cc:138 lsDir(): Looking in /usr/lib64/yui
<_M_> [ui] YPath.cc:118 YPath(): Found libyui-gtk.so.8 in /usr/lib64/yui
<_M_> [ui] YUI.cc:76 YUI(): This is libyui 3.3.3
<_M_> [ui] YUI.cc:77 YUI(): Creating UI without threads
<_M_> [gtk] YGUI.cc:48 YGUI(): This is libyui-gtk 2.44.9
<_M_> [gtk] YGUI.cc:166 checkInit(): Style "/usr/share/libyui/theme/current/wizard/style.css"
<_M_> [gtk] YGUI.cc:188 checkInit(): Style "/usr/share/libyui/theme/current/wizard/style.css" not found. Ignoring style
<WRN> [gtk] YGUtils.cc:543 loadPixbuf(): Could not load icon: /usr/share/libyui/theme/icons/32x32/apps/yast.png
<WRN> [gtk] YGUtils.cc:543 loadPixbuf(): Reason: Tiedoston “/usr/share/libyui/theme/icons/32x32/apps/yast.png” avaus epäonnistui: Tiedostoa tai hakemistoa ei ole
<_M_> [ui] YUI.cc:230 topmostConstructorHasFinished(): Running without threads
<_M_> [ui] YSettings.cc:197 loadedUI(): loadedUI: "gtk"
<_M_> [ui] YPath.cc:49 YPath(): Given filename: libyui-mga-gtk.so.8
<_M_> [ui] YSettings.cc:74 progDir(): progDir: ""
<_M_> [ui] YPath.cc:65 YPath(): Preferring subdir: 
<_M_> [ui] YPath.cc:66 YPath(): Subdir given with filename: 
<_M_> [ui] YPath.cc:67 YPath(): Looking for: libyui-mga-gtk.so.8
<_M_> [ui] YPath.cc:138 lsDir(): Looking in /usr/lib64/yui
<_M_> [ui] YPath.cc:118 YPath(): Found libyui-mga-gtk.so.8 in /usr/lib64/yui
<_M_> [ui] YPath.cc:49 YPath(): Given filename: libyui-mga-gtk.so.8
<_M_> [ui] YSettings.cc:74 progDir(): progDir: ""
<_M_> [ui] YPath.cc:65 YPath(): Preferring subdir: 
<_M_> [ui] YPath.cc:66 YPath(): Subdir given with filename: 
<_M_> [ui] YPath.cc:67 YPath(): Looking for: libyui-mga-gtk.so.8
<_M_> [ui] YPath.cc:138 lsDir(): Looking in /usr/lib64/yui
<_M_> [ui] YPath.cc:118 YPath(): Found libyui-mga-gtk.so.8 in /usr/lib64/yui
<_M_> [ew] YExternalWidgets.cc:37 YExternalWidgets(): Creating Libyui External Widgets object
<_M_> [gtk] YMGA_GCBTable.cc:415 YMGA_GCBTable():  Slection mode 2
<_M_> [gtk] YMGA_GCBTable.cc:434 YMGA_GCBTable():  columns 8 tot 8
/usr/lib64/python3.8/site-packages/yui.py:1472: Warning: Source ID 51 was not found when attempting to remove it
  return _yui.YDialog_waitForEvent(self, timeout_millisec)
Get root backend. Locked (False)
Get root backend. Locked (False)
/usr/lib64/python3.8/site-packages/yui.py:1472: Warning: Source ID 64 was not found when attempting to remove it
  return _yui.YDialog_waitForEvent(self, timeout_millisec)
Get root backend. Locked (False)

# (...)

/usr/lib64/python3.8/site-packages/yui.py:1472: Warning: Source ID 294 was not found when attempting to remove it
  return _yui.YDialog_waitForEvent(self, timeout_millisec)
Get root backend. Locked (False)
Get root backend. Locked (False)
Get root backend. Locked (False)
<_M_> [ui] YUILoader.cc:163 deleteUI(): Shutting down UI
<_M_> [ew] YExternalWidgets.cc:116 ~YExternalWidgetsTerminator(): Shutting down mga External Widgets
<_M_> [ew] YMGAWidgetExtensionFactory.cc:49 ~YMGAWidgetFactory(): Factory removed
anaselli commented 4 years ago

Something went wrong and the db is still locked. In my TODO is present the item "Let the user know when DB is locked on dnfdragora startup" , that i haven't implemented yet. Maybe you could enable logging with debug level, that could help because it could be a crash also by using dnfdragora update. The process could also be left active, but in some way a dnfdragora --exit should be run. I'm experiencing a crash during notification in dnfdragora-update and that using fedora rawhide, maybe the problem is present using f32 too, that's why enabling logging could help.

Ricky-Tigg commented 4 years ago

Hey. The redundant string are produced in an non-interrupted flow. Therefore no command can be inserted, which applies then to dnfdragora --exit. The child process –which is at /usr/bin/python3 /usr/bin/dnfdragora – is dully ended when quitting the application.

This issue can be reproduced on demand. When the system is rebooted, the packages cache can be created once more along with those redundant strings. Though it could be as well twice while the system was disconnected from internet for the first time, both with options All and To update selected. The third time after internet connection was re-established the issue was permanent.

Here is troubleshooting protocol I adopted:

troubleshooting_protocol_journalctl_dnfdragora

anaselli commented 4 years ago

concernig debugging thanks to think to it, if you're able to you can run it using python3

python3 -mpdb `which dnfdragora`

To enable logging just co to user preferences and fix your parameterres such as logging directory (that must exist and be writeable for your user) and check the debug level.

To run dnfdragora --exit you could run it in a different terminal the running process should at that point connect to dnfdaemon correctly, or kill dnfdragora run it with --exit and run it again normally.

I found a problem with dnfdragora-update if you run dnfdragora from its menu it exits badly cause of notifier, maybe it is that.

Ricky-Tigg commented 4 years ago

Today, be the internet connection established or not, and the application launched from its icon or terminal, the packages cache were created. Here is the interface of User preferences on my system; Options whose check-boxes could be checked were checked. Therefore neither Log options nor Debug level are checkable.

dnfdragoa_user_preferences

I may not be in an adequate situation to execute the suggested command, unless(Pdb) expects a command.

$ python3 -mpdb `which dnfdragora`
> /usr/bin/dnfdragora(13)<module>()
-> import sys
(Pdb) 
anaselli commented 4 years ago

Odd Log Options should enable other sub option. Below a preview of next options presentation

immagine

Regarding debug you did right, if you write r it runs, help for helps and b or cl for adding or removing breakpoints. But i may suggest to look for manual if you're not familiar in debugging python.

Of course also testing from master is more than welcome, using virtualenv (python virtual environment) as described into the read me file you even don't need to install in the system but in your home, with an easy to remove directory to uninstall all. We usually call it venv for simplicity. Thank for your help

anaselli commented 4 years ago

Just to be sure you don't have the same problem as in issue #149 In which you can find a workaround.

Moreover you can also change your configuration file ~/.config/dndragora.yaml outside dnfdragora an example is: https://github.com/manatools/dnfdragora/blob/2.0.4/dnfdragora.yaml.user_prefs.example

Ricky-Tigg commented 4 years ago

Configuration files locations in my system

$ rpm -ql dnfdragora | grep '.yaml'
/etc/dnfdragora/dnfdragora.yaml
/usr/share/doc/dnfdragora/dnfdragora.yaml.example
/usr/share/doc/dnfdragora/dnfdragora.yaml.user_prefs.example
/usr/share/man/man5/dnfdragora.yaml.5.g

Changes were applied to /etc/dnfdragora/dnfdragora.yaml by discommenting these lines:

log_filename: PATH/TO/dnfdragora.log
log_level_debug: True

Though it had no effect inside the application interface. The developer environment cannot be set on my system. See Red Hat Bugzilla – Bug 1869191.

Issue #149 illustrates an output that has at best the expression 'python3.8/site-packages' in common with the output resulting from dnfdragora in my system. I must lack knowledge to determine that it could be the same issue.

anaselli commented 4 years ago

Supposed your home /home/ricky you could set that directory as PATH/TO... To see if you have the same problem just remove the ~/.config/dnfdragora.yaml and do same steps as described in that issue. If all starts well then it was.

Anyway when I'm back I will post a configuration example for enabling logging. The hope is to fix a rawhide crash to release new version of dnfdragora :)

Ricky-Tigg commented 4 years ago

Component dnfdragora-updater was not installed along with the installation of component dnfdragora;. Changelog_filename: /home/yk//dnfdragora.log was applied to _/etc/dnfdragora/dnfdragora.yam_l:

Also modifying the extension name acts the same as 'rm ~/.config/dnfdragora.yaml'. dnfdragora-updater & did not launch the graphical application and froze at the last line of the output.

$ rm ~/.config/dnfdragora.yaml
$ killall dnfdragora-updater
$ sudo killall dnfdaemon-system

$ dnfdragora-updater &
[1] 20138
[yk@localhost ~]$ Try reading configuration file
From ./dnfdragora.yaml
Skipped exception: <[Errno 2] No such file or directory: './dnfdragora.yaml'> 
From /etc/dnfdragora/dnfdragora.yaml
Finally read user settings from /home/yk/.config/dnfdragora.yaml
Skipped exception: <[Errno 2] No such file or directory: '/home/yk/.config/dnfdragora.yaml'> 
Logging disabled

(dnfdragora-updater:20138): Gtk-CRITICAL **: 13:32:23.490: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed
anaselli commented 4 years ago

Here I am back on this subject, a minimal ~/.config/dnfdragora.yaml content that should work is (changing HOMENAME):

settings:
  log:
    directory: /home/HOMENAME/
    enabled: true
    level_debug: true
  metadata:
    last_update: 2020-08-22 22:30
    update_interval: 48
  search:
    match_all: false
    newest_only: false
view:
  filter: all
  show: groups

Below a script to create the config file by hands (just copy and paste for you, other users should change directory: /home/yk/logs line). Note that You must run it on a console using your user. Do not write it as root or using sudo Errors to create it should be resolved in newer releases.

mkdir -p ~/logs
echo "settings:" > ~/.config/dnfdragora.yaml
echo "  log:" >> ~/.config/dnfdragora.yaml
echo "    directory: /home/yk/logs" >> ~/.config/dnfdragora.yaml
echo "    enabled: true" >> ~/.config/dnfdragora.yaml
echo "    level_debug: true" >> ~/.config/dnfdragora.yaml
echo "  metadata:" >> ~/.config/dnfdragora.yaml
echo "    last_update: 2020-08-22 22:30" >> ~/.config/dnfdragora.yaml
echo "    update_interval: 48" >> ~/.config/dnfdragora.yaml
echo "  search:" >> ~/.config/dnfdragora.yaml
echo "    match_all: false" >> ~/.config/dnfdragora.yaml
echo "    newest_only: false" >> ~/.config/dnfdragora.yaml
echo "view:" >> ~/.config/dnfdragora.yaml
echo "  filter: all" >> ~/.config/dnfdragora.yaml
echo "  show: groups" >> ~/.config/dnfdragora.yaml
Ricky-Tigg commented 4 years ago

I have been able to run commands python3, dnfdragora and dnfdragora-updater from Rawhde repository. The application's interface was then identical to the one from the stable repository. Not the version from your Master then.

I confirm that the configuration has the expected effect:

dnfdragora_dev_logs

Regarding the debugging relying on Python3, the manual confused me enough to be unable to understand it Logs in a non-optimal environment were nevertheless created: dnfdragora.log

anaselli commented 4 years ago

Seems to be working there, is all ok now?

Ricky-Tigg commented 4 years ago

The application works well enough assuming those observations:

anaselli commented 4 years ago

Warning: Source ID 51 was not found when attempting to remove it return _yui.YDialog_waitForEvent(self, timeout_millisec)

Already fixed in libyui-gtk (2.49.0)

Get root backend. Locked (False)

Should not happen if dnfdaaemon is not locked, i.e. dnfdragora is already running or is crashed badly (workaround is running from console dnfdragora --exit) I maybe write it once, only on change status in future...

And Log Options has been fixed on master thanks to your report. I would close this bug if you agree, feel free to open a new one if there is anything else.