The module Monitor & Display could not be loaded.

Bug #173768 reported by Paul Weiss on 2007-12-03
34
Affects Status Importance Assigned to Milestone
kde-guidance (Ubuntu)
High
Scott Kitterman
Hardy
High
Scott Kitterman

Bug Description

I downloaded today's (Dec. 3, 2007) Hardy Kubuntu build and tried to adjust my screen resolution, but couldn't do it. When I did that I got this error in the System Settings window: "The module Monitor & Display could not be loaded." When I typed "displayconfig" in terminal I got this output:

*** Error: couldn't find any ServerLayout sections
Traceback (most recent call last):
  File "/usr/bin/displayconfig", line 1483, in slotSecondMonitorToggled
    self._syncGUIScreen()
  File "/usr/bin/displayconfig", line 1182, in _syncGUIScreen
    self.resize_slider.setScreen(self.current_screen)
  File "/usr/share/python-support/kde-guidance/displayconfigwidgets.py", line 46, in setScreen
    self.screensizeslider.setMaxValue(len(screen.getAvailableResolutions())-1)
AttributeError: 'NoneType' object has no attribute 'getAvailableResolutions'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/var/lib/python-support/python2.5/apport_python_hook.py", line 42, in apport_excepthook
    binary = os.path.realpath(os.path.join(os.getcwdu(), sys.argv[0]))
IndexError: list index out of range

Original exception was:
Traceback (most recent call last):
  File "/usr/bin/displayconfig", line 1483, in slotSecondMonitorToggled
    self._syncGUIScreen()
  File "/usr/bin/displayconfig", line 1182, in _syncGUIScreen
    self.resize_slider.setScreen(self.current_screen)
  File "/usr/share/python-support/kde-guidance/displayconfigwidgets.py", line 46, in setScreen
    self.screensizeslider.setMaxValue(len(screen.getAvailableResolutions())-1)
AttributeError: 'NoneType' object has no attribute 'getAvailableResolutions'
Traceback (most recent call last):
  File "/usr/bin/displayconfig", line 1720, in <module>
    displayapp = DisplayApp()
  File "/usr/bin/displayconfig", line 448, in __init__
    self._buildGUI()
  File "/usr/bin/displayconfig", line 510, in _buildGUI
    self.SizePage = SizeOrientationPage(sopage,self.xsetup,self.compact_mode)
  File "/usr/bin/displayconfig", line 1140, in __init__
    self._syncGUI()
  File "/usr/bin/displayconfig", line 1149, in _syncGUI
    self._syncGUIScreen()
  File "/usr/bin/displayconfig", line 1182, in _syncGUIScreen
    self.resize_slider.setScreen(self.current_screen)
  File "/usr/share/python-support/kde-guidance/displayconfigwidgets.py", line 46, in setScreen
    self.screensizeslider.setMaxValue(len(screen.getAvailableResolutions())-1)
AttributeError: 'NoneType' object has no attribute 'getAvailableResolutions'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/var/lib/python-support/python2.5/apport_python_hook.py", line 42, in apport_excepthook
    binary = os.path.realpath(os.path.join(os.getcwdu(), sys.argv[0]))
IndexError: list index out of range

Original exception was:
Traceback (most recent call last):
  File "/usr/bin/displayconfig", line 1720, in <module>
    displayapp = DisplayApp()
  File "/usr/bin/displayconfig", line 448, in __init__
    self._buildGUI()
  File "/usr/bin/displayconfig", line 510, in _buildGUI
    self.SizePage = SizeOrientationPage(sopage,self.xsetup,self.compact_mode)
  File "/usr/bin/displayconfig", line 1140, in __init__
    self._syncGUI()
  File "/usr/bin/displayconfig", line 1149, in _syncGUI
    self._syncGUIScreen()
  File "/usr/bin/displayconfig", line 1182, in _syncGUIScreen
    self.resize_slider.setScreen(self.current_screen)
  File "/usr/share/python-support/kde-guidance/displayconfigwidgets.py", line 46, in setScreen
    self.screensizeslider.setMaxValue(len(screen.getAvailableResolutions())-1)
AttributeError: 'NoneType' object has no attribute 'getAvailableResolutions'

