Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chef: cannot load such file -- moneta/basic_file

I am running a recipe which I have used a bazillion times before, and im getting these errors when I spin up a new EC2 instance with chef + knife.

[2013-01-30T23:44:48+00:00] INFO: Processing user[dan] action create (/var/chef/cache/cookbooks/users/providers/manage.rb line 65)

 [2013-01-30T23:44:48+00:00] INFO: user[dan] created

 [2013-01-30T23:44:48+00:00] INFO: Processing directory[/home/dan/.ssh] action create (/var/chef/cache/cookbooks/users/providers/manage.rb line 81)

 [2013-01-30T23:44:48+00:00] INFO: directory[/home/dan/.ssh] created directory /home/dan/.ssh

 [2013-01-30T23:44:48+00:00] INFO: directory[/home/dan/.ssh] owner changed to 2003

 [2013-01-30T23:44:48+00:00] INFO: directory[/home/dan/.ssh] group changed to 2003

 [2013-01-30T23:44:48+00:00] INFO: directory[/home/dan/.ssh] mode changed to 700

 [2013-01-30T23:44:48+00:00] INFO: Processing template[/home/dan/.ssh/authorized_keys] action create (/var/chef/cache/cookbooks/users/providers/manage.rb line 88)

 [2013-01-30T23:44:48+00:00] FATAL: Could not load Moneta back end "BasicFile"


 ================================================================================

 Error executing action `create` on resource 'template[/home/dan/.ssh/authorized_keys]'

 ================================================================================


 LoadError

 ---------

 cannot load such file -- moneta/basic_file


 Resource Declaration:

 ---------------------

 # In /var/chef/cache/cookbooks/users/providers/manage.rb


  88:         template "#{home_dir}/.ssh/authorized_keys" do

  89:           source "authorized_keys.erb"

  90:           cookbook new_resource.cookbook

  91:           owner u['id']

  92:           group u['gid'] || u['id']

  93:           mode "0600"

  94:           variables :ssh_keys => u['ssh_keys']

  95:         end

  96:       end


 Compiled Resource:

 ------------------

 # Declared in /var/chef/cache/cookbooks/users/providers/manage.rb:88:in `block (2 levels) in class_from_file'


 template("/home/dan/.ssh/authorized_keys") do

   provider Chef::Provider::Template

   action "create"

   retries 0

   retry_delay 2

   path "/home/dan/.ssh/authorized_keys"

   backup 5

   source "authorized_keys.erb"

   cookbook "users"

   variables {:ssh_keys=>"ssh-rsa <REPLACED BECAUSE SHUTUP>!"}

   cookbook_name "users"

   mode "0600"

   owner "dan"

   group "dan"

 end


 [2013-01-30T23:44:48+00:00] ERROR: Running exception handlers

 [2013-01-30T23:44:48+00:00] FATAL: Saving node information to /var/chef/cache/failed-run-data.json

 [2013-01-30T23:44:48+00:00] ERROR: Exception handlers complete

 [2013-01-30T23:44:48+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out

 [2013-01-30T23:44:48+00:00] FATAL: LoadError: template[/home/dan/.ssh/authorized_keys] (/var/chef/cache/cookbooks/users/providers/manage.rb line 88) had an error: LoadError: cannot load such file -- moneta/basic_file

I have no idea what is going on, what moneta is, or why it cannot build from that template. The template is in templates/default/authorized_keys.erb as expected.

like image 621
Phil Sturgeon Avatar asked Jan 30 '13 23:01

Phil Sturgeon


1 Answers

It's the "moneta" gem, which was recently upgraded. Luckily, there is a simple fix (roll it back!), unless you are using new functionality inside that gem. Perform the following:

gem install moneta --version=0.6.0
gem uninstall moneta
... and then uninstall all versions of moneta >= 0.7.0

Reference chef ticket

like image 191
cixelsyd Avatar answered Nov 04 '22 03:11

cixelsyd