Bug 1332871 - Confusing error message for oc set probe
Summary: Confusing error message for oc set probe
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 3.2.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: 3.8.0
Assignee: Juan Vallejo
QA Contact: Xingxing Xia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-04 09:10 UTC by Michal Fojtik
Modified: 2018-09-11 18:17 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-09-11 18:17:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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)


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