Related branches

Basilio Kublik (sourcercito) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. This bug did not have a package associated with it, which is important for ensuring that it gets looked at by the proper developers. You can learn more about finding the right package at [WWW] https://wiki.ubuntu.com/Bugs/FindRightPackage. I have classified this bug as a bug in kde-guidance

sampattuzzi (sam-pattuzzi) wrote :

I would like to say i got this bug too.

Arpan Patelia (arpan-patelia) wrote :

I faced the same situation during first boot after kubuntu hardy alpha 3(i386) install(screenshot attahced). When I tried to load it in 'Administrator mode' the result was same.

My system is AMD Athlon 3000+ 64-bit, NVidia 6100GeForce on board VGA, Motherboard - ASUS K8N-VM.

The problem is that I can not set appropriate resolution for more testing. I was expecting "Restricted driver helper" to pop up and install drivers for me but that did not happen at all.

I'll keep on testing for more bugs.

Arpan Patelia (arpan-patelia) wrote :

I can confirm this bug. I attached a screenshot as well.

Changed in kde-guidance:
status: New → Confirmed
Sebastian Schack (sschack) wrote :

Another confirmation. Running the latest Hardy...

Igor Tarasov (tarasov-igor) wrote :

Kubuntu Hardy Alpha 4, running as live session - the same bug here.

Marco Cimmino (cimmo) wrote :

still here with up-to-date hardy @ 19 Feb 2008

Marco Cimmino (cimmo) wrote :

I did a bit of debug and I found this:

the problem is in displayconfigwidgets.py line 46 (and next) that object screen passed to the function is null.

but the real problem seems in displayconfig.py @ line 1134 (or 1135)
self.xsetup.getPrimaryScreen() returns null and then assign null to self.current_screen and then pass to the function said above and then produce error.

hope this can help

Harald Seipp (hseipp) wrote :

Problem is still present with Kubuntu Hardy Alpha 5 (i386, liveCD). Installing python-dev as suggested in a related thread did not help.

Sven Boden (svenboden) wrote :

Installing python-dev with e.g. "sudo aptitude install python2.5-dev" only fixes the kcmshell/python problem in user management. It doesn't fix the monitor&display problem.

Harald Seipp (hseipp) wrote :

Looks like the root cause is the integration of the new 1.4.0 X server. This server does no longer require a ServerLayout section in xorg.conf - see that attached xorg.conf for the Alpha 5 live CD.
When starting displayconfig, the code calls /var/lib/python-support/python2.5/displayconfigabstraction.py which still tries to read the ServerLayout section of xorg.conf (line 124), but does not succeed and exits with a failure. This causes the uninitialized screen variables in the calling functions.

Seems like the concept of deducing the X server properties from xorg.conf is hopelessly broken with a mostly self-configuring X server as 1.4.0 (future servers will not even require an xorg.conf at all). There needs to be a smarter way to retrieve the current X server configuration.
A quick-and-dirty approach may be to retrieve the information from Xorg.0.log.

Seems like a _huge_ rework of that module is required anyway.

Harald Seipp (hseipp) wrote :

