Bug 1107801 - rhcsh quota check prints error messages on login if quotas are disabled
Summary: rhcsh quota check prints error messages on login if quotas are disabled
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Containers
Version: 2.1.0
Hardware: Unspecified
OS: Unspecified
high
low
Target Milestone: ---
: ---
Assignee: Miheer Salunke
QA Contact: libra bugs
URL:
Whiteboard:
Depends On: 1092722
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-10 16:26 UTC by Miheer Salunke
Modified: 2014-06-18 20:00 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1092722
Environment:
Last Closed: 2014-06-18 20:00:24 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2014:0764 0 normal SHIPPED_LIVE Critical: rubygem-openshift-origin-node security update 2014-06-18 23:59:48 UTC

Description Miheer Salunke 2014-06-10 16:26:12 UTC
+++ This bug was initially created as a clone of Bug #1092722 +++

Description of problem:

If an application developer connects to a gear using ssh, and quotas are disabled on the node that hosts that gear, then rhcsh prints out a bunch of error messages.


How reproducible:

Readily.


Steps to Reproduce:

1. Install an OpenShift PaaS.

2. Create an application on the PaaS installed in Step 1.

3. Disable quotas on the node that is hosting the application created in Step 2.

4. Log into the application created in Step 2 using the `rhc ssh` command.


Actual results:

At Step 4, I see the following error messages:

    awk: END { exit ( !(  > 90.0)); }
    awk:                  ^ syntax error
    awk: END { exit ( !(  > 90.0)); }
    awk:                         ^ syntax error
    awk: END { exit ( !(  > 90.0)); }
    awk:                          ^ syntax error
    awk: END { exit ( !(  > 90.0)); }
    awk:                  ^ syntax error
    awk: END { exit ( !(  > 90.0)); }
    awk:                         ^ syntax error
    awk: END { exit ( !(  > 90.0)); }
    awk:                          ^ syntax error


Expected results:

There should be no such error messages.


Additional info:

With quotas on, things work properly:

    % rhc ssh testapp1
    Connecting to 5348284f719cd27614000005.example.com ...
    
        *********************************************************************
    
        You are accessing a service that is for use only by authorized users.
        If you do not have authorization, discontinue use at once.
        Any use of the services is subject to the applicable terms of the
        agreement which can be found at:
        https://www.openshift.com/legal
    
        *********************************************************************
    
        Welcome to OpenShift shell
    
        This shell will assist you in managing OpenShift applications.
    
        !!! IMPORTANT !!! IMPORTANT !!! IMPORTANT !!!
        Shell access is quite powerful and it is possible for you to
        accidentally damage your application.  Proceed with care!
        If worse comes to worst, destroy your application with "rhc app delete"
        and recreate it
        !!! IMPORTANT !!! IMPORTANT !!! IMPORTANT !!!
    
        Type "help" for more info.
    
    
    [testapp1-ose.ose21-20140408.example.com 5348284f719cd27614000005]\> quota
    Disk quotas for user 5348284f719cd27614000005 (uid 2920):
         Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
    /dev/mapper/VolGroup-lv_root
                      51660       0 1048576             364       0   80000
    [testapp1-ose.ose21-20140408.example.com 5348284f719cd27614000005]\> exit
    Connection to testapp1-ose.ose21-20140408.example.com closed.

Now turn off quotas:

    % quotaoff /
    % rhc ssh testapp1
    Connecting to 5348284f719cd27614000005.example.com ...
    
        *********************************************************************
    
        You are accessing a service that is for use only by authorized users.
        If you do not have authorization, discontinue use at once.
        Any use of the services is subject to the applicable terms of the
        agreement which can be found at:
        https://www.openshift.com/legal
    
        *********************************************************************
    
        Welcome to OpenShift shell
    
        This shell will assist you in managing OpenShift applications.
    
        !!! IMPORTANT !!! IMPORTANT !!! IMPORTANT !!!
        Shell access is quite powerful and it is possible for you to
        accidentally damage your application.  Proceed with care!
        If worse comes to worst, destroy your application with "rhc app delete"
        and recreate it
        !!! IMPORTANT !!! IMPORTANT !!! IMPORTANT !!!
    
        Type "help" for more info.
    
    
    awk: END { exit ( !(  > 90.0)); }
    awk:                  ^ syntax error
    awk: END { exit ( !(  > 90.0)); }
    awk:                         ^ syntax error
    awk: END { exit ( !(  > 90.0)); }
    awk:                          ^ syntax error
    awk: END { exit ( !(  > 90.0)); }
    awk:                  ^ syntax error
    awk: END { exit ( !(  > 90.0)); }
    awk:                         ^ syntax error
    awk: END { exit ( !(  > 90.0)); }
    awk:                          ^ syntax error
    [testapp1-ose.ose21-20140408.example.com 5348284f719cd27614000005]\> quota
    [testapp1-ose.ose21-20140408.example.com 5348284f719cd27614000005]\> echo $?
    0
    [testapp1-ose.ose21-20140408.example.com 5348284f719cd27614000005]\> quota -w
    [testapp1-ose.ose21-20140408.example.com 5348284f719cd27614000005]\> echo $?
    0
    [testapp1-ose.ose21-20140408.example.com 5348284f719cd27614000005]\> exit
    Connection to testapp1-ose.ose21-20140408.example.com closed.
    %

