Bug 5294 - pkgsend doesn't provide server response when operations fail
: pkgsend doesn't provide server response when operations fail
Status: RESOLVED FIXINSOURCE
Product: pkg
pkgsend
: unspecified
: ANY/Generic All
: P3 normal (vote)
: 2009.06
Assigned To: Shawn Walker
: pkg/pkgsend watcher
:
:
:
:
:
  Show dependency treegraph
 
Reported: 2008-11-21 09:46 UTC by Dan Anderson
Modified: 2009-02-13 12:09 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 Dan Anderson 2008-11-21 09:46:59 UTC
I downloaded source (with hg) on 19 Nov. 2008 and compiled the the pkg
utilities on snv79b: SUNWipkg, SUNWipkg-gui-data, SUNWpython-cherrypy,
SUNWipkg-brand, SUNWipkg-gui-l10n, SUNWpython-pyopenssl, SUNWipkg-gui,
SUNWipkg-um.
Then I configured and started the package manager daemon, pkg.depotd (service
pkg/server), and added SVR4 packages with pkgsend.

This all worked fine except for packages with letters in the version string
(e.g., 3.10a).  pkgsend failed with a message "open failed (status 400)".

The error message should state the version number is invalid and the docs
should state that letters can't be in version strings.

Here's what happened:
$ eval `pkgsend open xv-png@3.10a-1`
$ pkgsend import 'xv-3.10a-png-i86pc-solaris5.8'
$ pkgsend close

pkg:/nslint@2.0.2,5.11-1:20081120T193039Z
+ pkgsend open xv-png@3.10a-1
pkgsend: open failed (status 400)
+ eval
+ pkgsend import xv-3.10a-png-i86pc-solaris5.8
pkgsend: import failed (status 404): Not Found
+ pkgsend close
Failed with 404

When I removed the "a" from "3.10a" and retried pkgsend and it worked OK.

I filed this as CR 6774394, but was told to file it here instead.
Comment 1 Stephen Hahn 2008-11-26 10:42:04 UTC
Missed 2008.11.  Set milestone to 2009.04.
Comment 2 Liane Praza 2008-11-26 10:45:16 UTC
It's easy to be even more invalid than Dan's example.  I tried the literal
command:

  $ pkgsend -s http://localhost:12000 open foo
  pkgsend: open failed (status 400)

and was perplexed by the resulting status 400.  A more useful error message
about invalid or missing versions would be most helpful.
Comment 3 Dan Anderson 2008-11-26 11:55:37 UTC
Here's another confusing pkgsend error message.  If the pkg.depotd server is
readonly, it gives error 404:

pkgsend open DRYDOGntp@4.2.4`
pkgsend: open failed (status 404)
*** Error code 1
make: Fatal error: Command failed for target `pkgsend'

This message could also be improved.
After making the server writable with 
svccfg -s application/pkg/server setprop pkg/readonly = false

the error goes away.  But the error message is still terrible.


Also pkgsend should allow letters in version strings--it's quite common.
Comment 4 Shawn Walker 2008-11-26 12:11:06 UTC
(In reply to comment #3)
> Also pkgsend should allow letters in version strings--it's quite common.

That isn't a restriction of pkgsend; that's a restriction of the design of
pkg(5).  You can really only do same version comparisons on numeric strings. 
If you allow alphabetic characters, then you start having to invent special
rules about how the comparisons work.

There are no plans to allow this.  The version of the package doesn't have to
match the version of the software, and probably shouldn't, since packages will
often be updated more often than the software they deliver.
Comment 5 Shawn Walker 2008-11-26 12:11:33 UTC
(In reply to comment #4)
> pkg(5).  You can really only do same version comparisons on numeric strings. 

Sigh.  That should have been "sane" not "same."
Comment 6 Shawn Walker 2009-02-04 00:13:02 UTC
pkgsend just needs to catch/retrieve any version errors and gracefully handle
them.
Comment 7 Shawn Walker 2009-02-06 16:21:51 UTC
Now displays this:

pkgsend -s http://localhost:12001 open foo@1.a
pkgsend: 'open' failed for transaction ID 'None'; status '404':
Illegal FMRI 'foo@1.a': Bad Version: 1.a
Comment 8 Shawn Walker 2009-02-06 22:51:51 UTC
*** Bug 3058 has been marked as a duplicate of this bug. ***
Comment 9 Shawn Walker 2009-02-13 12:09:16 UTC
Fixed in changeset 873 / b95d76c53b5eeece7335982e3ccf7047770decc4.