Bug 902412 - Warning message is seen when update rubygem-openshift-origin-auth-remote-user package.
Summary: Warning message is seen when update rubygem-openshift-origin-auth-remote-user...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node
Version: 1.1.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Luke Meyer
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-01-21 15:49 UTC by Johnny Liu
Modified: 2017-03-08 17:34 UTC (History)
5 users (show)

Fixed In Version: rubygem-openshift-origin-auth-remote-user-1.0.5-1.el6op
Doc Type: Bug Fix
Doc Text:
Without authentication configured, and the openshift-origin-auth-remote-user.conf file not created, updating the rubygem-openshift-origin-auth-remote-user package caused the following error message: "sed: can't read /var/www/openshift/broker/httpd/conf.d/openshift-origin-auth-remote-user.conf: No such file or directory This fix checks to see whether the openshift-origin-auth-remote-user.conf file exists before attempting to update the rubygem-openshift-origin-auth-remote-user package. This package now updates correctly.
Clone Of:
Environment:
Last Closed: 2013-02-28 19:09:10 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0582 0 normal SHIPPED_LIVE Moderate: Red Hat OpenShift Enterprise 1.1.1 update 2013-03-01 00:05:18 UTC

Description Johnny Liu 2013-01-21 15:49:38 UTC
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:

Comment 2 Luke Meyer 2013-01-21 22:34:42 UTC
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.

Comment 3 Miciah Dashiel Butler Masters 2013-01-21 23:29:39 UTC
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.

Comment 4 Johnny Liu 2013-01-22 10:20:13 UTC
(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.

Comment 5 Miciah Dashiel Butler Masters 2013-01-22 16:41:55 UTC
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

Comment 8 xjia 2013-01-31 06:38:52 UTC
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

Comment 10 errata-xmlrpc 2013-02-28 19:09:10 UTC
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


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