Bug 2229 - Problem using pkg, SUNWj6dev dependency issue
: Problem using pkg, SUNWj6dev dependency issue
Status: RESOLVED FIXINSOURCE
Product: pkg
cli
: unspecified
: ANY/Generic All
: P2 critical (vote)
: ---
Assigned To: Danek Duvall
: pkg/cli watcher
:
:
:
:
:
  Show dependency treegraph
 
Reported: 2008-06-12 20:08 UTC by David J. Orman
Modified: 2008-06-18 11:38 UTC (History)
4 users (show)

See Also:


Attachments


Note

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


Description David J. Orman 2008-06-12 20:08:53 UTC
-bash-3.2# pkg install netbeans
Creating Plan -Traceback (most recent call last):
  File "/usr/bin/pkg", line 1440, in ?
    ret = main_func()
  File "/usr/bin/pkg", line 1406, in main_func
    return install(img, pargs)
  File "/usr/bin/pkg", line 445, in install
    verbose = verbose, noexecute = noexecute)
  File "/usr/lib/python2.4/vendor-packages/pkg/client/image.py", line 1282, in
make_install_plan
    ip.evaluate()
  File "/usr/lib/python2.4/vendor-packages/pkg/client/imageplan.py", line 358,
in evaluate
    self.add_pkg_plan(f)
  File "/usr/lib/python2.4/vendor-packages/pkg/client/imageplan.py", line 273,
in add_pkg_plan
    m = self.image.get_manifest(pfmri)
  File "/usr/lib/python2.4/vendor-packages/pkg/client/image.py", line 516, in
get_manifest
    m = self._fetch_manifest(fmri)
  File "/usr/lib/python2.4/vendor-packages/pkg/client/image.py", line 468, in
_fetch_manifest
    mcontent = retrieve.get_manifest(self, fmri)
  File "/usr/lib/python2.4/vendor-packages/pkg/client/retrieve.py", line 75, in
get_manifest
    raise NameError, "could not retrieve manifest '%s' from '%s'" % \
NameError: could not retrieve manifest 'SUNWj6dev@0.5.11%2C5.11-0.90' from
'http://pkg.opensolaris.org:80'

-bash-3.2#

I see this on various packages, always complaining about SUNWj6dev. Any ideas?

Manually installing SUNWj6dev resolves the problem.

-bash-3.2# pkg install SUNWj6dev
DOWNLOAD                                    PKGS       FILES     XFER (MB)
Completed                                    1/1       56/56   48.18/48.18

PHASE                                        ACTIONS
Install Phase                                  86/86
-bash-3.2# pkg install netbeans
DOWNLOAD                                    PKGS       FILES     XFER (MB)
Completed                                  17/17   5371/5371 291.97/291.97

PHASE                                        ACTIONS
Install Phase                              6319/6319
-bash-3.2#

Cheers,
David
Comment 1 David Comay 2008-06-13 01:32:58 UTC
The error provided often indicates a network timeout issue.  Did you try this
with the environment variable PKG_CLIENT_TIMEOUT set to something larger than
the default (30) such as 90 or 120?
Comment 2 David J. Orman 2008-06-13 01:54:33 UTC
Yes, I did. Additionally, it was *always* this particular package
(SUNWjava6dev) mentioned in the unable to retrieve manifest error, even when
attempting to install other packages that (apparently) depended on it.

Once I installed it manually, everything else installed as expected.
Unfortunately, I do not remember what other packages I attempted to install
that raised the same error, other than netbeans.

That said, it could just be all coincidence that it was always this package,
perhaps a temporary hiccup as well. You'd know better than I.

Cheers,
David
Comment 3 Danek Duvall 2008-06-13 05:41:25 UTC
It looks like the immediate cause of the problem is that the manifest being
requested isn't fully specified -- note that exception is complaining about
'SUNWj6dev@0.5.11%2C5.11-0.90', which is missing a timestamp.