Looks like the smart way would be to use XRandR (http://www.x.org/wiki/Projects/XRandR) as the preferred way to set screen size, orientation and/or reflection of the outputs for a screen for modern X servers.
Maybe some URandR (http://www.x.org/wiki/Projects/XRandR) or Python-XRandR (https://code.launchpad.net/python-xrandr) python code can be re-used?

mkalle (mail-kallesoee) wrote :

I am also seeing this bug, and its real annoying when you want an external screen on your laptop :(

mkalle (mail-kallesoee) wrote :

I have added this to the xorg.conf
Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
EndSection

Now i can open displayconfig alright, but its pretty empty inside, i dont think ubuntu/xorg has detected my hardware correctly.

i have attached a screen of what X thinks is my graphics card and monitor

mkalle (mail-kallesoee) wrote :

i forgot to add my lspci output

lspci
00:00.0 Host bridge: Intel Corporation Mobile PM965/GM965/GL960 Memory Controller Hub (rev 0c)
00:02.0 VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 0c)
00:02.1 Display controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 0c)
00:19.0 Ethernet controller: Intel Corporation 82566MM Gigabit Network Connection (rev 03)
00:1a.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Contoller #4 (rev 03)
00:1a.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 (rev 03)
00:1a.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 (rev 03)
00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03)
00:1c.0 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 (rev 03)
00:1c.1 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 2 (rev 03)
00:1c.4 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 5 (rev 03)
00:1d.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 (rev 03)
00:1d.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 (rev 03)
00:1d.2 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 (rev 03)
00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 03)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev f3)
00:1f.0 ISA bridge: Intel Corporation 82801HBM (ICH8M-E) LPC Interface Controller (rev 03)
00:1f.1 IDE interface: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) IDE Controller (rev 03)
00:1f.2 SATA controller: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA AHCI Controller (rev 03)
02:06.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev b9)
02:06.1 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev b9)
02:06.2 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 03)
02:06.3 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 20)
02:06.4 System peripheral: Ricoh Co Ltd R5C843 MMC Host Controller (rev 10)
10:00.0 Network controller: Intel Corporation PRO/Wireless 4965 AG or AGN Network Connection (rev 61)

Shaikailash (steve-doc-brown) wrote :

I had the same problem too...kubuntu hardy fresh installed.
I have a laptop, dell xps M1530, nvidia geforce M 8600 GT, i have used the restricted drivers and it works, but cannot change resolutions, and so on..

I tried to add the line in the /etc/X11/xorg.conf and now it seemes to works. Could be helpful:

Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
EndSection

Thank you

Without adding/changing anything manually, it does now work for me - with
all the latest Hardy packages.

2008/2/29, Shaikailash <email address hidden>:
>
> I had the same problem too...kubuntu hardy fresh installed.
> I have a laptop, dell xps M1530, nvidia geforce M 8600 GT, i have used the
> restricted drivers and it works, but cannot change resolutions, and so on..
>
> I tried to add the line in the /etc/X11/xorg.conf and now it seemes to
> works. Could be helpful:
>
>
> Section "ServerLayout"
> Identifier "Default Layout"
> Screen "Default Screen"
> InputDevice "Generic Keyboard"
> InputDevice "Configured Mouse"
> EndSection
>
>
> Thank you
>
>
> --
> The module Monitor & Display could not be loaded.
> https://bugs.launchpad.net/bugs/173768
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Marco Cimmino (cimmo) wrote :

Sebastian Schack:
> Without adding/changing anything manually, it does now work for me - with
> all the latest Hardy packages.
>

cannot confirm at all.

Sun Wukong (sunwukong) wrote :

Hello folks,

Got the same here, with a fresh -installed- Hardy Alpha5 (+ current updates)
kernel i386 2.6.24-10-generic
KDE 3.5.9
python 2.5.2 (python says, but aptitude says 2.5.1-1ubuntu2 )
qt : 3.3.8-b-0ubuntu1 package
python-qt3 : 3.17.4.1ubuntu1

Error seems to come from /var/lib/python-support/python2.5/displayconfigabstraction.py
where the XSetup class is supposed to read the X config from /etc/X11/xorg.conf (default)
those are in fact the same conclusion as Harald Seipp.

The whole module is broken as the X settings has changed. Reading from the conf file fails and it certainly can't write a new-flavour conf file as well.

Harald Seipp (hseipp) wrote :

