厨师从未成功完成

Chef never successfully completed

Mac OS X 10.14.5(莫哈韦沙漠)

VirtualBox 6.0.10 r132072

流浪汉 2.2.5

Vagrant Box 'bento/ubuntu-16.04' 版本 '201906.18.0'

这才开始发生,我重新安装了 VirtualBox 和 Vagrant,更新了 Vagrant Box,但无济于事:

    webdevMacMini-3:workspace Production2$ vagrant reload
==> default: [vagrant-hostsupdater] Removing hosts
==> default: Loading Berkshelf datafile...
==> default: Sharing cookbooks with VM
==> default: Attempting graceful shutdown of VM...
==> default: Checking if box 'bento/ubuntu-16.04' version '201906.18.0' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Updating Vagrant's Berkshelf...
==> default: Resolving cookbook dependencies...
==> default: Fetching 'fsm-opsworks' from source at .
==> default: Using fsm-opsworks (0.1.0) from source at .
==> default: Using mysql (7.2.0)
==> default: Using rbac (1.0.3)
==> default: Using s3_file (2.8.5)
==> default: Using smf (2.2.8)
==> default: Using tar (0.7.0)
==> default: Using yum-mysql-community (4.0.1)
==> default: Vendoring fsm-opsworks (0.1.0) to /Users/Production2/.berkshelf/vagrant-berkshelf/shelves/berkshelf20190815-3252-j0pts7-default/fsm-opsworks
==> default: Vendoring mysql (7.2.0) to /Users/Production2/.berkshelf/vagrant-berkshelf/shelves/berkshelf20190815-3252-j0pts7-default/mysql
==> default: Vendoring rbac (1.0.3) to /Users/Production2/.berkshelf/vagrant-berkshelf/shelves/berkshelf20190815-3252-j0pts7-default/rbac
==> default: Vendoring s3_file (2.8.5) to /Users/Production2/.berkshelf/vagrant-berkshelf/shelves/berkshelf20190815-3252-j0pts7-default/s3_file
==> default: Vendoring smf (2.2.8) to /Users/Production2/.berkshelf/vagrant-berkshelf/shelves/berkshelf20190815-3252-j0pts7-default/smf
==> default: Vendoring tar (0.7.0) to /Users/Production2/.berkshelf/vagrant-berkshelf/shelves/berkshelf20190815-3252-j0pts7-default/tar
==> default: Vendoring yum-mysql-community (4.0.1) to /Users/Production2/.berkshelf/vagrant-berkshelf/shelves/berkshelf20190815-3252-j0pts7-default/yum-mysql-community
==> default: Using hostname "fsm-wp.env" as node name for Chef...
==> default: Using hostname "fsm-wp.env" as node name for Chef...
==> default: Fixed port collision for 80 => 80. Now on port 2200.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 80 (guest) => 2200 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: [vagrant-hostsupdater] Checking for host entries
==> default: [vagrant-hostsupdater] Writing the following entries to (/etc/hosts)
==> default: [vagrant-hostsupdater]   192.168.3.10  fsm-wp.env  # VAGRANT: 9c8c403ffecf0fd26e3d42e783a1c8b6 (default) / c43ab3ef-8862-4c71-80ed-63ee74e1f87c
==> default: [vagrant-hostsupdater] This operation requires administrative access. You may skip it by manually adding equivalent entries to the hosts file.
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Exporting NFS shared folders...
==> default: Preparing to edit /etc/exports. Administrator privileges will be required...
==> default: Mounting NFS shared folders...
==> default: Mounting shared folders...
default: /tmp/vagrant-chef/f2698dd34370bffc552811ad1ca73223/nodes => /Users/Production2/Projects/fsm-wordpress/env
default: /tmp/vagrant-chef/1501064198d92cc9d39ef0e3346b2f11/cookbooks => /Users/Production2/.berkshelf/vagrant-berkshelf/shelves/berkshelf20190815-3252-j0pts7-default
default: /tmp/vagrant-chef/b1edb4edf9fc67ca95b5d1baa3f4b0e9/cookbooks => /Users/Production2/Projects/fsm-wordpress/env/cookbooks
default: /tmp/vagrant-chef/f12914f42c32d7648a3031384102f521/data_bags => /Users/Production2/Projects/fsm-wordpress/env/data_bags
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.
==> default: Running provisioner: chef_solo...
==> default: Detected Chef (latest) is already installed
==> default: Generating chef JSON and uploading...
==> default: Running chef-solo...
==> default: Chef Infra Client cannot execute without accepting the license
Chef never successfully completed! Any errors should be visible in the 
output above. Please fix your recipes so that they properly complete.

我已经有一段时间没有更新任何食谱了,直到今天我也没有更新 Vagrant 或 VirtualBox。非常感谢任何见解!

您的输出中有一行提示出了什么问题

==> default: Chef Infra Client cannot execute without accepting the license

several ways to accept the license

  1. users can specify chef_license 'accept' in their Chef Infra Client and Chef Infra Server config. On a workstation, this can be specified in ~/.chef/config.rb or ~/.chef/knife.rb, and on a node, it can be specified in /etc/chef/client.rb.

  2. When invoking the chef command line tool and accepting the license, users are required to accept the license for all the embedded products as well. The same license applies to all products, but each product must have its own license acceptance. chef <command> --chef-license accept will accept the license for Chef Workstation, Chef Infra Client, Chef InSpec, and Push Jobs Client. For example, chef env –chef-license accept

颁发时,将生成接受的许可证文件

$ ls -x1 ~/.chef/accepted_licenses/
chef_infra_client
chef_workstation
inspec

我的解决方案是添加

chef.arguments = "--chef-license accept"

结束

config.vm.provision "chef_solo" do |chef|

在我的 Vagrantgile 中阻止,如下所述:https://docs.chef.io/chef_license_accept.html#vagrant。感谢@mr 为我指明了正确的方向!

您可以使用以下命令来接受厨师执照

chef-client --chef-license accept  > /dev/null