Bug 984288

Summary: [abrt] fedup-0.7.3-4.fc18: util.py:48:rm_f:NameError: global name 'log' is not defined
Product: [Fedora] Fedora Reporter: alberto <alberto.fusari>
Component: fedupAssignee: Will Woods <wwoods>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: dmitry, sergio, tflink, wwoods
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Unspecified   
Whiteboard: abrt_hash:6f8ba3b1361d200e7dc3cae1de1950cf68a753f7
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-04 01:02:11 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: core_backtrace
none
File: environ none

Description alberto 2013-07-14 13:55:00 UTC
Version-Release number of selected component:
fedup-0.7.3-4.fc18

Additional info:
reporter:       libreport-2.1.5
cmdline:        /usr/bin/python /usr/bin/fedup --clean
executable:     /usr/bin/fedup
kernel:         3.9.5-301.fc19.i686
runlevel:       N 5
uid:            0

Truncated backtrace:
util.py:48:rm_f:NameError: global name 'log' is not defined

Traceback (most recent call last):
  File "/usr/bin/fedup", line 181, in <module>
    main(args)
  File "/usr/bin/fedup", line 82, in main
    do_cleanup(args)
  File "/usr/lib/python2.7/site-packages/fedup/commandline.py", line 185, in do_cleanup
    misc_cleanup()
  File "/usr/lib/python2.7/site-packages/fedup/sysprep.py", line 202, in misc_cleanup
    rm_rf(d)
  File "/usr/lib/python2.7/site-packages/fedup/util.py", line 51, in rm_rf
    rm_f(d, rm=rmtree)
  File "/usr/lib/python2.7/site-packages/fedup/util.py", line 48, in rm_f
    log.warn("failed to remove %s: %s", f, str(e))
NameError: global name 'log' is not defined

Local variables in innermost frame:
rm: <function rmtree at 0xa0b0bc4>
e: OSError(16, 'Device or resource busy')
f: '/system-upgrade-root'

Comment 1 alberto 2013-07-14 13:55:10 UTC
Created attachment 773321 [details]
File: backtrace

Comment 2 alberto 2013-07-14 13:55:18 UTC
Created attachment 773322 [details]
File: core_backtrace

Comment 3 alberto 2013-07-14 13:55:25 UTC
Created attachment 773323 [details]
File: environ

Comment 4 Sergio Basto 2013-07-23 04:24:11 UTC
Description of problem:
fedup --clean
after upgrade to F19

Version-Release number of selected component:
fedup-0.7.3-4.fc19

Additional info:
reporter:       libreport-2.1.5
cmdline:        /usr/bin/python /bin/fedup --clean
executable:     /bin/fedup
kernel:         3.9.9-302.fc19.x86_64
runlevel:       N 5
uid:            0

Truncated backtrace:
util.py:48:rm_f:NameError: global name 'log' is not defined

Traceback (most recent call last):
  File "/bin/fedup", line 181, in <module>
    main(args)
  File "/bin/fedup", line 82, in main
    do_cleanup(args)
  File "/usr/lib/python2.7/site-packages/fedup/commandline.py", line 183, in do_cleanup
    remove_cache()
  File "/usr/lib/python2.7/site-packages/fedup/sysprep.py", line 195, in remove_cache
    rm_rf(d)
  File "/usr/lib/python2.7/site-packages/fedup/util.py", line 51, in rm_rf
    rm_f(d, rm=rmtree)
  File "/usr/lib/python2.7/site-packages/fedup/util.py", line 48, in rm_f
    log.warn("failed to remove %s: %s", f, str(e))
NameError: global name 'log' is not defined

Local variables in innermost frame:
rm: <function rmtree at 0x101e500>
e: OSError('Cannot call rmtree on a symbolic link',)
f: '/var/tmp/fedora-upgrade'

Comment 5 Dmitry S. Makovey 2013-08-13 19:47:03 UTC
same issue here: F18 -> F19 via fedup ends up with:

[     1.051] (II) fedup.sysprep:misc_cleanup() removing symlink /system-upgrade
[     1.051] (II) fedup:<module>() Exception:
Traceback (most recent call last):
  File "/usr/bin/fedup-cli", line 181, in <module>
    main(args)
  File "/usr/bin/fedup-cli", line 82, in main
    do_cleanup(args)
  File "/usr/lib/python2.7/site-packages/fedup/commandline.py", line 185, in do_cleanup
    misc_cleanup()
  File "/usr/lib/python2.7/site-packages/fedup/sysprep.py", line 199, in misc_cleanup
    rm_f(upgradelink)
  File "/usr/lib/python2.7/site-packages/fedup/util.py", line 48, in rm_f
    log.warn("failed to remove %s: %s", f, str(e))
NameError: global name 'log' is not defined
[     1.053] (II) fedup:<module>() /usr/bin/fedup-cli exiting at Tue Aug 13 13:28:46 2013

# rpm -q fedup             
fedup-0.7.3-4.fc18.noarch

Comment 6 Dmitry S. Makovey 2013-08-13 21:03:16 UTC
fixing fedup (/usr/lib/python2.7/site-packages/fedup/util.py) a bit with :
...
import logging
log = logging.getLogger(__package__+".util")
...

I got more meaningful errors:

# grep -F '(WW)' /var/log/fedup.log
[     0.930] (WW) fedup.util:rm_f() failed to remove /system-upgrade: [Errno 30] Read-only file system: '/system-upgrade'
[     0.930] (WW) fedup.util:rm_f() failed to remove /system-upgrade-root: [Errno 30] Read-only file system: '/system-upgrade-root'


system is running with LVM over Crypt-LUKS: /dev/sda1 - /boot /dev/sda2 - LUKS/PV 

it may have been related to bug #968540 except my system was fresh-installed F18 and all the rd.luks.uuid and rd.lvm.lv are present for the fedup image. Mine complains about Read-only filesystem.

Comment 7 Sergio Basto 2013-10-04 01:02:11 UTC

*** This bug has been marked as a duplicate of bug 966841 ***