Vagrant up 不会加载 chef 配置,也不会保留错误日志

Vagrant up 不会加载 chef 配置,也不会保留错误日志

我正在尝试设置一个 vagrant box,但遇到了各种麻烦。现在我收到一条奇怪的错误消息,其中指出有一个包含更多信息的堆栈跟踪文件,但该文件无处可寻。

这是错误:

stdin: is not a tty
[Sun, 16 Sep 2012 18:31:47 +0000] INFO: *** Chef 0.10.0 ***
[Sun, 16 Sep 2012 18:31:48 +0000] INFO: Setting the run_list to ["recipe[apt]", "recipe[openssl]", "recipe[apache2]", "recipe[mysql]", "recipe[mysql::server]", "recipe[php]", "recipe[php::module_apc]", "recipe[php::module_curl]", "recipe[php::module_mysql]", "recipe[apache2::mod_php5]", "recipe[apache2::mod_rewrite]"] from JSON
[Sun, 16 Sep 2012 18:31:48 +0000] INFO: Run List is [recipe[apt], recipe[openssl], recipe[apache2], recipe[mysql], recipe[mysql::server], recipe[php], recipe[php::module_apc], recipe[php::module_curl], recipe[php::module_mysql], recipe[apache2::mod_php5], recipe[apache2::mod_rewrite]]
[Sun, 16 Sep 2012 18:31:48 +0000] INFO: Run List expands to [apt, openssl, apache2, mysql, mysql::server, php, php::module_apc, php::module_curl, php::module_mysql, apache2::mod_php5, apache2::mod_rewrite]
[Sun, 16 Sep 2012 18:31:48 +0000] INFO: Starting Chef Run for natty.talifun.com
[Sun, 16 Sep 2012 18:31:48 +0000] ERROR: Running exception handlers
[Sun, 16 Sep 2012 18:31:48 +0000] ERROR: Exception handlers complete
[Sun, 16 Sep 2012 18:31:48 +0000] FATAL: Stacktrace dumped to /tmp/vagrant-chef-1/chef-stacktrace.out
[Sun, 16 Sep 2012 18:31:48 +0000] FATAL: NameError: wrong constant name Chef-symfony2Console
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.

这就是我的 vagrantfile 的样子:

Vagrant::Config.run do |config|
  config.vm.box = "ubuntu-1104-server-i386"

  config.vm.network :hostonly, "33.33.33.33"

  config.vm.forward_port 80, 8000

  config.vm.share_folder "symfony.tests", "/var/www/symfony.tests", "data", :nfs => true

  config.vm.provision :chef_solo do |chef|
    chef.cookbooks_path = ["../my-recipes/cookbooks", "site-cookbooks"]
    chef.add_recipe "apt"
    chef.add_recipe "openssl"
    chef.add_recipe "apache2"
    chef.add_recipe "mysql"
    chef.add_recipe "mysql::server"
    chef.add_recipe "php"
    chef.add_recipe "php::module_apc"
    chef.add_recipe "php::module_curl"
    chef.add_recipe "php::module_mysql"
    chef.add_recipe "apache2::mod_php5"
    chef.add_recipe "apache2::mod_rewrite"
    chef.add_recipe "Symfony"
    chef.json = {
        :mysql => {
            :server_root_password => 'root',
            :bind_address => '127.0.0.1'
        }
    }
  end
end

答案1

这似乎是“Symfony”配方的问题

您找不到堆栈跟踪,因为该文件位于虚拟机上而不是主机上,要查看堆栈跟踪,您可以执行以下操作:

$ vagrant ssh
vagrant@yourvm:~$ tail -n 50 /tmp/vagrant-chef-1/chef-stacktrace.out

然后

vagrant@yourvm:~$ exit

返回到主机 shell

相关内容