Bug 974359

Summary: Failed to recognize alias with extra dot in the end to the original alias.
Product: OpenShift Online Reporter: Liang Xia <lxia>
Component: ContainersAssignee: Rob Millner <rmillner>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 2.xCC: abhgupta, dmcphers, 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: 2013-08-29 12:47:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Liang Xia 2013-06-14 04:47:46 UTC
Description of problem:
Add an alias app-domain.rhcloud.com to app-domain.dev.rhcloud.com, then remove alias with name app-domain.rhcloud.com.(note the extra .) will fail with error "Alias app-domain.rhcloud.com. can't be found in application ."
Version-Release number of selected component (if applicable):
devenv_3354
rhc-1.10.1
How reproducible:
always
Steps to Reproduce:
1.create an app.(rhc app create appjs jenkins-1.4)
2.create an alias for the app.(rhc alias add appjs appjs-domain.rhcloud.com)
3.remove the alias.(rhc alias remove appjs appjs-domain.rhcloud.com.) (Note the extra .)
Actual results:
Remove alias failed with error "Alias appjs-domain.rhcloud.com. can't be found in application .".
Expected results:
Remove alias should be successful.
Additional info:
When we access google.com. in explorer, it can be recognized as google.com
The same with apple.com. & amazon.com. and much more...

Comment 1 Clayton Coleman 2013-06-18 22:30:08 UTC
This is a behavior of the REST API.

Comment 2 Abhishek Gupta 2013-07-23 17:52:50 UTC
As per my discussion with Rob, assigning this bug to him to figure out how the frontend Apache deals with aliases with and without dots at the end. 

Based on the findings, we will decide on the fix and where we need to make it.

Comment 3 Rob Millner 2013-07-30 05:11:10 UTC
Apache is sensitive to the trailing dot.  My recommendation is to strip it immediately after the downcase when the alias is first entered.

This pull request does that for the FrontendHttpServer module:
https://github.com/openshift/origin-server/pull/3217


Abhishek, do you want to go ahead with this fix?  I'll need to write a migration and the broker should make a similar change and migration as well.


Also, the migration for SSL certificates is a bit more complicated.  We can change the file names but not the CN of the cert.

Comment 4 Rob Millner 2013-07-30 18:24:06 UTC
Per discussion, moving to the next sprint so we can work out broker and migration details.

Comment 5 Rob Millner 2013-08-19 18:26:04 UTC
Holding the node migration code until we know whether its even necessary.

Pull request for blocking the trailing dot in node code:
https://github.com/openshift/origin-server/pull/3409

Comment 6 Liang Xia 2013-08-20 11:45:15 UTC
Tested on devenv_3678, alias with extra dot in the end can not be added.

# rhc alias add php Test.com.
Invalid Server Alias 'test.com.' specified
# rhc alias add php Test.com
Alias 'Test.com' has been added.
# rhc alias add php .
Invalid Server Alias '.' specified
# rhc alias add php ..
Invalid Server Alias '..' specified
# rhc alias add php .test
Invalid Server Alias '.test' specified
# rhc alias list php
Alias    Has Certificate? Certificate Added
-------- ---------------- -----------------
test.com no               -

Move to verified.