treasure-data / chef-td-agent

Chef Cookbook for td-agent (Treasure Agent or Fluentd)
https://supermarket.chef.io/cookbooks/td-agent
Apache License 2.0
127 stars 121 forks source link

Cannot pin td-agent version #87

Closed joegoggins closed 6 years ago

joegoggins commented 8 years ago

Given I have this in an attribute file in a wrapper cookbook:

default["td_agent"]["version"] = "2.3.2"
default["td_agent"]["pinning_version"] = true

When I run include_recipe('td-agent') in said wrapper cookbook

Then I get this error:

           Error executing action `install` on resource 'apt_package[td-agent]'
           ================================================================================

           Mixlib::ShellOut::ShellCommandFailed
           ------------------------------------
           Expected process to exit with [0], but received '100'
           ---- Begin output of apt-get -q -y install td-agent=2.3.2 ----
           STDOUT: Reading package lists...
           Building dependency tree...
           Reading state information...
           STDERR: E: Version '2.3.2' for 'td-agent' was not found
           ---- End output of apt-get -q -y install td-agent=2.3.2 ----
           Ran apt-get -q -y install td-agent=2.3.2 returned 100

           Cookbook Trace:
           ---------------
           /tmp/kitchen/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:41:in `run_action'

           Resource Declaration:
           ---------------------
           # In /tmp/kitchen/cache/cookbooks/td-agent/recipes/default.rb

           115: package "td-agent" do
           116:   if node["td_agent"]["pinning_version"]
           117:     action :install
           118:     version node["td_agent"]["version"]
           119:   else
           120:     action :upgrade
           121:   end
           122: end

           Compiled Resource:
           ------------------
           # Declared in /tmp/kitchen/cache/cookbooks/td-agent/recipes/default.rb:115:in `from_file'

           apt_package("td-agent") do
             package_name "td-agent"
             action [:install]
             retries 0
             retry_delay 2
             default_guard_interpreter :default
             declared_type :package
             cookbook_name "td-agent"
             recipe_name "default"
             version "2.3.2"
           end

           Platform:
           ---------
           x86_64-linux

Am I doing something wrong or is this a bug?

repeatedly commented 8 years ago

Do you use Ubuntu or Debian?

joegoggins commented 8 years ago

Ubuntu

On Aug 31, 2016, at 12:38 AM, Masahiro Nakagawa notifications@github.com wrote:

Do you use Ubuntu or Debian?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

repeatedly commented 8 years ago

See README: https://github.com/treasure-data/chef-td-agent#limitation We will fix this problem by using aptly later.

joegoggins commented 8 years ago

Cool, for the update.

sandstrom commented 6 years ago

@joegoggins This has been solved now: https://github.com/treasure-data/omnibus-td-agent/issues/66#issuecomment-273585283

Feel free to close this issue.

joegoggins commented 6 years ago

Good to know. I've actually deprecated usage of this cookbook in the time since filing this, however, we'll likely use it again at some point. Thanks!