Bug 1085855 - oo-accept-node reports errors with mixed-case application or domain names
Summary: oo-accept-node reports errors with mixed-case application or domain names
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: ---
Assignee: Rajat Chopra
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-09 14:06 UTC by Sten Turpin
Modified: 2015-05-14 23:36 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-04-24 21:39:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
fix script for gears that are failing in oo-accept-node because of mixed case in APP_DNS (3.04 KB, application/x-ruby)
2014-04-12 00:12 UTC, Rajat Chopra
no flags Details

Description Sten Turpin 2014-04-09 14:06:04 UTC
Description of problem: oo-accept-node reports a disconnect between the httpd frontend entry and the gear, if the application or domain name include upper case letters


Version-Release number of selected component (if applicable): 
rubygem-openshift-origin-node-1.22.14-1.el6oso.noarch


How reproducible:
Always on Prod


Steps to Reproduce:
1. Create an application with upper case letters in the domain or app name
2. run oo-accept-node
3.

Actual results:
FAIL: httpd config references DNS name without associated gear: 'appName-DOMAIN.rhcloud.com'

Expected results:
If the gear exists, the error should not appear. 

Additional info:
rhc-fix-missing-frontend does not repair the alert. This does not appear to prevent gears from being accessible.

Comment 1 Peter Ruan 2014-04-11 23:26:25 UTC
verified with devenv-stage_802

Comment 2 Rajat Chopra 2014-04-12 00:12:52 UTC
Created attachment 885642 [details]
fix script for gears that are failing in oo-accept-node because of mixed case in APP_DNS

Comment 3 Rajat Chopra 2014-04-12 00:28:10 UTC
Part I :
Code fixed with : https://github.com/openshift/origin-server/pull/5219
Any new cases of OPENSHIFT_APP_DNS having mixed case will not result in extra entries in routes.json!

The above part was verified as per Comment#1, but the second part involves fixing already broken gears. So marking it back to ON_QA.

Part II of the fix is for existing gears that are already having the erroneous entry in the routes.json -> Run the attached script with the uuids as the argument.

e.g.
======================================== 
[root@ip]# oo-ruby fix_mixed_case_frontends.rb 53487b0e53c26e5652000001
Rebuilding the frontend for:
        53487b0e53c26e5652000001
Hit 'y' to continue, anything else to abort.
y
Fixing gear: 53487b0e53c26e5652000001 ...
Disconnecting frontend mapping for 53487b0e53c26e5652000001/php: ["", "/health"]
Disconnecting frontend mapping for 53487b0e53c26e5652000001/haproxy: ["", "/health", "/haproxy-status", "/health"]
Done
==========================================


Some details of the script :
1. Manually disconnect all the frontends with actual value of OPENSHIFT_APP_DNS env variable. This will remove both the downcased entry and the mixed case entry.
2. Call the installed gem's connect_frontend function to rebuild the frontend. With the above pull request, the mixed case of env variable will not matter and only one genuine entry will be created.


How to test :

1. Take an older devenv (one without the above pull request merged in it).
2. Create a scalable app, and as root go and modify /var/lib/openshift/<gear_uuid>/.env/OPENSHIFT_APP_DNS -> put the dns as some mixed case variation of the original.
3. Run oo-frontend-plugin-modify --rebuild
4. Run oo-accept-node to see the error being reported.

5. Now put the fix as in the pull request : https://github.com/openshift/origin-server/pull/5219
6. Run the attached fix script :  oo-ruby fix_mixed_case_frontends.rb <gear_uuid>
7. Run oo-accept-node. Check that it passes now.


Its a long-ish test to verify, and I manually put the pull request's changes on the devenv to test it out :(. But it works.

Comment 4 Meng Bo 2014-04-14 08:40:07 UTC
Checked the migration part of the existing apps.

Manual revert the PR/5219, create scalable app and modify the OPENSHIFT_APP_DNS to simulate the issue.
Put the patch in and run the ruby script.

Mixed dne entried in both nodes.txt and route.json are cleared and the original one is still there.

Move bug to verified.


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