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

Unable to download specified chef version for Windows #118

Open
btm opened this issue Mar 26, 2015 · 12 comments
Open

Unable to download specified chef version for Windows #118

btm opened this issue Mar 26, 2015 · 12 comments

Comments

@btm
Copy link

btm commented Mar 26, 2015

When installing Chef on a Windows machine, we download it with this command install_chef.rb#L217:

powershell -command "(New-Object System.Net.WebClient).DownloadFile('#{url}?v=%version%', '%dest%')"

The default URL for Windows from #default_install_url is 'http://www.getchef.com/chef/install.msi'

So we end up with a URL like: http://www.getchef.com/chef/install.msi?v=12.0.0, but this is only giving us the latest version. If we use http://www.opscode.com/chef/install.msi?v=12.0.0, it gives us the correct version. This is likely due to some ChefInc domains moving to a CDN.

It looks like the nginx configuration still contains:

  location "/chef/install.msi" {
    rewrite ^ /chef/download?p=windows&pv=2008r2&m=x86_64 permanent;
  }

I guess that somehow converts the ?v=12.0.0 into &v=12.0.0 and appends it as part of the rewrite?

Possible fixes:

  1. Modify the URL in vagrant-omnibus to use the Omnitruck API URL directly instead (the non-windows code just downloads install.sh and passes the version to it when it runs it).
  2. Have Chef Ops fix/exclude the /chef/install.msi URI?
@smudgerdan
Copy link

+1 for this

@olivierlemasle
Copy link

That'a critical bug because it currently always install the last Chef client on Windows, even if the latest version has a bug (which is currently the case with chef solo, due to chef/chef#4948).

Using opscode.com instead of getchef.com as suggested in #118 (comment) does not work anymore: https://www.getchef.com/chef/install.msi?v=12.10.24 and https://www.opscode.com/chef/install.msi?v=12.10.24 both download the latest MSI (currently chef-client-12.11.18-1-x86.msi).

To download Chef client 12.10.24, correct URL is https://packages.chef.io/stable/windows/2008r2/chef-client-12.11.18-1-x86.msi or https://packages.chef.io/stable/windows/2008r2/chef-client-12.11.18-1-x64.msi; the redirections don't work as expected.

@ch-l
Copy link

ch-l commented Jun 27, 2016

we use the workaround

config.omnibus.chef_version = "12.10.24"
config.omnibus.install_url = "https://packages.chef.io/stable/windows/2008r2/chef-client-#{config.omnibus.chef_version}-1-x64.msi"

@olivierlemasle
Copy link

Thanks @ch-l

(In my case, I figured out that I didn't need vagrant-omnibus anymore, as recent versions of Vagrant already installed Chef)

@jasmeralia
Copy link

Thanks @ch-l ! That helps us out a lot. Our devs thank you :)

@fourth-barryleonard
Copy link

Thanks @ch-l this worked for me as well :)

@blairham
Copy link

Beware: 1.5.0 Broke this workaround

@ZedCode
Copy link

ZedCode commented Apr 20, 2017

This bug is killing our automation, is there any sort of ETA on a fix to this?

@knepprath
Copy link

knepprath commented Apr 20, 2017

We need to be able to reliably pin down the version of the chef-client that gets installed.

Any ETA on the fix for this?

@jasmeralia
Copy link

jasmeralia commented Apr 20, 2017 via email

@davidski
Copy link

Hey, @stormerider, thanks for the info. Is there any reference you can point to that vagrant-omnibus is deprecated? test-kitchen is great, but it's a different workflow and doesn't seem a drop in replacement for development VMs vs. the testing out of CM cookbooks and the like where kitchen shines. Appreciate any pointers you may have!

@jasmeralia
Copy link

jasmeralia commented Apr 20, 2017 via email

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

No branches or pull requests