Bug 812060

Summary: [REST API] Domain with empty name returns two validation messages instead of one
Product: OKD Reporter: Clayton Coleman <ccoleman>
Component: PodAssignee: Clayton Coleman <ccoleman>
Status: CLOSED DUPLICATE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.xCC: bmeng, lnader, mpatel, pruan, rpenta, yquan
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-05-24 20:02:17 EDT Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Description Flags
The Screenshot of error message. none

Description Clayton Coleman 2012-04-12 12:21:31 EDT
When posting a new domain with an id of '' the messages we get back are:

"Invalid namespace: ''. Namespace must only contain alphanumeric characters."
"Namespace '' is too short.  Minimum length is 1 characters."

Because we display the errors the server returns to the user this causes visual confusion - we should return a single error for the case '':

"Namespace '' is too short.  Minimum length is 1 characters."

(or some other better variation)
Comment 1 yquan 2012-04-27 01:08:42 EDT
When input existed domain name and not allowed domain name such as openshift, will also prompt "Your namespace must be letters or numbers with no spaces or symbols" error massage.I think this error message is not proper.

1,Log in and go to the domain name alter page.
2,Input the existed domain name or not allowed domain name.
3,Click save button.
Comment 2 Clayton Coleman 2012-05-15 16:58:39 EDT
Did this get fixed?
Comment 3 Peter Ruan 2012-05-15 18:05:48 EDT
Not on PROD
Comment 4 yquan 2012-05-16 01:28:23 EDT
   It is not fixed in devenv_1178 yet, and I found some other problem.When I input the existed namespace, and click the save button , it will return "namespace 'domaintest00' already in use. Please choose another", but I input none namespace and click the save button, the previous error message still existe. You can refer to the screenshot attachment.
Comment 5 yquan 2012-05-16 01:29:50 EDT
Created attachment 584849 [details]
The Screenshot of error message.
Comment 6 Clayton Coleman 2012-05-16 12:28:08 EDT
Had a scathing twitter post about this - MUST FIX :)
Comment 7 Ravi Sankar 2012-05-16 18:34:11 EDT
Git rev 2894737fac99d fixes the issue mentioned in the description i.e. it returns only one error in case of failures.
For comment-4, broker is returning only one error 'Domain xxx already in use. please choose another' but site is showing more errors. 
Assigning to clayton for further investigation.
Comment 8 yquan 2012-05-22 04:41:44 EDT
The duplicate error message does not prompt when input '' namespace .
But the problem in comment-4 is still exist.

You can reproduce it in website in follow steps.

1.create a domain in website
2.go the page of changing domain.
3.input existed domain name and click the save button, then "Namespace 'domiantest000' already in use. Please choose another" will be prompted.
4.input domain name with empty, and click the save.
5.The "Namespace 'domiantest000' already in use. Please choose another" will still exist in the page.

I think it is page's problem.
I suspect it has no bussiness with the broker.
Comment 9 Clayton Coleman 2012-05-24 20:02:17 EDT
The problem in comment 8 is a dupe of bug 822018 - the JS was showing it.

*** This bug has been marked as a duplicate of bug 822018 ***