Bug 1121224

Summary: oo-accept-node inconsistently checks for the non-existence of /sbin/ip
Product: OKD Reporter: Miciah Dashiel Butler Masters <mmasters>
Component: ContainersAssignee: Jhon Honce <jhonce>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: dmcphers, jokerman, libra-bugs, libra-onpremise-devel, mmccomas, pruan
Target Milestone: ---   
Target Release: 2.x   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1121222 Environment:
Last Closed: 2015-11-23 21:28:50 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:
Bug Depends On:    
Bug Blocks: 1121222    

Description Miciah Dashiel Butler Masters 2014-07-18 16:53:08 UTC
+++ This bug was initially created as a clone of Bug #1121222 +++

Description of problem:

oo-accept-node inconsistently checks for the non-existence of /sbin/ip in the tests that use it: 
find_ext_net_dev rescues if there is a Errno::ENOENT exception whereas check_node_public_resolution fails ungracefully with an unrescued exception.


How reproducible:

Completely.


Steps to Reproduce:

1. Install an OpenShift Enterprise PaaS with 1 node.

2. Move /sbin/ip to /sbin/ip on the node from Step 1.

3. Run oo-accept-node -v on the node.


Actual results:

At Step 3, oo-accept-node rescues gracefully in the find_ext_net_dev test but subsequently fails ungracefully with an unrescued exception in the check_node_public_resolution test:

    # 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
    FAIL: SEVERE: could not find ip command (/sbin/ip).
    INFO: checking node public hostname resolution
    /usr/sbin/oo-accept-node:318:in ``': No such file or directory - /sbin/ip addr show scope global (Errno::ENOENT)
            from /usr/sbin/oo-accept-node:318:in `check_node_public_resolution'
            from /usr/sbin/oo-accept-node:914:in `<main>'
    #


Expected results:

At Step 3, oo-accept-node should always gracefully handle Errno::ENOENT errors:

    # 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
    FAIL: SEVERE: could not find ip command (/sbin/ip).
    INFO: checking node public hostname resolution
    FAIL: SEVERE: could not find ip command (/sbin/ip).
    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: 538646d0eaa253c5da000001
    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 5 user accounts
    INFO: checking application dirs
    INFO: checking system httpd configs
    INFO: checking cartridge repository
    2 ERRORS
    #

Comment 1 Miciah Dashiel Butler Masters 2014-07-18 16:56:30 UTC
PR: https://github.com/openshift/origin-server/pull/5624

Comment 2 openshift-github-bot 2014-07-22 18:18:05 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/d25e6a61c587186ab743ee75e24f88bed3da7fa8
oo-accept-node: Handle non-existence of /sbin/ip

Modify check_node_public_resolution to rescue from Errno::ENOENT when
running /sbin/ip in case the command does not exist.  This change makes
check_node_public_resolution consistent with the find_ext_net_dev test.

This commit fixes bug 1121224.

Comment 3 Peter Ruan 2015-09-23 16:55:54 UTC
[root@broker sbin]# 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
FAIL: SEVERE: could not find ip command (/sbin/ip).
INFO: checking that external network device has a globally scoped IPv4 address
FAIL: SEVERE: could not find ip command (/sbin/ip).
INFO: checking node public hostname resolution
FAIL: SEVERE: could not find ip command (/sbin/ip).
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: 5602021582611d7053000001
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
INFO: checking quota db file selinux label
INFO: checking 0 user accounts
INFO: checking application dirs
INFO: checking system httpd configs
INFO: checking cartridge repository
3 ERRORS