Bug 588002

Summary: [abrt] crash in yum-3.2.27-2.fc12: utils.py:108:show_lock_owner:TypeError: 'NoneType' object is unsubscriptable
Product: [Fedora] Fedora Reporter: Jayrome <jayrome>
Component: yumAssignee: Seth Vidal <skvidal>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 12CC: bugzilla.acct, drfudgeboy, ffesti, hrft, james.antill, mads, maxamillion, pmatilai, tim.lauridsen
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: abrt_hash:7cdc7b34
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-12-03 15:12:37 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:
Bug Depends On:    
Bug Blocks: 687889    
Attachments:
Description Flags
File: backtrace none

Description Jayrome 2010-05-02 04:46:06 UTC
abrt 1.0.9 detected a crash.

architecture: x86_64
cmdline: /usr/bin/python /usr/bin/yum -y install esound-libs.i686
component: yum
executable: /usr/bin/yum
kernel: 2.6.32.11-99.fc12.x86_64
package: yum-3.2.27-2.fc12
reason: utils.py:108:show_lock_owner:TypeError: 'NoneType' object is unsubscriptable
release: Fedora release 12 (Constantine)

backtrace
-----
utils.py:108:show_lock_owner:TypeError: 'NoneType' object is unsubscriptable

Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 254, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 103, in main
    show_lock_owner(e.pid, logger)
  File "/usr/share/yum-cli/utils.py", line 108, in show_lock_owner
    if ps['name'] == 'yumBackend.py':
TypeError: 'NoneType' object is unsubscriptable

Local variables in innermost frame:
ps: None
logger: <logging.Logger instance at 0x1aa1f38>
pid: 8215

Comment 1 Jayrome 2010-05-02 04:46:08 UTC
Created attachment 410755 [details]
File: backtrace

Comment 2 James Antill 2010-05-02 05:23:47 UTC
This Bug is already fixed, Run: yum update yum

Comment 3 Thom Carlin 2010-06-15 12:45:49 UTC
Still occurs in 3.2.27-4

Comment 4 Mads Kiilerich 2010-06-17 21:44:52 UTC
Confirmed - abrt just reported this crash with yum-3.2.27-4.fc13. It filed it as a duplicate of this, so I reopen it.

AFAICS get_process_info can return None for example in the racy situation where the process just went away.

Proposed patch:

--- /usr/share/yum-cli/utils.py.org	2010-06-17 23:42:45.000000000 +0200
+++ /usr/share/yum-cli/utils.py	2010-05-03 17:53:03.000000000 +0200
@@ -100,10 +100,10 @@
     return ps
 
 def show_lock_owner(pid, logger):
-    ps = get_process_info(pid)
-    if not ps:
+    if not pid:
         return
 
+    ps = get_process_info(pid)
     # This yumBackend isn't very friendly, so...
     if ps['name'] == 'yumBackend.py':
         nmsg = _("  The other application is: PackageKit")

Comment 5 Mads Kiilerich 2010-06-17 21:46:00 UTC
Baah:

--- /usr/share/yum-cli/utils.py.org	2010-05-03 17:53:03.000000000 +0200
+++ /usr/share/yum-cli/utils.py	2010-06-17 23:42:45.000000000 +0200
@@ -100,10 +100,10 @@
     return ps
 
 def show_lock_owner(pid, logger):
-    if not pid:
+    ps = get_process_info(pid)
+    if not ps:
         return
 
-    ps = get_process_info(pid)
     # This yumBackend isn't very friendly, so...
     if ps['name'] == 'yumBackend.py':
         nmsg = _("  The other application is: PackageKit")

Comment 6 James Heather 2010-08-13 11:18:47 UTC
Still happening... see below. Looking at my yum log, this was after the 6 Aug update to yum-3.2.28-1.fc13.noarch, but before the 8 Aug updates to yum-utils and some plugins.

Looks like the patch Mads provided above hasn't been committed.

James

---------------

Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: yum-updatesd-he
    Memory : 220 M RSS (600 MB VSZ)
    Started: Sun Aug  8 09:04:31 2010 - 09:03 ago
    State  : Sleeping, pid: 4565
Another app is currently holding the yum lock; waiting for it to exit...
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 258, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 104, in main
    show_lock_owner(e.pid, logger)
  File "/usr/share/yum-cli/utils.py", line 112, in show_lock_owner
    nmsg = _("  The other application is: %s") % ps['name']
TypeError: 'NoneType' object is unsubscriptable

Comment 7 Mads Kiilerich 2010-08-13 11:46:00 UTC
(In reply to comment #6)
> Looks like the patch Mads provided above hasn't been committed.

Another fix was committed instead - but that fix wasn't complete.

I now propose this:

--- /usr/share/yum-cli/utils.py	2010-08-09 21:34:16.000000000 +0200
+++ utils.py	2010-08-13 13:43:49.000000000 +0200
@@ -101,12 +101,13 @@
     return ps
 
 def show_lock_owner(pid, logger):
-    if not pid:
+    ps = get_process_info(pid)
+    if not ps:
+        logger.critical(_("  Process %s not found", pid))
         return
 
-    ps = get_process_info(pid)
     # This yumBackend isn't very friendly, so...
-    if ps is not None and ps['name'] == 'yumBackend.py':
+    if ps['name'] == 'yumBackend.py':
         nmsg = _("  The other application is: PackageKit")
     else:
         nmsg = _("  The other application is: %s") % ps['name']

Comment 8 James Antill 2010-08-17 17:18:41 UTC
Ok, patch from comment #7 (without the message) is now upstream.

Comment 9 Bug Zapper 2010-11-03 15:51:44 UTC
This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12.  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 WONTFIX if it remains open with a Fedora 
'version' of '12'.

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 prior to Fedora 12's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 12 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 please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

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.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 10 Bug Zapper 2010-12-03 15:12:37 UTC
Fedora 12 changed to end-of-life (EOL) status on 2010-12-02. Fedora 12 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.