-
-
Notifications
You must be signed in to change notification settings - Fork 599
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
Reinstalls elasticserach every chef run #404
Comments
@spuder The Chef file providers have changed significantly over the 11.x and 12.x time frame. Could you tell us what version of Chef you saw this under? |
Using chef 12.5.1 with cookbook version 2.0.0. It should be pretty easy to reproduce. Use the 2.0.0 cookbook and try and install elasticsearch 2.1.0 (since there is no 2.1.0 checksum defined in the cookbook). I only noticed the problem when I was on a really slow internet connection. (Tethered to my cellphone). I can try and reproduce this again today with the latest chef 12.6.0 |
Are you sure it's reinstalling every time? I was able to see in the logs that it redownloads the file, but it skips reinstalling it for me:
I think adding the warning makes sense 👍 |
Yes, the issue is misleading. The real problem isn't that the package is reinstalled, but rather that the package is unnecessarily downloaded every time. |
I've added a warning to help people that forget to add a checksum. Thanks @spuder! |
If you attempt to install a newer version of elasticsearch than the cookbook version, it will attempt to download elasticsearch every chef run. I believe this is because the checksums are hard coded into the cookbook, and if the checksum is missing, it optimistically downloads elasticsearch again.
Took me a while to figure out what was going on, but I realized there are two workarounds.
or
shasum -a 256
)I think the following improvements could be made to help others who might fall into this situation.
node['elasticsearch']['version']
in your role/wrapper cookbook. This is different from how most other cookbooks work. Upgrading just requires that you bump your berksfile version. (which is a fantastic design).The text was updated successfully, but these errors were encountered: