Bug 223229
Summary: | [PATCH] rhn_check reports success if %pre scriptlet fail with exit 1 | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 4 | Reporter: | Jose Plans <jplans> | ||||||
Component: | up2date | Assignee: | Pradeep Kilambi <pkilambi> | ||||||
Status: | CLOSED ERRATA | QA Contact: | Brandon Perkins <bperkins> | ||||||
Severity: | high | Docs Contact: | |||||||
Priority: | high | ||||||||
Version: | 4.4 | CC: | cperry, nobody+pnasrat, tao | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | RHBA-2007-0250 | Doc Type: | Bug Fix | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2007-05-01 23:19:48 UTC | Type: | --- | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Bug Depends On: | |||||||||
Bug Blocks: | 240201 | ||||||||
Attachments: |
|
Description
Jose Plans
2007-01-18 15:57:24 UTC
Created attachment 145924 [details]
up2date-4.4.69-scriplet_exception.patch
Steps to reproduce : 1. Create a software customised channel. 2. Push this package in that channel. 3. Subscribe a host to that channel. 4. Perform a schedule install of that package to that host. 5. From the client host, run : rhn_check. Actual results: -- [root@dhcp-0-238 ~]# rpm -ivh apache-2.0.55-VIS27.i386.rpm Preparing... ########################################### [100%] User wwwrun is missing. Please create this user prior to installing this package. error: %pre(apache-2.0.55-VIS27.i386) scriptlet failed, exit status 1 error: install: %pre scriptlet failed (2), skipping apache-2.0.55-VIS27 -- Success from the scheduler host status. No host had any failure. Expected results: D: Running transaction (final step)... D: Sending back response (18, 'Failed: packages requested raised dependency or transaction problems', {}) D: do_call packages.checkNeedUpdate ('rhnsd=1',) D: local action status: (0, 'rpm database not modified since last update (or package list recently updated)', {}) We might need to add a print before the raise so the customer can see an error or message. And on the failed hosts: "Failed: packages requested raised dependency or transaction problems". Jose Created attachment 146160 [details]
up2date-4.4.69-scriplet_exception-error-msg.patch
Prints error message on error instead of silently report the error and give a
prompt.
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux maintenance release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux Update release for currently deployed products. This request is not yet committed for inclusion in an Update release. There is a patch available, but there is development work needed on the RHN side to complete this bug, thus it will not be ready for QA until it is development complete. this should be fixed now, applied patch and tested. committed to revision 110084 in svn. yes, thats what i would expect it to raise. We are raising the exception in the up2date actions code and not in rpm itself and the exception we return is: + except up2dateErrors.RpmError, e: + return (18, "Failed: packages requested raised "\ + "dependency or transaction problems", {}) which is an error code 18. most part of the patch proposed was already existing code that was commented out for some unkonwn reason, we uncommented that so we actually catch the exception rather than ignore it and end up as a success as it was doing previously. There is nothing much to add to the patch except catch the exception. Thats my take on it. The only decision we were trying to make initially was whether to throw the exception at the rpm level itself or wait untill it enters the actions code and as per Paul this cannot happen untill the next major release if we want to do it in rpm, so we decided to do it at the actions level. As far as the print statement I feel "packages requested raised dependency or transaction problems", is appropriate(in this case a transaction problem) as this path is also follwed while doing the dep solving and the error code needs to be as stated. I think i dont understand the concern here. isnt the patch working for you? yep I see what you mean, I did consider that, as i explained earlier, we need to throw same exception in multiple scenerios, so I felt what we had was appripriate as it covered any dependency case and any transaction scenerio(which is fits our case or any other transaction issue). oh my apologies Jose, i totally missed your new patch. Did not realize that. Thanks for clearing that up cliff. I will include that immediately and update you all. added the logging to replace the print --- rpmUtils.py (revision 110190) +++ rpmUtils.py (working copy) @@ -31,7 +31,7 @@ from rhpl.translate import _, N_ - +from up2date_client import up2dateLog # mainly here to make conflicts resolution cleaner def findDepLocal(ts, dep): @@ -519,5 +519,8 @@ raise up2dateErrors.TransactionError(_( "Failed running transaction of packages: %s") % errors, deps=rc) elif type(rc) == type([]) and not len(rc): + # let the user know whats wrong + log = up2dateLog.initLog() + log.log_me("Failed running rpm transaction - %pre %pro failure ?.") raise up2dateErrors.RpmError(_("Failed running rpm transaction")) fyi, the above will log the messages to /var/log/up2date or what ever the config is pointing to. yea I included this bug into the errata already, will update it with latest package and changelog information *** Bug 221961 has been marked as a duplicate of this bug. *** (In reply to comment #33) > An interesting finding on this issue. up2date-4.4.5-1.i386.rpm does not > care about obsoletes list as mentioned earlier in this ticket. So , if I > use above version of up2date and issue the command up2date apache , it just > goes ahead and installs the package. However , up2date package that is > attached to this ticket fails with error as apache package get's added to > obsoletes list due to httpd being in the base channel. So it looks like > up2date got this additonal capability somewhere between version 4.4.5-1 and > the current patched version attached to this ticket. > > Regards , > Shashin. > > Internal Status set to 'Waiting on SEG' > Status set to: Waiting on Tech > > This event sent from IssueTracker by jplans > issue 107834 > - Could you paste the exact error message its failing with? - Also did you try commenting out the patch in this bug and try the same ? marking verified. this seems to have been fixed with up2date-gnome-4.5.5-1.el4 up2date-4.5.5-1.el4 Has this bug been fixed in RHEL 3? Is so then which release of up2date contains the fix? (In reply to comment #42) > Has this bug been fixed in RHEL 3? Is so then which release of up2date contains > the fix? the fix for rhel-3 will be released as a part of rhel-3.9. This is currently "on_qa". An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2007-0250.html |