Bug 1868771

Summary: Error message for whereabouts IPAM CNI is not descriptive when kubeconfig is specified and path is wrong
Product: OpenShift Container Platform Reporter: Douglas Smith <dosmith>
Component: NetworkingAssignee: Douglas Smith <dosmith>
Networking sub component: multus QA Contact: Weibin Liang <weliang>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium    
Version: 4.6   
Target Milestone: ---   
Target Release: 4.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1868772 (view as bug list) Environment:
Last Closed: 2020-10-27 16:28:34 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: 1868772    

Description Douglas Smith 2020-08-13 19:07:37 UTC
It was reported that a user specified the "kubeconfig" (which is not required in OpenShift) option for whereabouts, using upstream instructions, and the error message was not informative.

The error message as reported:


```
  Multus: [some-component/something-0]: error adding container to network "something-0": delegateAdd: error invoking confAdd - "macvlan": error in getting result from AddNetwork: Error assigning IP: Unauthorized
```

The phrasing "unauthorized" doesn't produce any actionable output for the user.


To verify this bug, create a net-attach-def for whereabouts, and add the "kubeconfig" parameter and specify any invalid filepath.

Comment 2 Douglas Smith 2020-09-11 15:27:36 UTC
I was looking at the wrong PR, this was actually merged in: https://github.com/openshift/whereabouts-cni/pull/24

To replicate the error, you can set a "kubernetes" parameter with an invalid path, such as:

```
"ipam": {
  "type": "whereabouts",
  "kubernetes": { "kubeconfig": "/invalid/path" }
  "range": "192.168.2.225/28"
}
````

To validate it, it should be more descriptive than just "Error assigning IP: Unauthorized"

Thanks!

Comment 3 Weibin Liang 2020-09-15 19:44:49 UTC
Tested and verified in 4.6.0-0.nightly-2020-09-15-063156

code = Unknown desc = failed to create pod network sandbox k8s_whereabouts-pod-1_test2_4f017081-841c-4116-9e82-49ca47bbf389_0(bc7c388fd2e706afc723d8685028424e29b28ebe1cc27d1152f5614f8abcc4a5): [test2/whereabouts-pod-1:whereabouts]: error adding container to network "whereabouts": Error at storage engine: IPAM kubernetes client initialization error: stat /invalid/path: no such file or directory

Comment 6 errata-xmlrpc 2020-10-27 16:28:34 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 (OpenShift Container Platform 4.6 GA Images), 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-2020:4196