BallisticPain / chef-wkhtmltopdf

Chef Cookbook for wkhtmltopdf
Other
3 stars 8 forks source link

TypeError - no implicit conversion of nil into String #11

Open heaven opened 6 years ago

heaven commented 6 years ago

Getting this error when trying to install binaries:

  TypeError
  ---------
  no implicit conversion of nil into String

  Cookbook Trace:
  ---------------
    /var/chef/cache/cookbooks/wkhtmltopdf-update/recipes/binary.rb:2:in `join'
    /var/chef/cache/cookbooks/wkhtmltopdf-update/recipes/binary.rb:2:in `from_file'
    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb:347:in `load_recipe'
    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb:303:in `block in include_recipe'
    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb:302:in `each'
    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb:302:in `include_recipe'
    /var/chef/cache/cookbooks/wkhtmltopdf-update/recipes/default.rb:7:in `from_file'
    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb:347:in `load_recipe'

  Relevant File Content:
  ----------------------
  /var/chef/cache/cookbooks/wkhtmltopdf-update/recipes/binary.rb:

    1:  cache_dir = Chef::Config[:file_cache_path]
    2>> download_dest = File.join(cache_dir, node['wkhtmltopdf-update']['package'])
    3:
    4:  remote_file download_dest do
    5:    source node['wkhtmltopdf-update']['mirror_url']
    6:    mode '0644'
    7:    action :create_if_missing
    8:  end
    9:
   10:  package 'wkhtmltopdf' do
   11:    source download_dest
ToMoCoop commented 6 years ago

It appears the variable node['wkhtmltopdf-update']['package'] was removed here: https://github.com/BallisticPain/chef-wkhtmltopdf/commit/7650efbd3a7f6546dbb46d4bd2510ac7105708af

Not sure whether the correct fix is to put it back in (with the updated file name convention from the new mirror url) or amend the binary recipe.

Additionally, however, the commented out provider in the package section of binary recipe will also cause this to fail on ubuntu: https://github.com/BallisticPain/chef-wkhtmltopdf/commit/87232a1cdb4af7605483a22a3b2148d5bedab79c#diff-1c4702998d25442b7a6cfa7abe806c67 and I believe this needs to be put back in.

Well, at least I hope this helps.