Bug 1163473 - Binary deployment fails if URL contains special characters
Summary: Binary deployment fails if URL contains special characters
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node
Version: 2.2.0
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: ---
: ---
Assignee: Brenton Leanhardt
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks: 1163893
TreeView+ depends on / blocked
 
Reported: 2014-11-12 18:58 UTC by thunt
Modified: 2015-01-08 15:34 UTC (History)
6 users (show)

Fixed In Version: rubygem-openshift-origin-controller-1.33.2.1-1
Doc Type: Bug Fix
Doc Text:
Cause: artifact_url was not properly decoded. Consequence: Deployments using an artifact_url with special characters in the URL would fail. Fix: artifact_url is now properly URI encoded. Result: Deployments using an artifact_url with special characters in the URL now work as expected.
Clone Of:
: 1163893 (view as bug list)
Environment:
Last Closed: 2015-01-08 15:34:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0019 0 normal SHIPPED_LIVE Red Hat OpenShift Enterprise 2.2.3 bug fix and enhancement update 2015-01-08 20:33:24 UTC

Description thunt 2014-11-12 18:58:19 UTC
Description of problem:

Customer is trying to deploy binary artifact with URL of type:

http://jenkins.example.com:13080/ram.ws/oslc/assets/%7B558F2532-1116-50E0-FD2D-7EFCE7F130B3%7D/1.0/artifactContents/201411119-jbossSample1.tar.gz

Broker decodes artifact URL on input to:

http://jenkins.example.com:13080/ram.ws/oslc/assets/{558F2532-1116-50E0-FD2D-7EFCE7F130B3}/1.0/artifactContents/201411119-jbossSample1.tar.gz

The Ruby URI parser in deployments_controller.rb then fails to parse the above decoded URL, and the binary deployment is rejected.

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


How reproducible:
Very

Steps to Reproduce:
See description

Actual results:
URL is rejected as invalid

Expected results:
URL should be deployed

Additional info:

A work around is to double encode the URL, as in:

http://jenkins.example.com:13080/ram.ws/oslc/assets/%257B558F2532-1116-50E0-FD2D-7EFCE7F130B3%257D/1.0/artifactContents/201411119-jbossSample1.tar.gz

Comment 4 Ma xiaoqiang 2014-12-09 09:36:31 UTC
Check on puddle [2.2.z/2014-12-08.2]

1. Create an app and configure it
#rhc app create phpapp php-5.4
#rhc snapshot save phpapp --deployment
#mv phpapp.tar.gz  \<test_123-123\>.tar.gz
#vim index.php
<title>Welcome OpenShift</title>
#git commit -amx && git push 
#rhc snapshot save phpapp
#rhc app-configure -a phpapp --deployment-type binary

2. deploy the app
#rhc app-deploy --ref \<test_123-123\>.tar.gz -a phpapp

3. Check the title
#curl http://phpapp-yes.ose22-auto.com.cn/|grep title
The output is 'Welcome to OpenShift'

4. restore and deploy the app
#rhc snapshot restore phpapp
#curl -k  -H "Accept: application/xml" --user "test:redhat" https://localhost/broker/rest/application/5486a1bb82611d43e0000123/deployments -X POST -d artifact_url=http://virt-openshift-08.lab.eng.nay.redhat.com/%25ad%7bad%7d.tar.gz
URI::encode('%ad{ad}.tar.gz')='%25ad%7bad%7d.tar.gz' 

5. Check the title
#curl http://phpapp-yes.ose22-auto.com.cn/|grep title
The output is 'Welcome to OpenShift'

6. restore and deploy the app
#rhc snapshot restore phpapp
#curl -k  -H "Accept: application/xml" --user "test:redhat" https://localhost/broker/rest/application/5486a1bb82611d43e0000123/deployments -X POST -d artifact_url=http://virt-openshift-08.lab.eng.nay.redhat.com/\<test_123-123\>.tar.gz

7 Check the title
#curl http://phpapp-yes.ose22-auto.com.cn/|grep title
The output is 'Welcome to OpenShift'

Comment 6 errata-xmlrpc 2015-01-08 15:34:18 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0019.html


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