Bug 11541 - System-config-printer can't start from drakconf
Summary: System-config-printer can't start from drakconf
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: x86_64 Linux
Priority: release_blocker critical
Target Milestone: ---
Assignee: Nicolas Lécureuil
QA Contact:
URL:
Whiteboard:
Keywords:
: 11427 11514 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-10-25 12:43 CEST by Jean-Marc Sarat
Modified: 2013-12-19 12:35 CET (History)
6 users (show)

See Also:
Source RPM: system-config-printer
CVE:
Status comment:


Attachments

Description Jean-Marc Sarat 2013-10-25 12:43:43 CEST
Description of problem:

system-config-printer crash when launched fron MCC but runs fin when lauched from a terminal

Version-Release number of selected component (if applicable): 1.4.2-5.mga4

How reproducible:
Every time when system-config-printer is launched from MCC

More details :

Traceback (most recent call last):
  File "/usr/share/system-config-printer/system-config-printer.py", line 2136, in <module>
    main(show_jobs)
  File "/usr/share/system-config-printer/system-config-printer.py", line 2108, in main
    mainwindow = GUI()
  File "/usr/share/system-config-printer/system-config-printer.py", line 203, in __init__
    PlugWindow = gtk.Plug(PlugWindowId)
NameError: global name 'gtk' is not defined


Reproducible: 

Steps to Reproduce:
Comment 1 Frank Griffin 2013-10-25 13:08:49 CEST
I confirm.  I haven't had occasion to use s-c-p lately until yesterday, and I noticed this.  Launching from a terminal as root worked, but launching from MCC failed reliably.

CC: (none) => ftg

David Walser 2013-10-25 17:35:06 CEST

Assignee: bugsquad => nicolas.lecureuil

Comment 2 Frank Griffin 2013-10-25 17:55:57 CEST
Here is the stdout/stderr from running mcc from the command line:

[ftg@ftgme2 ~]$ mcc
LOG **: NP_Initialize at /usr/lib/libDrakX/mygtk2.pm line 589.
LOG **: NP_Initialize succeeded at /usr/lib/libDrakX/mygtk2.pm line 589.
LOG **: NP_Initialize at /usr/lib/libDrakX/mygtk2.pm line 589.
LOG **: NP_Initialize succeeded at /usr/lib/libDrakX/mygtk2.pm line 589.
LOG **: NP_Initialize at /usr/lib/libDrakX/mygtk2.pm line 589.
LOG **: NP_Initialize succeeded at /usr/lib/libDrakX/mygtk2.pm line 589.
LOG **: NP_Initialize at /usr/lib/libDrakX/mygtk2.pm line 589.
LOG **: NP_Initialize succeeded at /usr/lib/libDrakX/mygtk2.pm line 589.
"/usr/sbin/drakmenustyle" is not executable [Menus] at /usr/libexec/drakconf line 823.
"/usr/sbin/drakbackup" is not executable [Backups] at /usr/libexec/drakconf line 823.
"/usr/sbin/tomoyo-gui" is not executable [Tomoyo Policy] at /usr/libexec/drakconf line 823.
java version "1.7.0_45"
OpenJDK Runtime Environment (mageia-2.4.3.2.mga4-x86_64 u45-b15)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)
Traceback (most recent call last):
  File "/usr/share/system-config-printer/system-config-printer.py", line 2136, in <module>
    main(show_jobs)
  File "/usr/share/system-config-printer/system-config-printer.py", line 2108, in main
    mainwindow = GUI()
  File "/usr/share/system-config-printer/system-config-printer.py", line 203, in __init__
    PlugWindow = gtk.Plug(PlugWindowId)
NameError: global name 'gtk' is not defined
Nicolas Lécureuil 2013-10-25 18:10:44 CEST

Priority: Normal => release_blocker
CC: (none) => makowski.mageia
Severity: major => critical

Comment 3 Juergen Harms 2013-10-26 15:45:42 CEST
see also https://bugs.mageia.org/show_bug.cgi?id=11427 - looks like duplicates. 

And for priority and severity I agree: Release blocker and critical is more adequaate than high and major

CC: (none) => juergen.harms