PR: https://github.com/openshift/origin-server/issues/5354

--- Additional comment from openshift-github-bot on 2014-05-02 13:56:16 EDT ---

Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/8d56a34477ef40aebca00538396dbd1ea1e22bf1
rhcsh: Fix quota check if quotas disabled

When testing whether the gear's quota usage is close to its quota limit,
substitute 0 for the empty string in case there was an error reading the
current usage.

This changes fixes a problem that shows up, for example,  if quotas are
disabled:

    > quota
    Disk quotas for user [uuid] (uid [uid]): none

Previously, in this situation, the following error message would appear
when the application developer tried to log into the gear using ssh:

    awk: END { exit ( !(  > 90.0)); }
    awk:                  ^ syntax error
    awk: END { exit ( !(  > 90.0)); }
    awk:                         ^ syntax error
    awk: END { exit ( !(  > 90.0)); }
    awk:                          ^ syntax error
    awk: END { exit ( !(  > 90.0)); }
    awk:                  ^ syntax error
    awk: END { exit ( !(  > 90.0)); }
    awk:                         ^ syntax error
    awk: END { exit ( !(  > 90.0)); }
    awk:                          ^ syntax error

This commit fixes bug 1092722.

--- Additional comment from Yan Du on 2014-05-19 01:50:53 EDT ---

Test on devenv 4797, issue have been fixed.

steps:
1. Create an app
2. Disable quotas on the node
#quotaoff /

[root@ip-10-187-33-12 ~]# /sbin/quotaoff -p -u /
user quota on / (/dev/xvda1) is off

3. rhc ssh app
root@openshift-ubuntu:/home# rhc ssh p54
Connecting to 5379d115fe6a165fc4000002.rhcloud.com ...

    *********************************************************************

    You are accessing a service that is for use only by authorized users.
    If you do not have authorization, discontinue use at once.
    Any use of the services is subject to the applicable terms of the
    agreement which can be found at:
    https://www.openshift.com/legal

    *********************************************************************

    Welcome to OpenShift shell

    This shell will assist you in managing OpenShift applications.

    !!! IMPORTANT !!! IMPORTANT !!! IMPORTANT !!!
    Shell access is quite powerful and it is possible for you to
    accidentally damage your application.  Proceed with care!
    If worse comes to worst, destroy your application with "rhc app delete"
    and recreate it
    !!! IMPORTANT !!! IMPORTANT !!! IMPORTANT !!!

    Type "help" for more info.


[p54-111.dev.rhcloud.com 5379d115fe6a165fc4000002]\>

4. run oo-accept-node -v
[root@ip-10-187-33-12 ~]# oo-accept-node -v
INFO: loading node configuration file /etc/openshift/node.conf
INFO: loading resource limit file /etc/openshift/resource_limits.conf
INFO: finding external network device
INFO: checking node public hostname resolution
INFO: checking selinux status
INFO: checking selinux openshift-hosted policy
INFO: checking selinux booleans
INFO: checking selinux nodes
INFO: checking package list
INFO: checking services
INFO: checking kernel semaphores >= 512
INFO: checking cgroups configuration
INFO: checking cgroups processes
INFO: find district uuid: NONE
INFO: determining node uid range: 1000 to 6999
INFO: checking presence of tc qdisc
INFO: checking for cgroup filter
INFO: checking presence of tc classes
INFO: checking filesystem quotas
FAIL: quotas are not enabled on / (/dev/xvda1)
INFO: checking quota db file selinux label
INFO: checking 1 user accounts
INFO: checking application dirs
INFO: checking system httpd configs
INFO: checking cartridge repository
1 ERRORS

Comment 2 RHEL Program Management 2014-06-11 19:28:42 UTC
Quality Engineering Management has reviewed and declined this request.
You may appeal this decision by reopening this request.

Comment 3 Brenton Leanhardt 2014-06-11 19:32:00 UTC
Comment #2 is in error.  This bug was accidentally declined by QE.  We'll have that fixed in a minute.

