Bug 894 - pkgsend should do more action verification
: pkgsend should do more action verification
Status: RESOLVED FIXINSOURCE
Product: pkg
pkgsend
: unspecified
: i86pc/amd64 OpenSolaris
: P4 minor (vote)
: ---
Assigned To: Shawn Walker
: pkg/pkgsend watcher
:
: needstestcase
:
:
:
  Show dependency treegraph
 
Reported: 2008-03-28 15:29 UTC by erik.lafever
Modified: 2009-02-13 12:07 UTC (History)
1 user (show)

See Also:


Attachments


Note

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


Description erik.lafever 2008-03-28 15:29:13 UTC
ewbox# pkgsend open test35@1
export PKG_TRANS_ID=1206743509_pkg%3A%2Ftest35%401%2C5.11%3A20080328T153149Z
ewbox# export
PKG_TRANS_ID=1206743509_pkg%3A%2Ftest35%401%2C5.11%3A20080328T153149Z
ewbox# pkgsend add dir mode=0555
ewbox# pkgsend close
Failed with 500
ewbox# echo $?
0
ewbox# 



server traceback during this transaction:

127.0.0.1 - - [28/Mar/2008 15:32:11] Internal failure:
Traceback (most recent call last):
  File "/usr/lib/pkg.depotd", line 409, in do_GET
    exec op_call
  File "<string>", line 1, in ?
  File "/usr/lib/pkg.depotd", line 305, in close_0
    t.close(request)
  File "modules/server/transaction.py", line 151, in close
  File "modules/server/transaction.py", line 290, in accept_publish
  File "modules/server/transaction.py", line 320, in publish_package
  File "/usr/lib/python2.4/vendor-packages/pkg/catalog.py", line 471, in
update_searchdb
    self.__update_searchdb_unlocked(fmri_list)
  File "/usr/lib/python2.4/vendor-packages/pkg/catalog.py", line 452, in
__update_searchdb_unlocked
    self.update_index(f, mfst.search_dict())
  File "modules/manifest.py", line 259, in search_dict
  File "/usr/lib/python2.4/vendor-packages/pkg/actions/directory.py", line 151,
in generate_indices
    return {
KeyError: 'path'

127.0.0.1 - - [28/Mar/2008 15:32:11] "GET
/close/0/1206743509_pkg%3A%2Ftest35%401%2C5.11%3A20080328T153149Z HTTP/1.1" 500
-
Comment 1 Danek Duvall 2008-08-25 14:38:42 UTC
*** Bug 2354 has been marked as a duplicate of this bug. ***
Comment 2 Dan Price 2008-08-28 17:25:53 UTC
Bulk move of pkgsend bugs to new category.
Comment 3 Shawn Walker 2009-02-03 22:33:39 UTC
*** Bug 1238 has been marked as a duplicate of this bug. ***
Comment 4 Shawn Walker 2009-02-03 22:34:52 UTC
Not enough error checking is done during action creation (in fromlist and
fromstr notably).
Comment 5 Shawn Walker 2009-02-03 22:35:59 UTC
pkgsend also needs to handled any errors related to action creation gracefully.
Comment 6 Shawn Walker 2009-02-06 14:57:34 UTC
The case given in comment 0 will now fail this way:

pkgsend add dir mode=0555
pkgsend: invalid action, 'dir mode=0555': required attribute, 'path', was not
provided.

In general, since the actions are now always built by pkgsend before being
sent, this should allow the action class to perform all of the verification. 
The only thing the client (pkgsend) needs to do is to catch the appropriate
exceptions and display any relevant messages.
Comment 7 Shawn Walker 2009-02-13 12:07:54 UTC
Fixed in changeset 873 / b95d76c53b5eeece7335982e3ccf7047770decc4.