Bug 796056

Summary: Caught "NoMethodError in DomainsController#update " error when adding invalid domain name on app/console/applications on devenv_1628.
Product: OKD Reporter: Yujie Zhang <yujzhang>
Component: WebsiteAssignee: Krishna Raman <kraman>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: johnp, mfisher, xtian
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-04-13 18:34:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Yujie Zhang 2012-02-22 07:47:10 UTC
Description of problem:

Caught "NoMethodError in DomainsController#update " error when adding invalid domain name.

Version-Release number of selected component (if applicable):

devenv_1628 
rhc-site-0.87.2-1.git.129.a444ddf.el6.noarch

How reproducible:always


Steps to Reproduce:
1.Go to Openshift website and login
2.Go to app/console/applications page 
3.Add an invalid domain like "dddd@@@"
  
Actual results:

Caught "NoMethodError in DomainsController#update " error when adding invalid domain name.

NoMethodError in DomainsController#update

You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.each

Rails.root: /var/www/libra/site
Application Trace | Framework Trace | Full Trace

app/models/rest_api/base.rb:306:in `load_remote_errors'
app/models/rest_api/base.rb:146:in `save'
app/controllers/domains_controller.rb:23:in `update'

Request

Parameters:

{"commit"=>"Save",
 "utf8"=>"✓",
 "domain"=>{"name"=>"bbbbbbbbb@@@@"},
 "authenticity_token"=>"TzuWt8EJpqXrLMYmlcrg1Bi0Q43s5O7daYWcscZkfw0=",
 "_method"=>"put"}

Expected results:

Error message should be displayed.

Additional info:

Comment 1 Yujie Zhang 2012-02-22 08:53:58 UTC
This issue also happens when adding long domain name.

Comment 2 Clayton Coleman 2012-02-22 16:05:09 UTC
Server is not sending a well formed error body with messages (no body is sent).  Should be fixed when US1895 is fixed.

Started PUT "/broker/rest/domains/domain23.json" for 127.0.0.1 at Wed Feb 22 11:03:05 -0500 2012
  Processing by DomainsController#update as JSON
  Parameters: {"namespace"=>"domain23@@@@", "id"=>"domain23"}
Completed 422 Unprocessable Entity in 29ms (Views: 6.0ms)

Unable to read server response, #<Net::HTTPClientError 422 Unprocessable Entity readbody=true>
  Body: "{}"
Completed 500 Internal Server Error in 521ms

Comment 3 John (J5) Palmieri 2012-02-27 23:41:05 UTC
I'm not seeing this anymore.  Error handling works except for duplicate domains which is covered in Bug #797971

Comment 4 Yujie Zhang 2012-02-29 09:24:05 UTC
Verify this bug on devenv_1649,it is fixed now.