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

uninitialized constant Chef::Resource::ArtifactFile on Chef client 13 #173

Open
athreyavc1 opened this issue Aug 30, 2017 · 3 comments
Open

Comments

@athreyavc1
Copy link

Hi,
artifact-cookbook not working after I upgraded the chef client to

chef-client -v
Chef: 13.0.113
Cookbook Trace:
    ---------------
    /var/chef/cache/cookbooks/artifact/providers/file.rb:48:in `load_current_resource'

    Resource Declaration:
    ---------------------
    # In /var/chef/cache/cookbooks/testsite/recipes/default.rb

     22: artifact_file  "/opt/#{node['home']['projectname']}.zip" do
     23:   location  "http://www.free-css.com/assets/files/free-css-templates/download/page211/lacegant.zip"
     24:   owner "root"
     25:   group "root"
     26:   action :create
     27: end
     28:

    Compiled Resource:
    ------------------
    # Declared in /var/chef/cache/cookbooks/testsite/recipes/default.rb:22:in `from_file'

    artifact_file("/opt/lacegant.zip") do
      action [:create]
      default_guard_interpreter :default
      declared_type :artifact_file
      cookbook_name "testsite"
      recipe_name "default"
      location "http://www.free-css.com/assets/files/free-css-templates/download/page211/lacegant.zip"
      owner "root"
      group "root"
      path "/opt/lacegant.zip"
    end

    System Info:
    ------------
    chef_version=13.0.113
    platform=centos
    platform_version=7.3.1611
    ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
    program_name=chef-client worker: ppid=59841;start=10:10:39;
    executable=/opt/chef/bin/chef-client

Chef Server is 12.x

Regards,

@athreyavc1
Copy link
Author

Changed artifact/providers/file.rb line 48 to

# @current_resource = Chef::Resource::ArtifactFile.new(@new_resource.name)
  @current_resource = Chef::Resource.resource_for_node(:artifact_file, node)
  @current_resource

Working now.

@hamitron
Copy link

Would be nice if this change was pushed.

@hamitron
Copy link

hamitron commented Apr 29, 2019

I was able to resolve this issue by using the built in remote_file resource, and I've heard the Ark Cookbook is useful as well

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

2 participants