The first Kubuntu Hardy KDE4 Alpha (https://wiki.kubuntu.org/HardyHeron/Alpha5/KubuntuKDE4) comes with a completely new displayconfig module that indeed uses XRandR.
It is not fully operational yet (settings cannot be changed), but this looks like the right approach.
Hopefully someone will backport that to the stable Kubuntu stream (if not already done).

Harald Seipp (hseipp) wrote :

http://bryceharrington.org/drupal/display-config-1 describes the recent progress of the Ubuntu display configuration.

Harald Seipp (hseipp) wrote :

No progress with Kubuntu Hardy Alpha 6 - still the same error. Strange that such a higly visible malfunction is not getting more attention...

Sven Boden (svenboden) wrote :

It's a problem with the xorg.conf (apparantly some items were removed which Monitor&Display module still looks at), so anyone who by default replaces it by his own probably won't get the error.

For first time users this would be pretty annoying.

Sven Boden (svenboden) wrote :

I ran "kdesudo displayconfig" from a konsole and I get the exact error message as in the original posters (I'm running hardy alpha6).

After fiddling a bit it seems that as pointed out above adding the "ServerLayout" section does the trick. Add it to xorg.conf and it opens again (it won't close anymore but I'll raise another bug for that).

Marco Cimmino (cimmo) wrote :

guys read comment "Harald Seipp wrote on 2008-02-23" that explains what is the *real* problem.
readding "ServerLayout" is not a fix, just a workaround, but this module need to be rewritten as xorg.conf is changing.

Right, but we're close to release. A rewrite isn't happening for Hardy.
Fixups are really all we can do.

Marco Cimmino (cimmo) wrote :

this is a pity since the bug was filed on December :(
anyway better a workaround than nothing, but a question: Ubuntu how they do?

Changed in kde-guidance:
assignee: nobody → kitterman
importance: Undecided → High
status: Confirmed → In Progress
Harald Seipp (hseipp) wrote :

If a re-write for Hardy is no option and the module is broken by design, what can we do?

a) Remove it entirely and let the user deal with command-line xrandr

If "fixup" allows to port/backport

b) Backport the one from Kubuntu-Hardy-KDE4 that is prepared for XRandR
c) Port the one from Ubuntu Hardy (http://bryceharrington.org/drupal/display-config-1)

While a) would be the conservative approach - "don't expose what's broken", b) and c) would be the more adventureous approaches where b) opens the perspective to get common codestreams for KDE and KDE4.

Anyone with a better idea?

Sven Boden (svenboden) wrote :

For now I would prefer Scott's idea on the development list, option "d)": use the workaround for 8.4/KDE3. It would be sufficient for beginning users, while more advanced users can install whatever they like.

a) is not really acceptable. And looking at time constraints/testing cycles I would keep b) or c) for 8.10

xrandr is not a perfect solution either. See the blog post you link to about
it's bugginess. Also that's a gtk2/gnome tool, not one appropriate for
Kubuntu.

What I'm currently attempting is to see if I can teach displayconfig to
believe in a sane set of defaults if parts or all of xorg are missing. I
don't know yet if it will help or if it does how much.

Scott Kitterman (kitterman) wrote :

I've uploaded a test package to my that makes displaymanager work for me when I remove the ServerLayout section from my xorg.conf. If I can quickly get some test feedback, I can probably get this uploaded before the beta freeze:

https://launchpad.net/~kitterman/+archive

Sven Boden (svenboden) wrote :

Hereby confirmed the changes/workaround work for the default xorg.conf

2 gripes:
- only 640x480 and 800x600 resolution.
- Gamma correction doesn't work... it also didn't work before the changes and I will open a new bug tracker for it.

Henrik Nilsen Omma (henrik) wrote :

