9

我正在运行一个我以前使用过无数次的食谱,当我用厨师 + 刀启动一个新的 EC2 实例时,我遇到了这些错误。

[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

我不知道发生了什么,moneta 是什么,或者为什么它不能从该模板构建。模板templates/default/authorized_keys.erb如预期的那样。

4

1 回答 1

10

这是最近升级的“moneta”宝石。幸运的是,有一个简单的修复(回滚!),除非您在该 gem 中使用新功能。执行以下操作:

gem install moneta --version=0.6.0
gem uninstall moneta
...然后卸载所有版本的 moneta >= 0.7.0

参考厨师票

于 2013-02-02T03:51:38.487 回答