Bug 1542867

Summary: local-storage-provisioner log message for regular file is not clear
Product: OpenShift Container Platform Reporter: Qin Ping <piqin>
Component: StorageAssignee: Jan Safranek <jsafrane>
Status: CLOSED ERRATA QA Contact: Qin Ping <piqin>
Severity: low Docs Contact:
Priority: unspecified    
Version: 3.9.0CC: aos-bugs, aos-storage-staff, jsafrane
Target Milestone: ---   
Target Release: 3.9.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-17 06:42:42 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 Qin Ping 2018-02-07 08:42:57 UTC
Description of problem:
local-storage-provisioner checks mountDir and creates PVs for local volumes, when there is a regular file in mountDir, it will not create PV for it and report error.

Version-Release number of selected component (if applicable):
openshift v3.9.0-0.39.0
kubernetes v1.9.1+a0ce1bc657

How reproducible:
Always

Steps to Reproduce:
1. Create hostDir on one node, and create a regular file under hostDir
2. using image: registry.reg-aws.openshift.com:443/openshift3/local-storage-provisioner:v3.9.0-0.39.0 to create local storage provisoiner
3. No PV is created
4. check local storage provisioner pod log message.
   oc logs local-volume-provisioner-jxxpj

Actual results:
E0207 07:29:33.448320       1 discovery.go:106] Block device check for "/mnt/local-storage/fast/vol3" failed: DirErr - <nil> BlkErr - <nil>

Expected results:
vol3 is not a mountpoint or directory, does not create PV for it?

Comment 1 Jan Safranek 2018-02-07 16:58:18 UTC
This is trivial to fix, however I am not sure it can catch 3.9

Comment 2 Jan Safranek 2018-02-08 13:23:02 UTC
Upstream PR: https://github.com/kubernetes-incubator/external-storage/pull/595

Proposed log message: "Skipping file "/mnt/local-storage/fast/vol3": not a directory nor block device".

Comment 3 Jan Safranek 2018-02-12 12:33:51 UTC
Upstream PR is merged, now I am looking for a way how to release updated local-storage images.

Comment 4 Jan Safranek 2018-02-20 15:50:39 UTC
3.9 image built and pushed somewhere where 3.9 installed with Jenkins can find it. Checked with:

$ docker run -ti --entrypoint=/bin/sh registry.reg-aws.openshift.com:443/openshift3/local-storage-provisioner:v3.9

(inside the container) $ rpm -q openshift-external-storage-local-provisioner 
openshift-external-storage-local-provisioner-0.0.1-8.git78d6339.el7.x86_64

(inside the container) $ rpm -q --changelog openshift-external-storage-local-provisioner | head
* Fri Feb 16 2018 jsafrane <jsafrane> - 0.0.1-8.git78d6339
- Rebuilt for 3.9

* Mon Feb 12 2018 jsafrane <jsafrane> - 0.0.1-7.git78d6339
- Fix error message when a plain file is discovered
- Resolves: rhbz#1542867

Comment 6 Qin Ping 2018-04-17 07:02:38 UTC
Now the image local-storage-provisioner with tag v3.9 has fixed this issue.

# docker images
REPOSITORY                                                                  TAG                 IMAGE ID            CREATED             SIZE
registry.access.redhat.com/openshift3/local-storage-provisioner             v3.9                a5cfdbd5ba3f        3 weeks ago         234 MB

# oc exec local-volume-provisioner-rgs68 -- rpm -qa|grep local
openshift-external-storage-local-provisioner-0.0.1-8.git78d6339.el7.x86_64

Comment 8 Qin Ping 2018-04-20 03:07:28 UTC
Verified in OCP:
oc v3.9.24
openshift v3.9.24
kubernetes v1.9.1+a0ce1bc657

# oc exec local-volume-provisioner-qfg5b -- rpm -qa|grep local
openshift-external-storage-local-provisioner-0.0.1-8.git78d6339.el7.x86_64

# uname -a
Linux host-172-16-120-35 3.10.0-693.21.1.el7.x86_64 #1 SMP Fri Feb 23 18:54:16 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.4 (Maipo)

Report error as expected:
E0420 03:04:43.477544       1 discovery.go:106] Skipping file "/mnt/local-storage/ssd/testfile": not a directory nor block device

Comment 11 errata-xmlrpc 2018-05-17 06:42:42 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://access.redhat.com/errata/RHBA-2018:1566