Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ampersand in Datacentre name is not encoded correctly #120

Closed
denislooby opened this issue Jun 28, 2018 · 6 comments
Closed

Ampersand in Datacentre name is not encoded correctly #120

denislooby opened this issue Jun 28, 2018 · 6 comments

Comments

@denislooby
Copy link

I have a datacentre called EP&T.
This is causing problems during vm creation when it tries to upload a file to the vm cloned from the stemcell.

It tries to upload to this URI.
https://w.x.y.z/folder/vm-1db04380-8ef3-4660-8d07-2be6d7caf86c/env.json?dcPath=EP&T&dsName=datastore1

The ampersand in EP&T is not encoded because the URI.escape used in file_provider.rb does not escape characters like & and =. As a result there is a 404 returned from vcenter.
CGI.escape does encode these characters.

Unfortunately unless I'm going crazy there seems to be a bug on the vcentre side as well!
If I browse into a VM folder on vcentre the url vcentre is using is
https://w.x.y.z/folder/vm-1db04380-8ef3-4660-8d07-2be6d7caf86c?dcPath=EP%2526T&dsName=datastore1

Note the '%2526' it should be just '%26', interesting to note that %25 is actually '%' so some odd double encoding issue in vcentre maybe?

So unfortunately while changing file_provider.rb will result in a correctly encoded URI, vcenter will still return 404 as it expects it's own incorrectly encoded version.
Probably still worth fixing in the CPI. But it looks like datacentres with & won't work until changes in both the CPI and vcentre.

@medvedzver
Copy link
Contributor

@denislooby Thanks for submitting the issue. We'll try to reproduce it(should be easy) and fix it if it's possible!

@medvedzver
Copy link
Contributor

@denislooby Followup question. Which version of vCenter and CPI are you using?

@denislooby
Copy link
Author

@medvedzver The CPI version was 45.1.0, vcentre/ESXi was 6.5.0

@medvedzver
Copy link
Contributor

@denislooby Sorry for not responding for many days.
We did reproduced an issue and submitted a bug to vCenter people.

@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.

The labels on this github issue will be updated when the story is started.

@julian-hj
Copy link
Member

This is fixed in v68

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants