vagrantchef-infrachef-recipe

Chef never successfully completed


Mac OS X 10.14.5 (Mojave)

VirtualBox 6.0.10 r132072

Vagrant 2.2.5

Vagrant Box 'bento/ubuntu-16.04' version '201906.18.0'

This just started happening, I reinstalled VirtualBox and Vagrant, updated the Vagrant Box, but to no avail:

    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.

I haven't updated any recipes in quite some time nor have I updated Vagrant or VirtualBox until today. Any insight is much appreciated!


Solution

  • there is a line in your output that hints what is wrong

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

    there are 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

    when you issue it, accepted licenses files will be generated

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