I'm not sure how we're getting to that point, though, though we definitely do
see this in the logs every once in a while.
Comment 4 Danek Duvall 2008-06-13 06:38:57 UTC
Hmm.  Another thing to note is that pkg is (halfheartedly) attempting to
download the build 90 version of SUNWj6dev.  But the latest published copy of
netbeans on p.o.o. is dependent explicitly on the build 86 version.

Could you provide:

  - pkg version
  - pkg list -a SUNWj6dev
  - pkg list -a netbeans

also, if you have any idea how to reproduce this problem, please let us know. 
If you can reproduce with "install -n netbeans" (I'm pretty sure you can, but I
want to be certain), that'd be good to know, too.  In fact, please give us the
output of "pkg install -nv netbeans" from a failure run, too.
Comment 5 David J. Orman 2008-06-13 06:50:17 UTC
To reproduce the problem, install OSOL 2008.5, image-update to snv_90, then
attempt pkg install netbeans. This is what did it for me, twice.

That said, I can't provide much useful information now that I've already
manually installed SUNWj6dev. Even pkg uninstall netbeans/SUNWj6dev didn't
allow me to re-create the problems, because it doesn't seem to be fetching
manifests/etc anymore:

-bash-3.2# pkg install netbeans
PHASE                                        ACTIONS
Install Phase                                  17/17 
-bash-3.2# 

(As a side note, why can I install already installed packages? Even if I don't
uninstall them first...)

That said, here is the information you requested:

-bash-3.2# pkg version
6abb536bc839
-bash-3.2# pkg list -a SUNWj6dev
NAME (AUTHORITY)                              VERSION         STATE      UFIX
SUNWj6dev                                     0.5.11-0.90     installed  ----
SUNWj6dev                                     0.5.11-0.89     known      u---
SUNWj6dev                                     0.5.11-0.86     known      u---
SUNWj6dev                                     0.5.11-0.86     known      u---
SUNWj6dev                                     0.5.11-0.79     known      u---
SUNWj6dev                                     0.5.11-0.75     known      u---
-bash-3.2# pkg list -a netbeans
NAME (AUTHORITY)                              VERSION         STATE      UFIX
netbeans                                      6.0.1-0.86      installed  ----
netbeans                                      6.0.1-0.86      known      u---
netbeans                                      6.0.1-0.86      known      u---
netbeans                                      6.0.1-0.86      known      u---
-bash-3.2#
Comment 6 Danek Duvall 2008-06-13 06:51:14 UTC
Okay, I can reproduce it, though I just got the error with SUNWj6rt.

Steps to reproduce:

    pkg image-create -F -a http://pkg.opensolaris.org/ /tmp/bug2229
    pkg -R /tmp/bug2229 install entire@0.5.11-0.90
    pkg install -nv netbeans

I think this relies on the fact that the netbeans dependency tree has all
versions specified at build 86, while entire fixes the minimum to be build 90. 
That *should* work, but something obviously is busted.
Comment 7 Danek Duvall 2008-06-13 07:27:20 UTC
In ImagePlan.propose_fmri(), we make a call to
Image.apply_optional_dependencies(), which replaces the existing fmri with the
one specified in the entire package.  In this case, that takes the fully
specified build 86 version to build 90 version that's only partially specified,
because that's the way it's specified in the entire incorporation.  That
partial version spec never gets fully expanded, and so when it tries to
download the manifest, the URL is incomplete, and the server doesn't know what
to do with it.

A quick fix is to put

    myfmri = self.get_matching_fmris(myfmri, matcher =
pkg.fmri.exact_name_match)[0]

