Bug 1101973 - oo-diagnostics tools is checking a non-existing dir after update ose-2.0 GA to ose-2.0.z puddle + RHSCL-1.1
Summary: oo-diagnostics tools is checking a non-existing dir after update ose-2.0 GA t...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node
Version: 2.0.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Miciah Dashiel Butler Masters
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-05-28 09:29 UTC by Johnny Liu
Modified: 2015-12-17 17:09 UTC (History)
7 users (show)

Fixed In Version: openshift-origin-broker-util-1.37.4.1-1.el6op
Doc Type: Bug Fix
Doc Text:
The `test_for_nonrpm_rubygems` test in the `oo-diagnostics` tool previously used shell globbing to search for gemspec files in several paths. However, shell globbing returns back the glob pattern (rather than an empty list) if the pattern does not match anything. The test failed to take this shell feature into account, instead interpreting a returned glob pattern as a file name. If one of the directories that the test searched was empty, the test would output spurious error messages such as "ls: cannot access /opt/rh/ruby193/root/usr/local/share/gems/specifications/*.gemspec: No such file or directory". This bug fix updates the `oo-diagnostics` tool to handle empty gemdirs. Specifically, the glob search in the `test_for_nonrpm_rubygems` was rewritten to perform the search using Ruby code rather than shell. Globbing in Ruby returns an empty list if the glob pattern does not match anything. As a result, the `oo-diagnostics` tool no longer prints spurious error messages for empty directories.
Clone Of:
Environment:
Last Closed: 2015-12-17 17:09:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:2666 0 normal SHIPPED_LIVE Important: Red Hat OpenShift Enterprise 2.2.8 security, bug fix, and enhancement update 2015-12-17 22:07:54 UTC

Description Johnny Liu 2014-05-28 09:29:16 UTC
Description of problem:
Set up ose-2.0 GA, run oo-diagnostics successfully, no error is seen.
Upgrade env to puddle-2-0-RHSCL11-2014-05-23, run oo-diagnostics again.
The following error is seen:
<--snip-->
INFO: looking in /opt/rh/ruby193/root/usr/local/share/gems/specifications/*.gemspec /opt/rh/ruby193/root/usr/share/gems/specifications/*.gemspec
ls: cannot access /opt/rh/ruby193/root/usr/local/share/gems/specifications/*.gemspec: No such file or directory
<--snip-->

# ls /opt/rh/ruby193/root/usr/local/share/gems/specifications/
# ls /opt/rh/ruby193/root/usr/local/share/gems/specifications/*.gemspec
ls: cannot access /opt/rh/ruby193/root/usr/local/share/gems/specifications/*.gemspec: No such file or directory


Version-Release number of selected component (if applicable):
puddle-2-0-RHSCL11-2014-05-23

How reproducible:
Always

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Luke Meyer 2014-05-28 20:28:00 UTC
We must have upgraded away all the gems that put specs in /opt/rh/ruby193/root/usr/local/share/gems/specifications/

That's fine, just change the test to skip the directories that aren't there. Probably the same thing can happen under 2.1.

Comment 2 Johnny Liu 2014-05-29 02:03:27 UTC
(In reply to Luke Meyer from comment #1)
> We must have upgraded away all the gems that put specs in
> /opt/rh/ruby193/root/usr/local/share/gems/specifications/
> 
> That's fine, just change the test to skip the directories that aren't there.
> Probably the same thing can happen under 2.1.

ose-2.1 broker has such issue, node does not.

Comment 4 openshift-github-bot 2015-10-10 01:09:49 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/8de407f41f77b22bf0b3cb5a005af5d6c539cf02
oo-diagnostics: Handle empty gemdirs

In test_for_nonrpm_rubygems, glob in Ruby rather than in shell in order
to avoid getting the glob itself back if it does not match anything.

This commit fixes bug 1101973.

Comment 8 Johnny Liu 2015-11-12 11:34:59 UTC
Because OSE-2.0 and RHSCL-1.1 was released for a long long time ago, it is hard for to prepare such a reproducible env.

So verified this bug with the following steps against 2.2/2015-11-11.1 puddle.

[root@broker ~]# mkdir /opt/rh/ruby193/root/usr/local/share/gems/specifications/
[root@broker ~]# ls /opt/rh/ruby193/root/usr/local/share/gems/specifications/
[root@broker ~]# ls /opt/rh/ruby193/root/usr/local/share/gems/specifications/*.gemspec
ls: cannot access /opt/rh/ruby193/root/usr/local/share/gems/specifications/*.gemspec: No such file or directory

# oo-diagnostics  -v
<--snip-->
INFO: checking for presence of gem-installed rubygems
looking in /opt/rh/ruby193/root/usr/local/share/gems/specifications/*.gemspec /opt/rh/ruby193/root/usr/share/gems/specifications/*.gemspec
INFO: running: test_for_multiple_gem_versions
<--snip-->


No error is seen now.

Comment 10 errata-xmlrpc 2015-12-17 17:09:03 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.

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


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