chef-boneyard / vagrant-omnibus

A Vagrant plugin that ensures the desired version of Chef is installed via the platform-specific Omnibus packages.
Apache License 2.0
551 stars 63 forks source link

Additional Download Problems #96

Open pluttrell opened 10 years ago

pluttrell commented 10 years ago

Starting this evening, when using config.omnibus.chef_version = :latest, I'm getting the following using multiple cookbooks on multiple machines:

==> default: Downloading Chef 11.16.2 for ubuntu...
==> default: downloading https://www.getchef.com/chef/metadata?v=11.16.2&prerelease=false&nightlies=false&p=ubuntu&pv=14.04&m=x86_64
==> default:   to file /tmp/install.sh.5513/metadata.txt
==> default: trying wget...
==> default: ERROR 404
==> default: Unable to retrieve a valid package!
==> default: Please file a bug report at http://tickets.opscode.com
==> default: Project: Chef
==> default: Component: Packages
==> default: Label: Omnibus
==> default: Version: 11.16.2
==> default:  
==> default: Please detail your operating system type, version and any other relevant details
==> default: Metadata URL: https://www.getchef.com/chef/metadata?v=11.16.2&prerelease=false&nightlies=false&p=ubuntu&pv=14.04&m=x86_64
Vagrant::Errors::VagrantError: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

sh install.sh -v 11.16.2 2>&1

Stdout from the command:

Downloading Chef 11.16.2 for ubuntu...
downloading https://www.getchef.com/chef/metadata?v=11.16.2&prerelease=false&nightlies=false&p=ubuntu&pv=14.04&m=x86_64
  to file /tmp/install.sh.5513/metadata.txt
trying wget...
ERROR 404
Unable to retrieve a valid package!
Please file a bug report at http://tickets.opscode.com
Project: Chef
Component: Packages
Label: Omnibus
Version: 11.16.2

Please detail your operating system type, version and any other relevant details
Metadata URL: https://www.getchef.com/chef/metadata?v=11.16.2&prerelease=false&nightlies=false&p=ubuntu&pv=14.04&m=x86_64
atward commented 10 years ago

Appears to be an issue with retrieve_latest_chef_version which is checking gem to get the latest version (11.16.2 as of writing) but only 11.16 is available via getchef.com/chef/metadata.

Pinning your Vagrant config.omnibus.chef_version to '11.16' is a workaround for this until 11.16.2 is published by opscode.

It'd be nice if vagrant-omnibus checked against the omnibus metadata to get latest version.

atward commented 10 years ago

It's perfectly valid to pass in latest to opscode metadata. eg: https://www.getchef.com/chef/metadata?v=latest&prerelease=false&nightlies=false&p=el&pv=6&m=x86_64

Is there any reason to do retrieve_latest_chef_version?

tmatilai commented 10 years ago

The code in retrieve_latest_chef_version (and elsewhere) predates the existence of the metadata API. Feel free to suggest better approaches now. =)

lamont-granquist commented 10 years ago

So, using :latest is kinda stupid on the face of it, for fundamental reasons. You'll probably break when we push 12.0.0 and this code immediately pulls that and you get upgraded to chef-12 on the day we release it. The omnitruck API supports partial versions so that if you pass "11" to it, it'll serve the latest 11.x that omnitruck knows about, which is probably the behavior that people who are using :latest actually want. This will also be the behavior in knife bootstrap in chef-12. Right now in chef-11 it uses the gem version you've installed as a version pin (so would use 11.16.2 if you installed that gem and did a knife bootstrap), in chef-12 that code has been changed so that it peels off the major version number from knife and then uses that as the omnitruck version to bootstrap (i.e. "12").

lamont-granquist commented 10 years ago

Just checked the code and omnitruck does support 'latest' as a string to the API (or you can just omit the version argument entirely). So the first step is that :latest should be mapped on that, but please include a loud WARN to people that they'll get major version bumped without any warning and their cookbooks may break and nobody will apologize to them about it.