Bug 999460

Summary: Met 'RangeError' to execute oo-accept-node while deleting one record from /etc/passwd
Product: OpenShift Online Reporter: zhaozhanqi <zzhao>
Component: ContainersAssignee: Rob Millner <rmillner>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: mfisher, rmillner, xtian
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-29 12:54:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description zhaozhanqi 2013-08-21 11:08:21 UTC
Description of problem:
there are one app existing in instance. ssh into instance and delete this app user record from file '/etc/passwd'. And then run 'oo-accept-node -v'

INFO: checking 20 user accounts
INFO: checking application dirs
/usr/sbin/oo-accept-node:140:in `getpwuid': bignum too big to convert into `unsigned long' (RangeError)
	from /usr/sbin/oo-accept-node:140:in `user_fail'
	from /usr/sbin/oo-accept-node:711:in `block in check_app_dirs'
	from /usr/sbin/oo-accept-node:692:in `foreach'
	from /usr/sbin/oo-accept-node:692:in `check_app_dirs'
	from /usr/sbin/oo-accept-node:838:in `<main>'


Version-Release number of selected component (if applicable):
devenv_3680

How reproducible:
always

Steps to Reproduce:
1. create one app for example uuid =992119267718510338375680
2. delete this app record from /etc/passwd
3. run 'oo-accept-node -v'

Actual results:
[root@ip-10-196-218-191 openshift]# 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
FAIL: Process 15727 is owned by a gear that's no longer on the system, uid: 5455
FAIL: Process 15753 is owned by a gear that's no longer on the system, uid: 5455
FAIL: Process 18491 is owned by a gear that's no longer on the system, uid: 5455
FAIL: Process 18715 is owned by a gear that's no longer on the system, uid: 5455
INFO: checking presence of tc qdisc
INFO: checking for cgroup filter
INFO: checking presence of tc classes
INFO: checking filesystem quotas
INFO: checking quota db file selinux label
INFO: checking 20 user accounts
INFO: checking application dirs
/usr/sbin/oo-accept-node:140:in `getpwuid': bignum too big to convert into `unsigned long' (RangeError)
	from /usr/sbin/oo-accept-node:140:in `user_fail'
	from /usr/sbin/oo-accept-node:711:in `block in check_app_dirs'
	from /usr/sbin/oo-accept-node:692:in `foreach'
	from /usr/sbin/oo-accept-node:692:in `check_app_dirs'
	from /usr/sbin/oo-accept-node:838:in `<main>'


Expected results:

No this error

Additional info:

Comment 1 Rob Millner 2013-08-21 18:34:12 UTC
Pull request:
https://github.com/openshift/origin-server/pull/3454

Comment 2 openshift-github-bot 2013-08-21 19:53:33 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/d7eb986cb3deb0b91dfc8a6cca06d161a56ccd44
Bug 999460 - Trap range error on large, all numeric UUIDs for the test to see if the UUID is really a UID.

Comment 3 zhaozhanqi 2013-08-22 03:12:40 UTC
Tested this issue on devenv_stage_448, it has been fixed

1) delete user record 479428171624072284733440 from /etc/passwd

2) oo-accept-node 

[root@ip-10-40-25-14 openshift]# 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: checking presence of tc qdisc
INFO: checking for cgroup filter
INFO: checking presence of tc classes
INFO: checking filesystem quotas
INFO: checking quota db file selinux label
INFO: checking 0 user accounts
INFO: checking application dirs
FAIL: directory 479428171624072284733440 doesn't have an associated user
INFO: checking system httpd configs
FAIL: httpd config references UUID without associated gear: '479428171624072284733440'
INFO: checking cartridge repository
2 ERRORS
[root@ip-10-40-25-14 openshift]# which oo-accept-node
/usr/sbin/oo-accept-node