Description of problem: Found this bug from errata tps rpm update testing, see log: http://nest.test.redhat.com/mnt/qa/scratch/dell-pe2850-04/2013:14345/tps/tps-rpmtest.html#UpgradeTest-1-1-0 <--snip--> Output from RPM Command: sed: can't read /var/www/openshift/broker/httpd/conf.d/openshift-origin-auth-remote-user.conf: No such file or directory warning: %post(rubygem-openshift-origin-auth-remote-user-1.0.4-2.el6op.noarch) scriptlet failed, exit status 2 <--snip--> After installed rubygem-openshift-origin-auth-remote-user, /var/www/openshift/broker/httpd/conf.d/openshift-origin-auth-remote-user.conf does NOT exist, at this time, update this package will get the above warning. Check https://github.com/openshift/enterprise-server/blob/enterprise-1.1/plugins/auth/remote-user/rubygem-openshift-origin-auth-remote-user.spec#L82, I think it would be better if change it to: sed -i -e 's/AuthName.*/AuthName "OpenShift Broker API"/' /var/www/openshift/broker/httpd/conf.d/openshift-origin-auth-remote-user* Version-Release number of selected component (if applicable): rubygem-openshift-origin-auth-remote-user-1.0.4-2.el6op.noarch How reproducible: Always Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
It only tries to do that if you're upgrading the package. You would only be doing that if you had previously installed OpenShift. A previous install of OpenShift and this package wouldn't be very useful if you haven't configured authentication, meaning creating that file. I don't think there's much risk anyone will see this error. Perhaps for the future the condition could also check that the file exists.
So there's a harmless error message if the plugin is installed but not enabled (i.e., there is .conf.example but not .conf for this particular plugin), right? I don't think it would be unusual at all to have all the auth plugins installed with only one of them enabled. We should probably follow Luke's last suggestion and simply check that the file exists before executing the sed command.
(In reply to comment #3) > So there's a harmless error message if the plugin is installed but not > enabled (i.e., there is .conf.example but not .conf for this particular > plugin), right? Yes, you are right.
Sorry, I thought I had posted this earlier. Here's a pull request with the suggested fix: https://github.com/openshift/enterprise-server/pull/28
Version: http://buildvm-devops.usersys.redhat.com/puddle/build/OpenShiftEnterprise/1.1.x/2013-01-29.1/ Verify: [root@broker ~]# ll /var/www/openshift/broker/httpd/conf.d/openshift-origin-auth-remote-user.conf ls: cannot access /var/www/openshift/broker/httpd/conf.d/openshift-origin-auth-remote-user.conf: No such file or directory [root@broker ~]# yum update rubygem-openshift-origin-auth-remote-user Loaded plugins: product-id, rhnplugin, security, subscription-manager Updating certificate-based repositories. Unable to read consumer identity This machine has not been registered and therefore has no access to security and other critical updates. Please register using subscription-manager. This system is not registered with RHN. RHN Satellite or RHN Classic support will be disabled. openshift_client | 1.2 kB 00:00 openshift_client/primary | 4.4 kB 00:00 openshift_client 17/17 openshift_infrastructure | 1.2 kB 00:00 openshift_infrastructure/primary | 74 kB 00:00 openshift_infrastructure 325/325 rhel63 | 3.7 kB 00:00 rhel63/primary_db | 18 MB 02:05 Setting up Update Process Resolving Dependencies --> Running transaction check ---> Package rubygem-openshift-origin-auth-remote-user.noarch 0:1.0.3-1.el6op will be updated ---> Package rubygem-openshift-origin-auth-remote-user.noarch 0:1.0.5-1.el6op will be an update --> Finished Dependency Resolution Dependencies Resolved =============================================================================================================================================================================================================== Package Arch Version Repository Size =============================================================================================================================================================================================================== Updating: rubygem-openshift-origin-auth-remote-user noarch 1.0.5-1.el6op openshift_infrastructure 208 k Transaction Summary =============================================================================================================================================================================================================== Upgrade 1 Package(s) Total download size: 208 k Is this ok [y/N]: y Is this ok [y/N]: y Downloading Packages: rubygem-openshift-origin-auth-remote-user-1.0.5-1.el6op.noarch.rpm | 208 kB 00:01 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Updating : rubygem-openshift-origin-auth-remote-user-1.0.5-1.el6op.noarch 1/2 Cleanup : rubygem-openshift-origin-auth-remote-user-1.0.3-1.el6op.noarch 2/2 rhel63/productid | 1.7 kB 00:00 Installed products updated. Verifying : rubygem-openshift-origin-auth-remote-user-1.0.5-1.el6op.noarch 1/2 Verifying : rubygem-openshift-origin-auth-remote-user-1.0.3-1.el6op.noarch 2/2 Updated: rubygem-openshift-origin-auth-remote-user.noarch 0:1.0.5-1.el6op Complete! [root@broker ~]# rpm -q --script rubygem-openshift-origin-auth-remote-user-1.0.5-1.el6op.noarch --script: unknown option [root@broker ~]# rpm -q --scripts rubygem-openshift-origin-auth-remote-user-1.0.5-1.el6op.noarch postinstall scriptlet (using /bin/sh): if [ $1 -ne 1 ] # this is an update; fix the previously configured realm. then # We ship the .conf.example file, not the .conf file. The latter will # only be there if the user has enabled the plugin, so we must check # for its presence. if [ -f /var/www/openshift/broker/httpd/conf.d/openshift-origin-auth-remote-user.conf ] then sed -i -e 's/AuthName.*/AuthName "OpenShift Broker API"/' /var/www/openshift/broker/httpd/conf.d/openshift-origin-auth-remote-user.conf fi fi
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2013-0582.html