in update_optional_dependency() right after the if/else block.  At this point,
I think we need Bart's input, since this is all his code.
Comment 8 Bart Smaalders 2008-06-13 11:41:44 UTC
(In reply to comment #7)
> In ImagePlan.propose_fmri(), we make a call to
> Image.apply_optional_dependencies(), which replaces the existing fmri with the
> one specified in the entire package.  In this case, that takes the fully
> specified build 86 version to build 90 version that's only partially specified,
> because that's the way it's specified in the entire incorporation.  That
> partial version spec never gets fully expanded, and so when it tries to
> download the manifest, the URL is incomplete, and the server doesn't know what
> to do with it.
> 
> A quick fix is to put
> 
>     myfmri = self.get_matching_fmris(myfmri, matcher =
> pkg.fmri.exact_name_match)[0]
> 
> in update_optional_dependency() right after the if/else block.  At this point,
> I think we need Bart's input, since this is all his code.

Interesting...

I'm hesitant to make the optional dependencies fully qualified, since that
specifies more exactly than was actually declared in the original dependency...
It should work, so long as the stored dependency is the _first_ one that
matches
the original spec... which means constraint = version.CONSTRAINT_AUTO should be
added as well....
Comment 9 David J. Orman 2008-06-13 17:31:11 UTC
-bash-3.2# pkg version
6abb536bc839
-bash-3.2# pkg list -a glassfishv2
NAME (AUTHORITY)                              VERSION         STATE      UFIX
glassfishv2                                   0.5.11-0.86     known      ----
glassfishv2                                   0.5.11-0.86     known      u---
-bash-3.2# pkg list -a SUNWj6dmo
NAME (AUTHORITY)                              VERSION         STATE      UFIX
SUNWj6dmo                                     0.5.11-0.90     known      ----
SUNWj6dmo                                     0.5.11-0.89     known      u---
SUNWj6dmo                                     0.5.11-0.86     known      u---
SUNWj6dmo                                     0.5.11-0.86     known      u---
SUNWj6dmo                                     0.5.11-0.79     known      u---
SUNWj6dmo                                     0.5.11-0.75     known      u---
-bash-3.2# pkg install -nv glassfishv2
Before evaluation:                    
UNEVALUATED:
+pkg:/glassfishv2@0.5.11,5.11-0.86:20080428T163323Z

Creating Plan \Traceback (most recent call last):
  File "/usr/bin/pkg", line 1440, in ?
    ret = main_func()
  File "/usr/bin/pkg", line 1406, in main_func
    return install(img, pargs)
  File "/usr/bin/pkg", line 445, in install
    verbose = verbose, noexecute = noexecute)
  File "/usr/lib/python2.4/vendor-packages/pkg/client/image.py", line 1282, in
make_install_plan
    ip.evaluate()
  File "/usr/lib/python2.4/vendor-packages/pkg/client/imageplan.py", line 358,
in evaluate
    self.add_pkg_plan(f)
  File "/usr/lib/python2.4/vendor-packages/pkg/client/imageplan.py", line 273,
in add_pkg_plan
    m = self.image.get_manifest(pfmri)
  File "/usr/lib/python2.4/vendor-packages/pkg/client/image.py", line 516, in
get_manifest
    m = self._fetch_manifest(fmri)
  File "/usr/lib/python2.4/vendor-packages/pkg/client/image.py", line 468, in
_fetch_manifest
    mcontent = retrieve.get_manifest(self, fmri)
  File "/usr/lib/python2.4/vendor-packages/pkg/client/retrieve.py", line 75, in
get_manifest
    raise NameError, "could not retrieve manifest '%s' from '%s'" % \
NameError: could not retrieve manifest 'SUNWj6dmo@0.5.11%2C5.11-0.90' from
'http://pkg.opensolaris.org:80'

-bash-3.2#

It looks like you all have a good handle on the situation, so I'll abstain from
updating with more failures of the same type.

Cheers, and thanks for all your hard work.

David
Comment 10 David Comay 2008-06-16 15:34:27 UTC
*** Bug 2251 has been marked as a duplicate of this bug. ***
Comment 11 Danek Duvall 2008-06-18 11:38:22 UTC
Fixed in changeset 6ffef60e8fbbaeb9f780c68369371d09cd0d40b2.
Comment 12 Danek Duvall 2008-06-18 23:30:10 UTC
*** Bug 2252 has been marked as a duplicate of this bug. ***