Comment 5 Yanping Zhang 2014-06-12 06:55:43 UTC
I'v confirm the patch is not merged, and the bug still could be reproduced on 2.1.z/2014-06-11.1, just re-assign back.

Additional info:
# rhc ssh php2
 Type "help" for more info.


awk: END { exit ( !(  > 90.0)); }
awk:                  ^ syntax error
awk: END { exit ( !(  > 90.0)); }
awk:                         ^ syntax error
awk: END { exit ( !(  > 90.0)); }
awk:                          ^ syntax error
awk: END { exit ( !(  > 90.0)); }
awk:                  ^ syntax error
awk: END { exit ( !(  > 90.0)); }
awk:                         ^ syntax error
awk: END { exit ( !(  > 90.0)); }
awk:                          ^ syntax error

Comment 6 Brenton Leanhardt 2014-06-12 14:10:20 UTC
My apologies, looking now the latest Node package was not in yesterday's build.  I'm fixing that now.

Comment 8 Yanping Zhang 2014-06-13 01:42:22 UTC
Verified on 2.1.z/2014-06-12.2
 
Steps to verify:

1. Create an app
# rhc app create apptest php-5.4
2. Disable quotas on the node
#quotaoff /
3. rhc ssh app
# rhc ssh apptest
4.Chenk node
# oo-accept-node -v
5.Enable quotas on the node,ssh app and check node.
#quotaon /
# rhc ssh apptest
# oo-accept-node -v

Actual results:
All display normally:
3.# rhc ssh apptest
Connecting to 539a5323db26c8b7e9000009.com.cn ...

    *********************************************************************

    You are accessing a service that is for use only by authorized users.  
    If you do not have authorization, discontinue use at once. 
    Any use of the services is subject to the applicable terms of the 
    agreement which can be found at: 
    https://www.openshift.com/legal

    *********************************************************************

    Welcome to OpenShift shell

    This shell will assist you in managing OpenShift applications.

    !!! IMPORTANT !!! IMPORTANT !!! IMPORTANT !!!
    Shell access is quite powerful and it is possible for you to
    accidentally damage your application.  Proceed with care!
    If worse comes to worst, destroy your application with "rhc app delete"
    and recreate it
    !!! IMPORTANT !!! IMPORTANT !!! IMPORTANT !!!

    Type "help" for more info.


[apptest-dom13.ose21z-manual.com.cn 539a5323db26c8b7e9000009]\> quota
[apptest-dom13.ose21z-manual.com.cn 539a5323db26c8b7e9000009]\> echo $?
0

4.# oo-accept-node -v
INFO: using default accept-node extensions
INFO: loading node configuration file /etc/openshift/node.conf
INFO: loading resource limit file /etc/openshift/resource_limits.conf
INFO: finding external network device
INFO: checking node public hostname resolution
INFO: checking selinux status
INFO: checking selinux openshift-origin policy
INFO: checking selinux booleans
INFO: checking package list
INFO: checking services
INFO: checking kernel semaphores >= 512
INFO: checking cgroups configuration
INFO: checking cgroups processes
INFO: find district uuid: 539a51cadb26c814e3000001
INFO: determining node uid range: 1000 to 6999
INFO: traffic control not enabled in /etc/openshift/node.conf, set TRAFFIC_CONTROL_ENABLED=true to enable
INFO: checking filesystem quotas
FAIL: quotas are not enabled on / (/dev/mapper/VolGroup-lv_root)
INFO: checking quota db file selinux label
INFO: checking 1 user accounts
INFO: checking application dirs
INFO: checking system httpd configs
INFO: checking cartridge repository
1 ERRORS

5.Ssh app well,and check no error:
# oo-accept-node -v
INFO: using default accept-node extensions
INFO: loading node configuration file /etc/openshift/node.conf
INFO: loading resource limit file /etc/openshift/resource_limits.conf
INFO: finding external network device
INFO: checking node public hostname resolution
INFO: checking selinux status
INFO: checking selinux openshift-origin policy
INFO: checking selinux booleans
INFO: checking package list
INFO: checking services
INFO: checking kernel semaphores >= 512
INFO: checking cgroups configuration
INFO: checking cgroups processes
INFO: find district uuid: 539a51cadb26c814e3000001
INFO: determining node uid range: 1000 to 6999
INFO: traffic control not enabled in /etc/openshift/node.conf, set TRAFFIC_CONTROL_ENABLED=true to enable
INFO: checking filesystem quotas
INFO: checking quota db file selinux label
INFO: checking 1 user accounts
INFO: checking application dirs
INFO: checking system httpd configs
INFO: checking cartridge repository
PASS

Comment 11 errata-xmlrpc 2014-06-18 20:00:24 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-2014-0764.html


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