Bug 1121224 - oo-accept-node inconsistently checks for the non-existence of /sbin/ip
Summary: oo-accept-node inconsistently checks for the non-existence of /sbin/ip
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 2.x
Assignee: Jhon Honce
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks: 1121222
TreeView+ depends on / blocked
 
Reported: 2014-07-18 16:53 UTC by Miciah Dashiel Butler Masters
Modified: 2015-11-23 21:28 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1121222
Environment:
Last Closed: 2015-11-23 21:28:50 UTC
Target Upstream Version:


Attachments (Terms of Use)

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


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