Bug 1290905

Summary: [abrt] obmenu: minidom.py:522:__getitem__:KeyError: 'name'
Product: [Fedora] Fedora Reporter: mastaiza <mastaizawfm>
Component: obmenuAssignee: Miroslav Lichvar <mlichvar>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: mlichvar, wjhendrickson
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/3a1e422f38318c01ae17b89f3159e02fd1fab392
Whiteboard: abrt_hash:5234d1d841838b78a538242bea1fec163060a24f;
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-24 14:44:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: backtrace
none
File: environ none

Description mastaiza 2015-12-11 20:52:27 UTC
Version-Release number of selected component:
obmenu-1.0-18.fc23

Additional info:
reporter:       libreport-2.6.3
cmdline:        /usr/bin/python /bin/obmenu
dso_list:       python-libs-2.7.10-8.fc23.x86_64
executable:     /bin/obmenu
kernel:         4.2.6-301.fc23.x86_64
runlevel:       N 5
type:           Python
uid:            1000

Truncated backtrace:
minidom.py:522:__getitem__:KeyError: 'name'

Traceback (most recent call last):
  File "/bin/obmenu", line 614, in <module>
    app.init()
  File "/bin/obmenu", line 607, in init
    self.createTree(None, None)
  File "/bin/obmenu", line 41, in createTree
    if self.menu.getMenu(it["id"]) and it["action"] == "":
  File "/usr/lib/python2.7/site-packages/obxml.py", line 340, in getMenu
    d = self._get_item_props(i)
  File "/usr/lib/python2.7/site-packages/obxml.py", line 117, in _get_item_props
    accion = it.attributes["name"].nodeValue
  File "/usr/lib64/python2.7/xml/dom/minidom.py", line 522, in __getitem__
    return self._attrs[attname_or_tuple]
KeyError: 'name'

Local variables in innermost frame:
self: <xml.dom.minidom.NamedNodeMap object at 0x7fef00a98f80>
attname_or_tuple: 'name'

Comment 1 mastaiza 2015-12-11 20:52:31 UTC
Created attachment 1104832 [details]
File: backtrace

Comment 2 mastaiza 2015-12-11 20:52:33 UTC
Created attachment 1104834 [details]
File: environ

Comment 3 wjhendrickson 2015-12-18 12:43:03 UTC
I experience the exact same error on Fedora 22/x86_64 (obmenu-1.0-17/python -2.7.10-8).

I found that my custom menu.xml file (in ~/.config/openbox/) was triggering the problem.  To test, I removed it and obmenu read /etc/xdg/openbox/menu.xml and worked as expected.  My custom menu.xml file had a key inside <item> that should not have been there. 

Basically, I had this syntax, which caused the error:

<item label="firefox">
  <action name="Execute"><command>firefox</command></action>
  <comment>Run Firefox</comment>  
</item>

When I moved the comment key to be nested in action, all was well:

<item label="firefox">
  <action name="Execute">
    <command>firefox</command>
    <comment>Run Firefox</comment>    
  </action>
</item>

This page helped me:

http://openbox.org/wiki/Help:Actions#Action_syntax

My comment key is being ignored, I think - I am not sure it is valid...but that is beside the point.

At any rate, it would be nice if obmenu was more clear about the syntax error, or could at least tell the user that it failed to parse the XML file, and supplied the file name.

Comment 4 Fedora End Of Life 2016-11-24 14:10:45 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.