Bug 2325 - optional dependency enforcement can't handle fmris disappearing from the catalog
: optional dependency enforcement can't handle fmris disappearing from the catalog
Status: RESOLVED FIXINSOURCE
Product: pkg
cli
: unspecified
: ANY/Generic All
: P4 minor (vote)
: 2008.11
Assigned To: Bart Smaalders
: pkg/cli watcher
:
:
:
:
: 4329
  Show dependency treegraph
 
Reported: 2008-06-25 01:28 UTC by Qinghua Cheng
Modified: 2008-11-02 18:08 UTC (History)
3 users (show)

See Also:


Attachments


Note

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


Description Qinghua Cheng 2008-06-25 01:28:11 UTC
Steps:

1. Fresh installed OpenSolaris 2008.05 
2. pkg image-update to Snv_91 build
3. Reboot the system to snv_91
4. Switch the repository to a test repository 
5. pkg install or image update fail with following msg:

Traceback (most recent call last):
File "/usr/bin/pkg", line 1458, in ?
ret = main_func()
File "/usr/bin/pkg", line 1424, in main_func
return install(img, pargs)
File "/usr/bin/pkg", line 448, in install
filters = filters, verbose = verbose, noexecute = noexecute)
File "/usr/lib/python2.4/vendor-packages/pkg/client/image.py", line 1280, in
make_install_plan
self.load_optional_dependencies()
File "/usr/lib/python2.4/vendor-packages/pkg/client/image.py", line 1021, in
load_optional_dependencies
self.update_optional_dependency(min_fmri)
File "/usr/lib/python2.4/vendor-packages/pkg/client/image.py", line 989, in
update_optional_dependency
matcher = pkg.fmri.exact_name_match)[0]
File "/usr/lib/python2.4/vendor-packages/pkg/client/image.py", line 403, in
get_matching_fmris
raise KeyError, "packages matching '%s' not found in catalog or image" \
KeyError: "packages matching 'pkg:/SUNWlang-sk@0.5.11,5.11-0.91' not found in
catalog or image"

Workaround:

Edit the manifest file
/var/pkg/pkg/entire/0.5.11%2C5.11-0.91%3A20080616T184243Z/manifest, delete all
lines contain "depend ...", pkg image-update works.
Comment 1 Danek Duvall 2008-06-25 07:16:41 UTC
Another multi-authority problem; not sure if it's a dup of an existing bug.
Comment 2 johansen 2008-06-27 14:19:43 UTC
I'm starting to see a number of bugs that look like these.  Is there a reason
why this shouldn't be closed as a dup of bug 2253?
Comment 3 Danek Duvall 2008-07-15 22:22:33 UTC
I've verified the problem, and that my fix to bug 2253 fixes it, so I'm closing
this as a dup.

*** This bug has been marked as a duplicate of bug 2253 ***
Comment 4 Qinghua Cheng 2008-09-03 03:30:15 UTC
(In reply to comment #3)
> I've verified the problem, and that my fix to bug 2253 fixes it, so I'm closing
> this as a dup.
> 
> *** This bug has been marked as a duplicate of bug 2253 ***

I still can see the error msgs on snv_96.

Fresh installed snv_96, change the repo. to http://ipsbj.prc:8000/, then do pkg
refresh --full and pkg image-update.
Comment 5 Qinghua Cheng 2008-09-03 19:44:09 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > I've verified the problem, and that my fix to bug 2253 fixes it, so I'm closing
> > this as a dup.
> > 
> > *** This bug has been marked as a duplicate of bug 2253 ***
> 
> I still can see the error msgs on snv_96.
> 
> Fresh installed snv_96, change the repo. to http://ipsbj.prc:8000/, then do pkg
> refresh --full and pkg image-update.

Reopen for more evaluation.
Comment 6 Danek Duvall 2008-09-03 20:20:39 UTC
Your repo doesn't have most of the packages that are already installed on your
system, and the optional dependency code doesn't handle the fact that the
dependency is no longer in the catalog (or installed on the system).  The fact
that your repo wasn't complete wasn't at all obvious.

What you should be doing instead is *adding* the new authority, and making it
preferred.  Or just making sure that all the packages in the old authority (or
at least those referenced by entire) are included in your private repo.

That said, we should be more robust here.
Comment 7 Danek Duvall 2008-10-05 01:31:34 UTC
Connie, with newer builds (buuild 96 is new enough), do you see the same
problem that Chris is seeing in build 3704, or are you still seeing the stack
trace with KeyError in it like in comment 0?
Comment 8 Qinghua Cheng 2008-10-13 01:13:33 UTC
Danek, on OpenSolaris svn_99b, I change the repo to an internal one, which has
only a few packages, run pkg install, I got error msg:
pkg: install failed (inventory exception): Not found in inventory:
pkg:/SUNW1394h@0.5.11,5.11-0.99

Install failed.
Comment 9 Shawn Walker 2008-10-29 16:03:31 UTC
*** Bug 4324 has been marked as a duplicate of this bug. ***
Comment 10 Bart Smaalders 2008-11-02 18:08:12 UTC
In 655:6eef82185057