Setting beta milestone. If we get the fix in soonish we can test it in beta fix verification also (see: https://wiki.ubuntu.com/Testing/ISO/Schedule)

Changed in kde-guidance:
milestone: none → ubuntu-8.04-beta
Scott Kitterman (kitterman) wrote :

This should be ready to upload shortly.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package kde-guidance - 0.8.0svn20080103-0ubuntu4

---------------
kde-guidance (0.8.0svn20080103-0ubuntu4) hardy; urgency=low

  * Add kubuntu_14_displayconfig_survive_no_serverlayout.patch so
    displaymanager doesn't crash if xorg.conf has no ServerLayout section
    (LP: #173768)
  * Add to kubuntu_12_powermanager_survive_no_brightness.patch so it doesn't
    crash if DBUS thinks there is brightness, but is wrong

 -- Scott Kitterman <email address hidden> Wed, 12 Mar 2008 10:19:57 -0400

Changed in kde-guidance:
status: In Progress → Fix Released
Scott Kitterman (kitterman) wrote :

Work around for the resolution issue is to go into the Hardware tab and configure your monitor to use a generic LCD/monitor with the desired resolution. Would you please try that.

daniel2501 (daniel2501) wrote :

kcmshell displayconfig gives:

Pythonize constructor -- pid = 20864
Python interpreter initialized!

Pythonize constructor -- pid = 20864
Traceback (most recent call last):
  File "<string>", line 8, in kcontrol_bridge_create_displayconfig
  File "/var/lib/python-support/python2.5/displayconfig.py", line 1705, in create_displayconfig
    return DisplayApp(parent, name)
  File "/var/lib/python-support/python2.5/displayconfig.py", line 441, in __init__
    self.xsetup = XSetup(self.xconfigpath)
  File "/var/lib/python-support/python2.5/displayconfigabstraction.py", line 77, in __init__
    self.xorg_config = xorgconfig.readConfig(xorg_config_filename)
  File "/var/lib/python-support/python2.5/xorgconfig.py", line 807, in readConfig
    raise ParseException,"Unknown line type '%s' on line %i" % (first,line)
xorgconfig.ParseException: Unknown line type 'section' on line 69
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/apport_python_hook.py", line 71, in apport_excepthook
    pr['PythonArgs'] = '%r' % sys.argv
AttributeError: 'module' object has no attribute 'argv'

Original exception was:
Traceback (most recent call last):
  File "<string>", line 8, in kcontrol_bridge_create_displayconfig
  File "/var/lib/python-support/python2.5/displayconfig.py", line 1705, in create_displayconfig
    return DisplayApp(parent, name)
  File "/var/lib/python-support/python2.5/displayconfig.py", line 441, in __init__
    self.xsetup = XSetup(self.xconfigpath)
  File "/var/lib/python-support/python2.5/displayconfigabstraction.py", line 77, in __init__
    self.xorg_config = xorgconfig.readConfig(xorg_config_filename)
  File "/var/lib/python-support/python2.5/xorgconfig.py", line 807, in readConfig
    raise ParseException,"Unknown line type '%s' on line %i" % (first,line)
xorgconfig.ParseException: Unknown line type 'section' on line 69
error: *** runFunction failure

I'm running 8.04 Beta 1

Scott Kitterman (kitterman) wrote :

Please attach a copy of /etc/X11/xorg.conf to the bug.

Jean Cremers (jeancremers) wrote :

I still have this bug, hardy heron 8.04

output of 'displayconfig'

Traceback (most recent call last):
  File "/usr/bin/displayconfig", line 1754, in <module>
    displayapp = DisplayApp()
  File "/usr/bin/displayconfig", line 441, in __init__
    self.xsetup = XSetup(self.xconfigpath)
  File "/var/lib/python-support/python2.5/displayconfigabstraction.py", line 78,
 in __init__
    self.xorg_config, self.hasxorg = xorgconfig.readConfig(xorg_config_filename,
 check_exists=True)
  File "/var/lib/python-support/python2.5/xorgconfig.py", line 771, in readConfi
g
    raise ParseException,"Unknown line type '%s' on line %i" % (first,line)
xorgconfig.ParseException: Unknown line type 'section' on line 55
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/apport_python_hook.py", line 78, in app ort_excepthook
    report_file = open(pr_filename, 'wt')
IOError: [Errno 13] Permission denied: '/var/crash/_usr_bin_python2.5.1000.crash

I had this problem also (Hardy Heron kubuntu stable on AMD64). I was just getting ready to give up, when I noticed the following error in the displayconfig error trace:

    raise ParseException,"Unknown line type '%s' on line %i" % (first,line)
xorgconfig.ParseException: Unknown line type 'allowmouseopenfail#' on line 55
error: *** runFunction failure
;

I found that I had a line in xorg.conf that read:
AllowMouseOpenFail

man xorg.conf says:
" ... Boolean options may optionally have a value specified. When no value is specified, the option’s value is TRUE."

Looks like displayconfig does not obey this convention.

Once I explicitly specified a value for the boolean like so:

AllowMouseOpenFail "true"

displayconfig works fine.

Hope this helps in fixing the error / resolving the problem for others.

Small typo in my previous post. The correct syntax for AllowMouseOpenFail (as in xorg.conf) should be:

Option "AllowMouseOpenFail" "true"

with that displayconfig works fine. Without the "true" specified explicitly, the X server will work, but displayconfig crashes

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers