Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1225943 - oo-init-quota function get_filesystem_type pulls in commented lines in fstab if same mount point
oo-init-quota function get_filesystem_type pulls in commented lines in fstab ...
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Containers (Show other bugs)
2.2.0
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Timothy Williams
libra bugs
: NeedsTestCase
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-05-28 10:01 EDT by Ryan Howe
Modified: 2015-09-30 12:37 EDT (History)
7 users (show)

See Also:
Fixed In Version: openshift-origin-node-util-1.37.2.1-1.el6op
Doc Type: Bug Fix
Doc Text:
The `grep` method in which entries are pulled from the /etc/fstab file in the `oo-init-quota` command previously did not ignore commented lines. This could result in an error where the quota failed to initialize due to duplicate entries when a commented entry included the same file system mount as an un-commented entry. This bug fix updates the `grep` commands used in `oo-init-quota` to now ignore lines beginning with a '#' symbol. As a result, `oo-init-quota` now successfully initializes quotas on systems where a commented entry for the same file system where OpenShift gears will be stored exists.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-09-30 12:37:40 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:1844 normal SHIPPED_LIVE Important: Red Hat OpenShift Enterprise 2.2.7 security, bug fix and enhancement update 2015-09-30 16:35:28 EDT

  None (edit)
Description Ryan Howe 2015-05-28 10:01:28 EDT
Description of problem:

-Bug with the oo-init-quota with node module.
While installing, it fails at the 'Initialize quota DB' stage if there is more than one pattern containing of the same file system mount point in /etc/fstab, one being commented.

This is due to the script : 
https://github.com/openshift/origin-server/blob/master/node-util/sbin/oo-init-quota#L52

# find the filesystem type above a given file or directory
function get_filesystem_type() {
    egrep "\s+$1\s+" /etc/fstab | awk '{ print $3 }'
}


It should exclude commented-out lines in /etc/fstab

Later on, the script evaluate the result of print $3, and compare it to 'ext4'

https://github.com/openshift/origin-server/blob/master/node-util/sbin/oo-init-quota#L104


Version-Release number of selected component (if applicable):v2.2


How reproducible:
Have more than one pattern containing /var/lib/openshift in /etc/fstab and go through puppet install on node module. 

Steps to Reproduce:
1.Copy line line in fstab and comment it out 
2.Use oo-init-quota /mount/point
3.If you have multiple entries it will fail because it includes the commented out line

Actual results:
Error:
oo-init-quota only supports ext4 filesystems. You will need to setup user quotas for the 'ext4 ext4' filesystem.

Expected results:
No Error

Additional info:
Comment 2 Timothy Williams 2015-06-01 09:59:47 EDT
https://github.com/openshift/origin-server/pull/6155
Comment 3 openshift-github-bot 2015-06-09 15:48:35 EDT
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/807b9c94115f89a36da485a04963c3afd0432253
oo-init-quota: Ignore commented lines in /etc/fstab

Bug 1225943
Bugzilla Link https://bugzilla.redhat.com/show_bug.cgi?id=1225943
Comment 7 Anping Li 2015-08-20 04:45:58 EDT
QA can reproduce this issue. Now waiting new puddle to verify it.
Comment 10 Johnny Liu 2015-09-22 02:47:55 EDT
Verified this bug with 2.2/2015-09-21.1, PASS.


Reproduce this bug with old version - openshift-origin-node-util-1.35.1.1-1.el6op.noarch:
# /usr/sbin/oo-init-quota
oo-init-quota only supports ext4 filesystems. You will need to setup user quotas for the 'ext4
ext4' filesystem.


Fix in new version - openshift-origin-node-util-1.37.2.1-1.el6op.noarch:
# /usr/sbin/oo-init-quota
/dev/mapper/vg_dhcp128178-lv_root / ext4 defaults,usrquota,usrjquota=aquota.user,jqfmt=vfsv0 1 1
mount: / not mounted already, or bad option
chmod: changing permissions of `/aquota.user': Operation not permitted
quotaon: using //aquota.user on /dev/mapper/vg_dhcp128178-lv_root [/]: Device or resource busy
Comment 12 errata-xmlrpc 2015-09-30 12:37:40 EDT
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.

https://rhn.redhat.com/errata/RHSA-2015-1844.html

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