Bug 1332871

Summary: Confusing error message for oc set probe
Product: OpenShift Container Platform Reporter: Michal Fojtik <mfojtik>
Component: ocAssignee: Juan Vallejo <jvallejo>
Status: CLOSED CURRENTRELEASE QA Contact: Xingxing Xia <xxia>
Severity: low Docs Contact:
Priority: medium    
Version: 3.2.0CC: aos-bugs, ffranz, jokerman, jvallejo, lxia, mfojtik, mmccomas, vlaad, xiaocwan, xxia
Target Milestone: ---   
Target Release: 3.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-09-11 18:17:26 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:

Comment 1 Juan Vallejo 2017-02-01 18:59:55 UTC
Although the error today still does not explicitly tell a user that they should provide a port with a get-url, it has been formatted to be much more readable:

```
$ oc set probe ... --get-url="http://myurlwithnoport.com"

error: DeploymentConfig "database" is invalid

* spec.template.spec.containers[0].livenessProbe.httpGet.port: Invalid value: "": must contain only alpha-numeric characters (a-z, 0-9), and hyphens (-)
* spec.template.spec.containers[0].livenessProbe.httpGet.port: Invalid value: "": must contain at least one letter or number (a-z, 0-9)
```

Perhaps the client could add a message at the bottom of the error message that explicitly tells the user to include a port with their url if one is not found?

Comment 2 Juan Vallejo 2017-02-01 19:09:34 UTC
Related PR: https://github.com/openshift/origin/pull/12759

Comment 3 Fabiano Franz 2017-02-19 00:01:57 UTC
Fixed in https://github.com/openshift/origin/pull/12759.

Comment 4 Troy Dawson 2017-02-21 22:36:34 UTC
This has been merged into ocp and is in OCP v3.5.0.32 or newer.

Comment 7 Juan Vallejo 2017-02-23 18:42:52 UTC
I'm not sure I understand Comment 6, the output seems to reflect the changes introduced in PR https://github.com/openshift/origin/pull/12759. The original errors from the server are still present (this was intentional), however a more user-friendly message is also part of the overall output: "A port must be specified as part of a url.."

Comment 8 XiaochuanWang 2017-02-24 09:42:50 UTC
The last Two lines are cool enough. 

The first line (as below) is confused, it looks like the dc name is invalid but actually the url in invalid.
"error: DeploymentConfig "mydc" is invalid"

Also from my understanding the part below the "error" line is in detail, it's better to move the message "A port must be specified as part of a url (http://127.0.0.1:3306)." to the top instead of the line "error: DeploymentConfig "mydc" is invalid". It's not a big fault and you can keep it the same way, but the top part need to update. How do you think?

Comment 11 XiaochuanWang 2017-10-31 07:48:44 UTC
Hmm it makes sense, I agree.
Tested on oc v3.7.0-0.184.0
Still this line "A port must be specified as part of a url (http://127.0.0.1:3306)." is in the last.

Will verify on latest version.

Comment 12 Juan Vallejo 2017-10-31 17:01:44 UTC
Origin PR: https://github.com/openshift/origin/pull/17107

Comment 13 Xingxing Xia 2017-11-15 08:56:02 UTC
Checked in latest version v3.7.8, it does not include the PR per https://url.corp.redhat.com/3a0e336 (Red Hat internal)
Saw Target Release is 3.8.0, will the PR go to v3.7? If no, can you move bug to MODIFIED? Then it will be tested when v3.8 is available

Comment 16 Liang Xia 2018-06-25 09:05:43 UTC
Move to ON_QA for re-test.

Comment 17 Xingxing Xia 2018-06-26 02:49:55 UTC
Thanks. It prompts clear message about port:
$ v3.9.30/oc set probe dc/hello-openshift --liveness --get-url=www.baidu.com
A port must be specified as part of a url (http://127.0.0.1:3306).

See 'oc set probe -h' for help and examples.
error: DeploymentConfig "hello-openshift" is invalid

* spec.template.spec.containers[0].livenessProbe.httpGet.port: Invalid value: "": must contain only alpha-numeric characters (a-z, 0-9), and hyphens (-)
* spec.template.spec.containers[0].livenessProbe.httpGet.port: Invalid value: "": must contain at least one letter or number (a-z, 0-9)