Bug 794664 - The same alias name can be added twice for different app on one instance.
Summary: The same alias name can be added twice for different app on one instance.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Pod
Version: 1.x
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: ---
Assignee: Krishna Raman
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-17 09:11 UTC by Johnny Liu
Modified: 2014-06-18 07:24 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-03-02 21:56:32 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Johnny Liu 2012-02-17 09:11:33 UTC
Description of problem:


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

How reproducible:
Always

Steps to Reproduce:
1. Make sure an existing app with alias (bar.foo.com) already added 
$ rhc-domain-info -p <password>
<--snip-->
wsgitest
    Framework: python-2.6
     Creation: 2012-01-18T01:46:17-05:00
         UUID: d0ffd65a28344637800d6ce1d7810d62
      Git URL: ssh://d0ffd65a28344637800d6ce1d7810d62.rhcloud.com/~/git/wsgitest.git/
   Public URL: http://wsgitest-jialiu1.stg.rhcloud.com/
      Aliases: bar.foo.com
<--snip-->

2. Create a new app

3. Add some non-existing aliases (bar.xx.com) to this app
$ rhc-ctl-app -a phptest -c add-alias --alias bar.xx.com -p 214214

RESULT:
Success

$ rhc-domain-info -p <password>
Application Info
================
phptest
    Framework: php-5.3
     Creation: 2012-02-17T03:34:22-05:00
         UUID: 6145a5d4c994417c9b036dbc95e66191
      Git URL: ssh://6145a5d4c994417c9b036dbc95e66191.rhcloud.com/~/git/phptest.git/
   Public URL: http://phptest-jialiu.stg.rhcloud.com/
      Aliases: bar.xx.com

 Embedded: 
      None


$ rhc-ctl-app -a phptest -c add-alias --alias bar.xx.com -p <password>
Problem reported from server. Response code was 400.
Re-run with -d for more information.

RESULT:
Alias 'bar.xx.com' already exists for 'phptest'

(NOTE: This error is expected)

4. Add a duplicated alias (bar.foo.com) that is using by other app to the new app
$ rhc-ctl-app -a phptest -c add-alias --alias bar.foo.com -p <password>

RESULT:
Success

$ rhc-domain-info -p <password>
Application Info
================
phptest
    Framework: php-5.3
     Creation: 2012-02-17T03:34:22-05:00
         UUID: 6145a5d4c994417c9b036dbc95e66191
      Git URL: ssh://6145a5d4c994417c9b036dbc95e66191.rhcloud.com/~/git/phptest.git/
   Public URL: http://phptest-jialiu.stg.rhcloud.com/
      Aliases: bar.xx.com

 Embedded: 
      None

NOTE:
Found the "bar.foo.com" is not be seen in the output

  
Actual results:
Alias - "bar.foo.com" that is using be other app is added successfully, but not shown in the output of rhc-domain-info.

Ping these two app, found they are running the same instance:
$ ping phptest-jialiu.stg.rhcloud.com
PING ec2-107-21-77-136.compute-1.amazonaws.com (107.21.77.136) 56(84) bytes of data.
64 bytes from ec2-107-21-77-136.compute-1.amazonaws.com (107.21.77.136): icmp_req=1 ttl=47 time=270 ms


$ ping wsgitest-jialiu1.stg.rhcloud.com
PING ec2-107-21-77-136.compute-1.amazonaws.com (107.21.77.136) 56(84) bytes of data.
64 bytes from ec2-107-21-77-136.compute-1.amazonaws.com (107.21.77.136): icmp_req=1 ttl=47 time=270 ms



Expected results:
An alias using by other app should be allowed to add again on the same instance.

Additional info:
Access web page using this alias, find the first app is being accessed.
$ curl -H "Host: bar.foo.com" ec2-107-21-77-136.compute-1.amazonaws.com |grep title
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  7 16565    7  1192    0     0   1369      0  0:00:12 --:--:--  0:00:12  3947  <title>Welcome to ---wsgi--- OpenShift</title>
100 16565  100 16565    0     0  14438      0  0:00:01  0:00:01 --:--:-- 28609

Comment 1 Dan McPherson 2012-02-17 15:32:19 UTC
The cart is returning this:

CLIENT_ERROR: FATAL ERROR: www.blah.com Already exists.

And Application.add_alias is turning around removing the alias and saying everything is ok.

It also looks like the save isn't happening until after the call to the node which is also wrong.

Comment 2 Krishna Raman 2012-02-17 17:24:07 UTC
Fix in ff35f9716166ebc0244dbe6479321143bee55224

Comment 3 Meng Bo 2012-02-20 08:43:18 UTC
verified on stage, issue has been fixed.


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