Bug 1172548 - oo-last-access does not accept gear uuid when USE_PREDICTABLE_GEAR_UUIDS="true"
Summary: oo-last-access does not accept gear uuid when USE_PREDICTABLE_GEAR_UUIDS="true"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Containers
Version: 2.2.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: ---
Assignee: Luke Meyer
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-12-10 11:02 UTC by Gaoyun Pei
Modified: 2015-02-12 13:09 UTC (History)
4 users (show)

Fixed In Version: openshift-origin-node-util-1.34.0.1-1
Doc Type: Bug Fix
Doc Text:
Cause: oo-last-access created a table of known gears to assess by looking for entries in /var/lib/openshift that looked like gear UUIDs. Gears with UUIDs created with USE_PREDICTABLE_GEAR_UUIDS="true" were not being added to the table and therefore their log entries were not counted. Consequence: The idler would count these gears as idle despite recent activity and stop them. Fix: The logic for populating the table of gears was fixed to include all gears. Result: Web access should prevent gears from idling as intended.
Clone Of:
Environment:
Last Closed: 2015-02-12 13:09:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0220 0 normal SHIPPED_LIVE Red Hat OpenShift Enterprise 2.2.4 bug fix and enhancement update 2015-02-12 18:08:20 UTC

Description Gaoyun Pei 2014-12-10 11:02:00 UTC
Description of problem:
In /usr/sbin/oo-last-access `load_apps_data`, it only could recognize uuid with length of 24-32 and consist of [0-9a-f] 
...
 76       # If filename is a length 24-32 uuid, then it is an app
 77       if file_name =~ /^[0-9a-f]{24,32}$/
 78         read_app_data(file_name)
 79       end


Version-Release number of selected component (if applicable):
2.2/2014-12-09.1
openshift-origin-node-util-1.32.2.1-1.el6op.noarch

How reproducible:
always

Steps to Reproduce:
1.Enable USE_PREDICTABLE_GEAR_UUIDS in broker.conf, create an app on the node which is using mod-rewrite frontend. Visit the app, the access action could be record in /var/log/httpd/openshift_log

2.Run oo-last-access
[root@node1 ~]# oo-last-access 
ERROR : No gears were found in the log files. Check log file locations

Actual results:


Expected results:
The command should work well.

Additional info:

Comment 1 Gaoyun Pei 2014-12-10 11:14:58 UTC
The interesting thing is oo-last-access could work on a node which is using vhost.
Seems `add_alias_data` in /usr/sbin/oo-last-access helps to find correct gear uuid by chance.

Comment 2 Luke Meyer 2014-12-10 15:33:29 UTC
Checking whether the dir fits a regex strikes me as a bad way to determine whether it's a gear. Especially now that the gear UUID could be almost anything.

Comment 5 openshift-github-bot 2014-12-11 21:44:19 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/dd28b1706b9ce6affc89bb429935cc57b7a4cca3
oo-last-access: fix gear UUID detection

oo-last-access previously created a table of known gears by looking for
entries in /var/lib/openshift that looked like gear UUIDs. Now that
UUIDs can look different, some were not being added to the table. This
commit updates the logic to include all gears.

Bug 1172548 - oo-last-access does not accept gear uuid when
USE_PREDICTABLE_GEAR_UUIDS="true"
https://bugzilla.redhat.com/show_bug.cgi?id=1172548

Comment 8 Gaoyun Pei 2015-01-26 02:45:07 UTC
Verify the bug with openshift-origin-node-util-1.34.0.1-1

1. Make sure broker has enabled USE_PREDICTABLE_GEAR_UUIDS=TRUE in broker.conf.
   Create an app. Visit the app. The access log was recorded in /var/log/httpd/openshift_log on the node:
[root@node2 ~]# tailf /var/log/httpd/openshift_log

10.**.**.** app1-123.ose22-manual.com.cn - - [26/Jan/2015:10:33:07 +0800] "GET / HTTP/1.1" 200 39627 "-" "curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.16.2.3 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2" (3856us) - 127.3.223.1:8080/ 54c5a694e5fed513c6000009 123-app1-1

2. Run 'oo-last-access' on the node.
[root@node2 ~]# oo-last-access
[root@node2 .last_access]# cat 123-app1-1 
26/Jan/2015:10:33:07 +0800

This is working fine on both vhost and mod-rewrite frontend.

Comment 10 errata-xmlrpc 2015-02-12 13:09:47 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/RHBA-2015-0220.html


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