Tom,

On Thu, Apr 30, 2009 at 12:58:39PM -0700, 
[email protected] wrote:
> http://defect.opensolaris.org/bz/show_bug.cgi?id=1164
> 
> 
> Tom Mueller <[email protected]> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |[email protected]
> 
> 
> 
> 
> --- Comment #7 from Tom Mueller <[email protected]>  2009-04-30 12:58:31 ---
> This comment is an FYI for people that might be searching for the cause of a
> traceback or pkg(5) meta data corruption.
> 
> The changes for this bug when combined with the changes from bug 5871
> introduced an incompatibility with earlier versions of pkg(5) that results in 
> a
> corrupted image. Consider the following case:
> 
> 1. Create an image with the new code and install a package. 
> 
> pkg image-create -U -a test=http://somerepo animage
> pkg -R animage install some-package
> 
> 2. Run the "pkg contents" command using the pkg(5) code from before these
> changes
> 
> old/pkg -R animage contents -t set -o pkg.name some-package
> 
> 3. Run the "pkg contents" command again, with any version
> 
> pkg -R animage contents -t set -o pkg.name some-package
> 
> This results in a traceback that ends with a ManformedActionError. The reason
> for the MalformedActionError is that the first line of the manifest file for
> the installed package, the line for the fmri, has an extra newline after the
> authority name. 
> 
> The sequence of actions that leads to the corruption is the following:
> 1. The old code calls Image.get_manifest on the install manifest.
> 2. get_manifest sees that the file is there and reads it in, but
> Image._valid_manifest returns False because it can't find the "authority"
> attribute (the new code from 5871 is writing a "publisher" attribute now). 
> 3. Since _valid_manifest returned False, get_manifest calls
> Image._fetch_manifest_with_retries which downloads the manifest again and 
> saves
> it to the file. 
> 4. When the manifest is saved, the authority for the fmri attribute that is
> added to the manifest is taken from the installed file, which now, because of
> this change, has a newline at the end. This results in the set action with
> name="fmri" being written as two lines rather than one. For example, it might
> look like this:
> 
> set name=fmri value=pkg://test
> /[email protected],0-26.1980:20090423T010858Z
> 
> Once the manifest is written in this way, neither the new code nor the old 
> code
> is able to parse it and a MalformedActionError is the result. 
> 
> A situation where this might show up is if a user image is created on an NFS
> file system, and both OpenSolaris 2008/11 (the old code) and OpenSolaris
> 2009/06 (the new code) is used to manage the image. 
> 
> P.S. I didn't create this as a separate bug because I don't think pkg(5) makes
> any claims at this point about compatibility between different versions of the
> code.

Please file a new bug for this.  Tracebacks are always bugs.  If a new
code change introduced the traceback, which would be true if the fix for
5871 tickles this probelm, then this is certainly not 1164.  Whoever
fixes the traceback can also address this issue.  Please make sure to
add a see-also to the the new bug that you file.

Thanks,

-j

_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to