This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 802690 - got "ActiveResource::ServerError in DomainsController#update" error when changing namespace with invalid characters
got "ActiveResource::ServerError in DomainsController#update" error when chan...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Pod (Show other bugs)
2.x
Unspecified Unspecified
high Severity medium
: ---
: ---
Assigned To: Krishna Raman
libra bugs
: Regression, Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-13 05:50 EDT by Meng Bo
Modified: 2015-05-14 21:48 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-04-13 14:32:05 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Meng Bo 2012-03-13 05:50:48 EDT
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 19:55:09 EDT
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 16:14:39 EDT
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 02:12:18 EDT
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.