Bug 974359 - Failed to recognize alias with extra dot in the end to the original alias.
Failed to recognize alias with extra dot in the end to the original alias.
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
low Severity low
: ---
: ---
Assigned To: Rob Millner
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-14 00:47 EDT by Liang Xia
Modified: 2015-05-14 19:21 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-08-29 08:47:43 EDT
Type: Bug
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 Liang Xia 2013-06-14 00:47:46 EDT
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 18:30:08 EDT
This is a behavior of the REST API.
Comment 2 Abhishek Gupta 2013-07-23 13:52:50 EDT
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 01:11:10 EDT
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 14:24:06 EDT
Per discussion, moving to the next sprint so we can work out broker and migration details.
Comment 5 Rob Millner 2013-08-19 14:26:04 EDT
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 07:45:15 EDT
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.

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