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

/usr/local/bin/consul-template is created as a zero-length file #40

Closed
jperville opened this issue Jan 5, 2016 · 6 comments
Closed

Comments

@jperville
Copy link

When:

  • the /usr/local/bin/consul-template file does not exist
  • the /var/chef/cache/consul-template.zip file exists

Then running chef-client will result in the /usr/local/bin/consul-template being created as a zero-length file (and of course, the service[consul-template] will not be running at the end of the chef-run).

This condition is easy to reproduce, just type rm /usr/local/bin/consul-template on existing setup before running chef-client again.

Here is the relevant portion of my chef-client log (with my comments added):

Recipe: consul-template::install_binary
  * ark[consul-template] action cherry_pick
    * directory[/usr/local/bin] action create (up to date)
    * remote_file[/var/chef/cache/consul-template.zip] action create (up to date)
    * execute[cherry_pick consul-template from /var/chef/cache/consul-template.zip] action nothing (skipped due to action :nothing)   # <<<<---- this skips extracting consul-template.zip, so /usr/local/bin/consul-template is not created
    * execute[set owner on /usr/local/bin] action nothing (skipped due to action :nothing)
     (up to date)
  * file[/usr/local/bin/consul-template] action touch  # <<<<--- this creates the file as a zero-length file
    - create new file /usr/local/bin/consul-template
    - change mode from '' to '0755' 
    - update utime on file /usr/local/bin/consul-template

The archive should be extracted in all cases when /usr/local/bin/consul-template does not exist.

@adamkrone
Copy link
Owner

Thanks for opening the issue, I've reproduced this on my end. I'm already looking at a related bug (#38), so I'll see if I can resolve this at the same time.

adamkrone added a commit that referenced this issue Jan 15, 2016
- removes ark (uses libarchive instead)
- fixes version updates using a symlink (Issue #38)
- fixes issue that could cause a zero-length consul-template file to be
  created (Issue #40)
- updates checksums to use releases.hashicorp.com for all version (also
  simplified install_binary logic)
- adds new 0.12.2 version to checksums
@adamkrone
Copy link
Owner

I just merged some changes into master that updates the way binaries are downloaded/extracted/etc. Let me know if this fixes things for you.

@scalp42
Copy link
Contributor

scalp42 commented Feb 9, 2016

I think we should be able to close this one. @jperville have you tested it?

@jperville
Copy link
Author

Hi @adamkrone, I confirm that the current master version of this cookbook fixes my issue. Looking forward to new release of this cookbook, thank you very much.

@adamkrone
Copy link
Owner

@jperville awesome, I'll close this out. There's another issue I want to get resolved before I do another release, but that should hopefully happen in the next week.

@jperville
Copy link
Author

Thank you very much.

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

No branches or pull requests

3 participants