Comment 4 Manuel Hiebel 2013-10-26 18:45:09 CEST
*** Bug 11427 has been marked as a duplicate of this bug. ***
Comment 5 Manuel Hiebel 2013-10-26 18:46:27 CEST
(In reply to Frank Griffin from comment #1)
>  Launching from a terminal as root worked, but launching
> from MCC failed reliably.
Could it be a polkit regression bug ?

CC: (none) => mageia, thierry.vignaud
Summary: System-config-printer can't start => System-config-printer can't start from drakconf

Comment 6 Philippe Makowski 2013-10-26 21:25:39 CEST
a PyGTK problem, it seems that it need to be modified to use new PyGTK
Comment 7 Frank Griffin 2013-10-26 22:19:08 CEST
(In reply to Manuel Hiebel from comment #5)
> (In reply to Frank Griffin from comment #1)
> >  Launching from a terminal as root worked, but launching
> > from MCC failed reliably.
> Could it be a polkit regression bug ?

I really don't know.  But shouldn't all of the authorization issues be history once MCC is running ?  I mean, after the initial root password prompt, MCC is running as root, correct ?

I can't recall whether I tried MCC from a root or non-root command line to get the above data...
Comment 8 Philippe Makowski 2013-10-26 22:32:13 CEST
The problem come from our Embedded mode
system-config-printer-1.4.2-mga_custom-embedded_window.patch need to be changed
at least instead of

@@ -192,6 +196,16 @@ class GUI(GtkGUI):
 
                         domain=config.PACKAGE)
 
+        if PlugWindowId:
+            self.PrintersWindow.hide()
+            # the "vbox4" widget
+            vbox = self.PrintersWindow.get_children()[0]
+            PlugWindow = gtk.Plug(PlugWindowId)
+            gtk.Container.remove(self.PrintersWindow, vbox)
+            PlugWindow.add(vbox)
+            self.PrintersWindow.set_transient_for(PlugWindow)
+            PlugWindow.show_all()
+            self.PrintersWindow = PlugWindow

we need to write 

@@ -192,6 +196,16 @@ class GUI(GtkGUI):
 
                         domain=config.PACKAGE)
 
+        if PlugWindowId:
+            self.PrintersWindow.hide()
+            # the "vbox4" widget
+            vbox = self.PrintersWindow.get_children()[0]
+            PlugWindow = Gtk.Plug(PlugWindowId)
+            Gtk.Container.remove(self.PrintersWindow, vbox)
+            PlugWindow.add(vbox)
+            self.PrintersWindow.set_transient_for(PlugWindow)
+            PlugWindow.show_all()
+            self.PrintersWindow = PlugWindow

since now in system-config-printer.py we have
from gi.repository import Gtk

instead of previous
import gtk


But I don't know if it is enough

can someone test it ?
Comment 9 Thierry Vignaud 2013-10-27 14:32:19 CET
It's better: it doesn't crash but it still not displayed.
I've also fixed system-config-printer-1.4.2-mga_custom-system-config-printer.patch which had a similar issue.

But We still have an issue:

/usr/lib64/python2.7/site-packages/gi/overrides/Gtk.py:445: Warning: value "((GtkWindowType) 56640845)" of type 'GtkWindowType' is invalid or out of range for property 'type' of type 'GtkWindowType'
  Gtk.Window.__init__(self, type=type, **kwds)
Comment 10 Thierry Vignaud 2013-10-27 14:50:54 CET
This happens on the following line:

PlugWindow = Gtk.Plug(PlugWindowId)


Probably a regression from pygtk2 to python-gi. The issue is that we're probably the only users of Gtk.Plug using python...
Comment 11 Thierry Vignaud 2013-10-27 14:54:32 CET
Closing this one

Status: NEW => RESOLVED
Resolution: (none) => FIXED

Comment 12 Thierry Vignaud 2013-10-27 14:57:14 CET
See Bug #11546 for the python-gi issue
Comment 13 Thierry Vignaud 2013-12-19 12:35:47 CET
*** Bug 11514 has been marked as a duplicate of this bug. ***

CC: (none) => axonefr


Note You need to log in before you can comment on or make changes to this bug.