Bug 539407 - Backtrace on "Error writing partition table"
Summary: Backtrace on "Error writing partition table"
Keywords:
Status: CLOSED DUPLICATE of bug 525900
Alias: None
Product: Fedora
Classification: Fedora
Component: appliance-tools
Version: 12
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: David Huff
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-11-20 02:26 UTC by Fabrice Colin
Modified: 2009-12-11 21:10 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-12-11 21:10:53 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Fabrice Colin 2009-11-20 02:26:26 UTC
Description of problem:
Right after upgrading from Fedora 11 to 12, I tried rebuilding an appliance using a KS file that worked fine with Fedora 11's appliance-tools.
For some reason, the partition table can't be written. That's not the problem I am reporting here however. The problem is that this partition table error generates the following message and backtrace (note I am yet to reboot this system, as recommended) :

"
Warning: The kernel was unable to re-read the partition table on /dev/loop1 (Invalid argument).  This means Linux won't know anything about the modifications you made until you reboot.  You should reboot your computer before doing anything with /dev/loop1.
Traceback (most recent call last):
  File "/usr/bin/appliance-creator", line 164, in <module>
    sys.exit(main())
  File "/usr/bin/appliance-creator", line 148, in main
    creator.mount("NONE", options.cachedir)
  File "/usr/lib/python2.6/site-packages/imgcreate/creator.py", line 515, in mount
    self._mount_instroot(base_on)
  File "/usr/lib/python2.6/site-packages/appcreate/appliance.py", line 159, in _mount_instroot
    self.__instloop.mount()
  File "/usr/lib/python2.6/site-packages/appcreate/partitionedfs.py", line 221, in mount
    self.__format_disks()
  File "/usr/lib/python2.6/site-packages/appcreate/partitionedfs.py", line 65, in __format_disks
    raise MountError("Error writing partition table on %s" % d.device)
AttributeError: 'dict' object has no attribute 'device'
"

Version-Release number of selected component (if applicable):
004.4-3.fc12

How reproducible:
Always when run on this particular KS file. I haven't tried to figure out what if anything is wrong with it just yet.

Steps to Reproduce:
1. appliance-creator -n my-os --config my-os.ks --cache /root/appliance-cache
  
Actual results:
See above message and backtrace.

Expected results:
This error message :

"
Warning: The kernel was unable to re-read the partition table on /dev/loop1 (Invalid argument).  This means Linux won't know anything about the modifications you made until you reboot.  You should reboot your computer before doing anything with /dev/loop1.
/usr/lib/python2.6/site-packages/imgcreate/errors.py:40: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  return str(self.message)
Unable to create appliance : Failed mount disks : Error writing partition table on /dev/loop1
"

Additional info:
I fixed this issue by changing line 65 of "/usr/lib/python2.6/site-packages/appcreate/partitionedfs.py" to :
raise MountError("Error writing partition table on %s" % d['disk'].device)

Comment 1 Fabrice Colin 2009-12-09 14:24:58 UTC
This bug and the underlying cause were reported on moblin-dev. See this post :
http://groups.google.com/group/moblin-dev/msg/1d9f17ba3a5c0dc1?pli=1

The root cause seems to be because "parted always fails to reload the partition table with loop devices". The poster provides a patch (patch #1) that disables checking parted's return code. It also includes the same change to line 65 that I mentioned.
After applying this patch, appliance-creator works for me, just like it did in Fedora 11.

Comment 2 David Huff 2009-12-11 21:10:53 UTC
The above workaround is a good workaround but not a real fix for this issue.  We reported a bug on parted and the next build of parted should have a real fix.

https://bugzilla.redhat.com/show_bug.cgi?id=546622

I'll push a fix for the syntax error in Line 65 as well as a couple other fixes and try to do a new build sometime next week.

also this is a dup of 525900 closing a dup.

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


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