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

elasticsearch::ebs fails if apt package cache is out of date #88

Closed
Pneumatus opened this issue Apr 25, 2013 · 5 comments

Comments

Projects
None yet
3 participants
@Pneumatus
Copy link

commented Apr 25, 2013

Given the current most recent EC2 AMI of Ubuntu 12.04 in us-east-1 (ami-d0f89fb9, according to http://cloud-images.ubuntu.com/locator/ec2/), any attempt to include the elasticsearch::ebs recipe in a run list before an 'apt-get update' has been issued results in a run failure.

This issue is due to the package cache being out of date when we try and upgrade the 'build-essential' package as the package currently referenced in the apt package cache results in HTTP 403s.

An apt-get update before upgrading the dependant packages solves this, but because the packages are being upgraded at compile-time, even including the 'apt' cookbook is no use. The compile-time run of these package installs happen before the 'apt' cookbook gets a chance to refresh the package cache.

As a temporary fix I've got a separate recipe with

execute('compiletime-apt-get-update') { command 'apt-get update' and action :nothing }.run_action(:run)

... but this of course runs every chef-client run, even though it's not necessary, and I'd imagine there is probably a more graceful solution that I have not thought of.

@Pneumatus

This comment has been minimized.

Copy link
Author

commented May 3, 2013

For the sake of multi-platform compatibility it seems that including the 'build-essential' cookbook from opscode with node['build_essential']['compiletime'] = true is probably the best solution as that cookbook already has per-platform handling of updating packages at compiletime.

@karmi karmi closed this in c74375f May 9, 2013

@karmi

This comment has been minimized.

Copy link
Member

commented May 9, 2013

@Pneumatus Indeed!, thanks for the suggestion, this seems to be the right fix -- verified now on Amazon Linux in EC2.

@martinb3

This comment has been minimized.

Copy link
Contributor

commented Sep 30, 2014

For what it's worth, this change actually makes it worse for people who already include apt and build-essential. I'm not sure what factors determine the order (it probably is non-deterministic), but this change can cause build-essentials to run before an apt-get update for me, both running at compile time. For many systems, this actually breaks things if the package manifest is out of date (such as in the cloud). For me, it breaks b/c it tries to install autoconf before apt-get update.

It seems to me that apt's compile time flag should be set to true, and the one for build-essential should NOT be set to true, so that packages required by build-essential are actually available when it runs.

Also, build_essentials is deprecated -- it should be build-essentials.

@karmi

This comment has been minimized.

Copy link
Member

commented Oct 1, 2014

@martinb3 Sorry to hear that :/ So, what should we do here in terms of code?

@martinb3

This comment has been minimized.

Copy link
Contributor

commented Oct 3, 2014

@karmi Most community cookbooks don't try to take control of apt-get update; they leave it up to the caller (they don't make any assumptions). Also, adding a requirement on build-essential is a huge additional requirement just to ensure the apt cache is updated. I think that unless this cookbook has a real requirement on build essentials (compiler, etc), it shouldn't be used just to manage the apt cache.

Filed an issue #241, will work on a PR that includes documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.