Bug 802690 - got "ActiveResource::ServerError in DomainsController#update" error when changing namespace with invalid characters
Summary: got "ActiveResource::ServerError in DomainsController#update" error when chan...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Pod
Version: 2.x
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: ---
Assignee: Krishna Raman
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-13 09:50 UTC by Meng Bo
Modified: 2015-05-15 01:48 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-04-13 18:32:05 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Meng Bo 2012-03-13 09:50:48 UTC
Description of problem:
<-------->
ActiveResource::ServerError in DomainsController#update

Failed.  Response code = 500.  Response message = Internal Server Error.

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

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

Request

Parameters:

{"authenticity_token"=>"e8yRtW8tRwq+P2orVDd/H56/uKqUud+tOP6kt+fqhAg=",
 "domain"=>{"name"=>"bmengdev###"},
 "utf8"=>"✓",
 "_method"=>"put"}

Show session dump

Show env dump
Response

Headers:

None
<--------->

Version-Release number of selected component (if applicable):
rhc-site-0.88.4-1.el6_2.noarch

How reproducible:
always

Steps to Reproduce:
1.rhc domain via web
2.change domain name contains invalid chars like '###'
3.
  
Actual results:
got "ActiveResource::ServerError in DomainsController#update" error

Expected results:
should get meaningful message about invalid characters with normal webpage

Additional info:

Comment 1 Clayton Coleman 2012-03-13 23:55:09 UTC
Rest API throws 500 and renders HTML

P7n56xLTCr2l", "version": "3.3.1"}, "job_id": 75649208, "msgs": [{"INFO
": "login: Login successful", "SOURCE": "BLL", "ERR_CD": null, "LVL": "
INFO"}]}
DEBUG: DYNECT Response data: version3.3.1tokenDljXeMIK5Mh5J/BVrZ6BMn10HXa5BCuLEAjHY40Eo5PjZHRrY2kty6LcQAKym2zfAy4GlHFBBcNueChMVPFSWnkCTFzp0jgIAWhCkjX1hXS/erMcdYNbrHuCavFSf7E0MQiueCrKxWx1DclwsM/jP7n56xLTCr2l
Completed 500 Internal Server Error in 505ms

URI::InvalidURIError (bad URI(is not URI?): https://api2.dynect.net/REST/TXTRecord/rhcloud.com/###.dev.rhcloud.com/):
  lib/express/broker/dns_service.rb:294:in `dyn_has?'
  lib/express/broker/dns_service.rb:231:in `dyn_has_txt_record?'
  lib/express/broker/dns_service.rb:45:in `namespace_available?'

Comment 2 Abhishek Gupta 2012-03-19 20:14:39 UTC
I just checked and the validations are performed with both the new and old REST APIs. The changes seem to have been made sometime last week.

Using the new REST APIs, the response returned is show below

$ curl -k -u 'agupta6:pp' -d 'namespace=dfg###df' https://localhost/broker/rest/domains

{"data":null,"version":"1.0","type":null,"messages":[{"text":"Invalid namespace: dfg###df. Namespace must only contain alphanumeric characters.","exit_code":106,"field":"namespace","severity":"error"}],"status":"unprocessable_entity"}



Using the old REST APIs, the response returned is show below

$ curl -k -d 'json_data={"rhlogin": "agupta6", "namespace": "dsflgn###sdgs"}' https://localhost/broker/domain

{"exit_code":106,"debug":"","broker_c":["namespace","rhlogin","ssh","app_uuid","debug","alter","cartridge","cart_type","action","app_name","api"],"data":"","api_c":["placeholder"],"messages":"","result":"Invalid namespace: dsflgn###sdgs","api":"1.1.3"}

Comment 3 Yujie Zhang 2012-03-20 06:12:18 UTC
Verify this bug on stage, it has been fixed now, thanks.


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