简体   繁体   English

Vagrant Provision无法安装Ruby Gem Chef-vault

[英]Vagrant Provision fails at installing Ruby Gem chef-vault

As the new intern, I'm supposed to get one of our applications running on my local machine (OS X). 作为新的实习生,我应该在本地计算机(OS X)上运行我们的一个应用程序。 It's a large set of files to run the application and it uses frameworks that I am not familiar with such as vagrant and chef. 它是运行该应用程序的大量文件,并且使用了我不熟悉的框架,例如流浪汉和厨师。

I was told that it should be as easy as cloning the repo, running vagrant up , and viewing the page in my browser but I've encountered a few problems. 有人告诉我,这应该和克隆仓库,运行vagrant up并在浏览器中查看页面一样简单,但是遇到了一些问题。 Now, when I go into the directory and run vagrant up it shows a few questionable things: 现在,当我进入目录并运行vagrant up它显示了一些可疑的事情:

    Admins-MacBook-Pro:db_archive_chef ahayden$ VAGRANT_LOG=info vagrant up
     INFO global: Vagrant version: 2.1.2
     INFO global: Ruby version: 2.4.4
     INFO global: RubyGems version: 2.6.14.1
     INFO global: VAGRANT_LOG="info"
     INFO global: VAGRANT_INSTALLER_VERSION="2"
     INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/embedded"
     INFO global: VAGRANT_INSTALLER_ENV="1"
     INFO global: VAGRANT_EXECUTABLE="/opt/vagrant/embedded/gems/2.1.2/gems/vagrant-2.1.2/bin/vagrant"
     WARN global: resolv replacement has not been enabled!
     INFO global: Plugins:
     INFO global:   - vagrant-berkshelf = [installed: 5.1.2 constraint: > 0]
     INFO global:   - virtualbox = [installed: 0.8.6 constraint: > 0]
     INFO global: Loading plugins!
     INFO global: Loading plugin `vagrant-berkshelf` with default require: `vagrant-berkshelf`
     INFO root: Version requirements from Vagrantfile: [">= 1.5"]
     INFO root:   - Version requirements satisfied!
     INFO manager: Registered plugin: berkshelf
     INFO global: Loading plugin `virtualbox` with default require: `virtualbox`
    /Users/ahayden/.vagrant.d/gems/2.4.4/gems/virtualbox-0.8.6/lib/virtualbox/com/ffi/util.rb:93: warning: key "io" is duplicated and overwritten on line 107
     INFO vagrant: `vagrant` invoked: ["up"]
     INFO environment: Environment initialized (#<Vagrant::Environment:0x00000001040deee0>)
     INFO environment:   - cwd: /Users/ahayden/Development/LSS/db_archive_chef
     INFO environment: Home path: /Users/ahayden/.vagrant.d
     INFO environment: Local data path: /Users/ahayden/Development/LSS/db_archive_chef/.vagrant
     INFO environment: Running hook: environment_plugins_loaded
     INFO runner: Preparing hooks for middleware sequence...
     INFO runner: 1 hooks defined.
     INFO root: Version requirements from Vagrantfile: [">= 1.5.0"]
     INFO root:   - Version requirements satisfied!
     INFO loader: Loading configuration in order: [:home, :root]
     INFO command: Active machine found with name default. Using provider: virtualbox
     INFO environment: Getting machine: default (virtualbox)
     INFO environment: Uncached load of machine.
     INFO base: VBoxManage path: VBoxManage
     INFO subprocess: Starting process: ["/usr/local/bin/VBoxManage", "--version"]
     INFO subprocess: Command not in installer, restoring original environment...
     INFO meta: Using VirtualBox driver: VagrantPlugins::ProviderVirtualBox::Driver::Version_5_2
     INFO base: VBoxManage path: VBoxManage
     INFO loader: Set "2174531280_machine_default" = []
     INFO loader: Loading configuration in order: [:home, :root, "2174531280_machine_default"]
     INFO box_collection: Box found: bento/ubuntu-14.04 (virtualbox)
     INFO environment: Running hook: authenticate_box_url
     INFO host: Autodetecting host type for [#<Vagrant::Environment: /Users/ahayden/Development/LSS/db_archive_chef>]
     INFO host: Detected: darwin!
     INFO runner: Preparing hooks for middleware sequence...
     INFO runner: 2 hooks defined.
     INFO runner: Running action: authenticate_box_url #<Vagrant::Action::Builder:0x00000001030ab348>
     INFO loader: Loading configuration in order: [:"2175328800_bento/ubuntu-14.04_virtualbox", :home, :root, "2174531280_machine_default"]
     INFO machine: Initializing machine: default
     INFO machine:   - Provider: VagrantPlugins::ProviderVirtualBox::Provider
     INFO machine:   - Box: #<Vagrant::Box:0x00000001034acc08>
     INFO machine:   - Data dir: /Users/ahayden/Development/LSS/db_archive_chef/.vagrant/machines/default/virtualbox
     INFO base: VBoxManage path: VBoxManage
     INFO meta: Using VirtualBox driver: VagrantPlugins::ProviderVirtualBox::Driver::Version_5_2
     INFO base: VBoxManage path: VBoxManage
     INFO subprocess: Starting process: ["/usr/local/bin/VBoxManage", "showvminfo", "92b0cc90-127e-4e19-8c75-73b5bf0b5506"]
     INFO subprocess: Command not in installer, restoring original environment...
     INFO machine: New machine ID: nil
     INFO base: VBoxManage path: VBoxManage
    ERROR loader: Unknown config sources: [:"2175328800_bento/ubuntu-14.04_virtualbox"]
     INFO base: VBoxManage path: VBoxManage
     INFO meta: Using VirtualBox driver: VagrantPlugins::ProviderVirtualBox::Driver::Version_5_2
     INFO base: VBoxManage path: VBoxManage
     INFO environment: Getting machine: default (virtualbox)
     INFO environment: Returning cached machine: default (virtualbox)
     INFO command: With machine: default (#
     INFO interface: info: Bringing machine 'default' up with 'virtualbox' provider...
    Bringing machine 'default' up with 'virtualbox' provider...
     INFO batch_action: Enabling parallelization by default.
     INFO batch_action: Disabling parallelization because provider doesn't support it: virtualbox
     INFO batch_action: Batch action will parallelize: false
     INFO batch_action: Starting action: #<Vagrant::Machine:0x0000000100a51238> up {:destroy_on_error=>true, :install_provider=>false, :parallel=>true, :provision_ignore_sentinel=>false, :provision_types=>nil}
     INFO machine: Calling action: up on provider VirtualBox (new VM)
     INFO environment: Acquired process lock: dotlock
     INFO environment: Released process lock: dotlock
     INFO environment: Acquired process lock: machine-action-1c8a0b7102d23451e5804c5357d8a327
     INFO base: VBoxManage path: VBoxManage
     INFO subprocess: Starting process: ["/usr/local/bin/VBoxManage", "list", "hostonlyifs"]
     INFO subprocess: Command not in installer, restoring original environment...
<Proc:0x000000010157ff60@/opt/vagrant/embedded/gems/2.1.2/gems/vagrant-2.1.2/lib/vagrant/action/warden.rb:94 (lambda)>
     INFO warden: Calling IN action: #<Vagrant::Action::Builtin::HandleBox:0x00000001015fc448>
     INFO handle_box: Machine already has box. HandleBox will not run.
     INFO warden: Calling IN action: #<VagrantPlugins::Berkshelf::Action::Check:0x000000010135cee0>
     INFO subprocess: Starting process: ["/usr/local/bin/berks", "--version", "--format", "json"]
     INFO subprocess: Command not in installer, restoring original environment...
        default: The Berkshelf shelf is at "/Users/ahayden/.berkshelf/vagrant-berkshelf/shelves/berkshelf20180730-4484-1fezzea-default"
     INFO prepare_clone: no clone master, not preparing clone snapshot
     INFO warden: Calling IN action: #<VagrantPlugins::ProviderVirtualBox::Action::Import:0x0000000100a5add8>
     INFO interface: info: Importing base box 'bento/ubuntu-14.04'...
     INFO interface: info: ==> default: Importing base box 'bento/ubuntu-14.04'...
    ==> default: Importing base box 'bento/ubuntu-14.04'...
     INFO interface: info: Progress: 90%
    Progress: 90%
    ==> default: Checking if box 'bento/ubuntu-14.04' is up to date...
     INFO downloader: Downloader starting download: 
     INFO downloader:   -- Source: https://vagrantcloud.com/bento/ubuntu-14.04
     INFO downloader:   -- Destination: /var/folders/gf/skrz9ljj2z3b3vm947tt5r680000gp/T/vagrant-load-metadata20180730-4484-lo2vxi
     INFO subprocess: Starting process: ["/opt/vagrant/embedded/bin/curl", "-q", "--fail", "--location", "--max-redirs", "10", "--verbose", "--user-agent", "Vagrant/2.1.2 (+https://www.vagrantup.com; ruby2.4.4)", "-H", "Accept: application/json", "--output", "/var/folders/gf/skrz9ljj2z3b3vm947tt5r680000gp/T/vagrant-load-metadata20180730-4484-lo2vxi", "https://vagrantcloud.com/bento/ubuntu-14.04"]
     INFO subprocess: Command in the installer. Specifying DYLD_LIBRARY_PATH...
    ==> default: Updating Vagrant's Berkshelf...
     INFO subprocess: Starting process: ["/usr/local/bin/berks", "vendor", "/Users/ahayden/.berkshelf/vagrant-berkshelf/shelves/berkshelf20180730-4484-1fezzea-default", "--berksfile", "/Users/ahayden/Development/LSS/db_archive_chef/Berksfile"]
     INFO subprocess: Command not in installer, restoring original environment...
     INFO interface: output: Resolving cookbook dependencies...
    Fetching 'db_archive' from source at .
    Using chef-vault (3.1.0)
    Using db_archive (0.3.14) from source at .
    Using hostsfile (3.0.1)
     INFO interface: output: ==> default: Resolving cookbook dependencies...
    ==> default: Fetching 'db_archive' from source at .
    ==> default: Using chef-vault (3.1.0)
    ==> default: Using db_archive (0.3.14) from source at .
    ==> default: Using hostsfile (3.0.1)
    ==> default: Vendoring chef-vault (3.1.0) to /Users/ahayden/.berkshelf/vagrant-berkshelf/shelves/berkshelf20180730-4484-1fezzea-default/chef-vault
    ==> default: Vendoring db_archive (0.3.14) to /Users/ahayden/.berkshelf/vagrant-berkshelf/shelves/berkshelf20180730-4484-1fezzea-default/db_archive
    ==> default: Vendoring hostsfile (3.0.1) to /Users/ahayden/.berkshelf/vagrant-berkshelf/shelves/berkshelf20180730-4484-1fezzea-default/hostsfile
     INFO warden: Calling IN action: #<VagrantPlugins::Berkshelf::Action::Upload:0x000000010171f3e8>
     INFO upload: Provisioner does need to upload
     INFO warden: Calling IN action: #<Vagrant::Action::Builtin::Provision:0x00000001016de3c0>
     INFO provision: Checking provisioner sentinel file...
     INFO interface: warn: The cookbook path '/Users/ahayden/Development/LSS/db_archive_chef/cookbooks' doesn't exist. Ignoring...
    ==> default: Clearing any previously set network interfaces...
     INFO network: Searching for matching hostonly network: 172.28.128.1
     INFO subprocess: Starting process: ["/usr/local/bin/VBoxManage", "list", "hostonlyifs"]
     INFO subprocess: Command not in installer, restoring original environment...
     INFO interface: info: ==> default: Booting VM...
    ==> default: Waiting for machine to boot. This may take a few minutes...
     INFO subprocess: Starting process: ["/usr/local/bin/VBoxManage", "showvminfo", "560c0ba3-253c-478d-8cc9-97d8c2fbb1da", "--machinereadable"]
     INFO subprocess: Command not in installer, restoring original environment...
     INFO interface: detail: SSH address: 127.0.0.1:2222
     INFO interface: detail:     default: SSH address: 127.0.0.1:2222
        default: SSH address: 127.0.0.1:2222
     INFO ssh: Attempting SSH connection...
     INFO ssh: Attempting to connect to SSH...
     INFO ssh:   - Host: 127.0.0.1
     INFO ssh:   - Port: 2222
     INFO ssh:   - Username: vagrant
     INFO ssh:   - Password? false
     INFO ssh:   - Key Path: ["/Users/ahayden/.vagrant.d/insecure_private_key"]
     INFO ssh: SSH not ready: #<Vagrant::Errors::NetSSHException: An error occurred in the underlying SSH library that Vagrant uses.
    The error message is shown below. In many cases, errors from this
    library are caused by ssh-agent issues. Try disabling your SSH
    agent or removing some keys and try again.

    If the problem persists, please report a bug to the net-ssh project.

    timeout during server version negotiating>
     INFO subprocess: Starting process: ["/usr/local/bin/VBoxManage", "showvminfo", "560c0ba3-253c-478d-8cc9-97d8c2fbb1da", "--machinereadable"]
     INFO subprocess: Command not in installer, restoring original environment...
["/Users/ahayden/.vagrant.d/insecure_private_key"]
     INFO ssh: SSH is ready!
     INFO ssh: Execute:  (sudo=false)
     INFO subprocess: Starting process: ["/usr/local/bin/VBoxManage", "showvminfo", "560c0ba3-253c-478d-8cc9-97d8c2fbb1da", "--machinereadable"]
     INFO subprocess: Command not in installer, restoring original environment...
     INFO guest: Autodetecting host type for [#<Vagrant::Machine: default (VagrantPlugins::ProviderVirtualBox::Provider)>]
     INFO ssh: Execute: if test -r /etc/os-release; then
    source /etc/os-release && test 'xLinux Mint' = "x$ID" && exit
    fi
    if test -x /usr/bin/lsb_release; then
    /usr/bin/lsb_release -i 2>/dev/null | grep -qi 'Linux Mint' && exit
    fi
    if test -r /etc/issue; then
    cat /etc/issue | grep -qi 'Linux Mint' && exit
    fi
    exit 1
     (sudo=false)
     INFO ssh: Execute: grep 'ostree=' /proc/cmdline (sudo=false)
     INFO ssh: Execute: [ -x /usr/bin/lsb_release ] && /usr/bin/lsb_release -i 2>/dev/null | grep Trisquel (sudo=false)
     INFO ssh: Execute: if test -r /etc/os-release; then
    source /etc/os-release && test 'xelementary' = "x$ID" && exit
    fi
    if test -x /usr/bin/lsb_release; then
    /usr/bin/lsb_release -i 2>/dev/null | grep -qi 'elementary' && exit
    fi
    if test -r /etc/issue; then
    cat /etc/issue | grep -qi 'elementary' && exit
    fi
    exit 1
     (sudo=false)
     INFO ssh: Execute: uname -s | grep -i 'DragonFly' (sudo=false)
     INFO ssh: Execute: cat /etc/pld-release (sudo=false)
     INFO ssh: Execute: grep 'Amazon Linux' /etc/os-release (sudo=false)
     INFO ssh: Execute: grep 'Fedora release' /etc/redhat-release (sudo=false)
     INFO ssh: Execute: if test -r /etc/os-release; then
    source /etc/os-release && test 'xkali' = "x$ID" && exit
    fi
    if test -x /usr/bin/lsb_release; then
    /usr/bin/lsb_release -i 2>/dev/null | grep -qi 'kali' && exit
    fi
    if test -r /etc/issue; then
    cat /etc/issue | grep -qi 'kali' && exit
    fi
    exit 1
     (sudo=false)
     INFO ssh: Execute: grep Funtoo /etc/gentoo-release (sudo=false)
     INFO ssh: Execute: if test -r /etc/os-release; then
    source /etc/os-release && test 'xubuntu' = "x$ID" && exit
    fi
    if test -x /usr/bin/lsb_release; then
    /usr/bin/lsb_release -i 2>/dev/null | grep -qi 'ubuntu' && exit
    fi
    if test -r /etc/issue; then
    cat /etc/issue | grep -qi 'ubuntu' && exit
    fi
    exit 1
     (sudo=false)
     INFO guest: Detected: ubuntu!
     INFO ssh: SSH is ready!
     INFO ssh: Execute:  (sudo=false)
     INFO ssh: Inserting key to avoid password: ssh-rsa AAAA/ vagrant
     INFO interface: detail: 
    Inserting generated public key within guest...
     INFO interface: detail:     default: 
        default: Inserting generated public key within guest...
        default: 
        default: Inserting generated public key within guest...
     INFO ssh: SSH is ready!
     INFO ssh: Execute:  (sudo=false)
     INFO guest: Execute capability: insert_public_key [#<Vagrant::Machine: default (VagrantPlugins::ProviderVirtualBox::Provider)>, "ssh-rsa AAAA/ vagrant"] (ubuntu)
     INFO ssh: Execute: mkdir -p ~/.ssh
    chmod 0700 ~/.ssh
    cat '/tmp/vagrant-insert-pubkey-1532971970' >> ~/.ssh/authorized_keys && chmod 0600 ~/.ssh/authorized_keys
    result=$?
    rm -f '/tmp/vagrant-insert-pubkey-1532971970'
    exit $result
     (sudo=false)
     INFO host: Execute capability: set_ssh_key_permissions [#<Vagrant::Environment: /Users/ahayden/Development/LSS/db_archive_chef>, #<Pathname:/Users/ahayden/Development/LSS/db_archive_chef/.vagrant/machines/default/virtualbox/private_key>] (darwin)
     INFO interface: detail: Removing insecure key from the guest if it's present...
     INFO ssh: Execute: if test -f ~/.ssh/authorized_keys; then
                  grep -v -x -f '/tmp/vagrant-remove-pubkey-1532971970' ~/.ssh/authorized_keys > ~/.ssh/authorized_keys.tmp
                  mv ~/.ssh/authorized_keys.tmp ~/.ssh/authorized_keys && chmod 0600 ~/.ssh/authorized_keys
                  result=$?
                fi
                rm -f '/tmp/vagrant-remove-pubkey-1532971970'
                exit $result
     (sudo=false)
     INFO interface: detail: Key inserted! Disconnecting and reconnecting using new SSH key...
     INFO subprocess: Starting process: ["/usr/local/bin/VBoxManage", "showvminfo", "560c0ba3-253c-478d-8cc9-97d8c2fbb1da", "--machinereadable"]
     INFO subprocess: Command not in installer, restoring original environment...
     INFO ssh: SSH is ready!
     INFO ssh: Execute:  (sudo=false)
     INFO interface: output: Machine booted and ready!
     INFO warden: Calling OUT action: #<VagrantPlugins::ProviderVirtualBox::Action::SaneDefaults:0x00000001014560a8>
     INFO interface: info: Setting hostname..
     INFO ssh: SSH is ready!
     INFO ssh: Execute:  (sudo=false)
     INFO guest: Execute capability: change_host_name [#<Vagrant::Machine: default (VagrantPlugins::ProviderVirtualBox::Provider)>, "db-archive"] (ubuntu)
     INFO ssh: Execute: hostname -f | grep '^db-archive$' (sudo=false)
     INFO ssh: Execute: # Set the hostname
    echo 'db-archive' > /etc/hostname
    hostname -F /etc/hostname

    if command -v hostnamectl; then
      hostnamectl set-hostname 'db-archive'
    fi

    # Prepend ourselves to /etc/hosts
    grep -w 'db-archive' /etc/hosts || {
      if grep -w '^127\.0\.1\.1' /etc/hosts ; then
        sed -i'' 's/^127\.0\.1\.1\s.*$/127.0.1.1\tdb-archive\tdb-archive/' /etc/hosts
      else
        sed -i'' '1i 127.0.1.1\tdb-archive\tdb-archive' /etc/hosts
      fi
    }

    # Update mailname
    echo 'db-archive' > /etc/mailname

    # Restart hostname services
    if test -f /etc/init.d/hostname; then
      /etc/init.d/hostname start || true
    fi

    if test -f /etc/init.d/hostname.sh; then
      /etc/init.d/hostname.sh start || true
    fi
    if test -x /sbin/dhclient ; then
      /sbin/dhclient -r
      /sbin/dhclient -nw
    fi
     (sudo=true)
     INFO warden: Calling OUT action: #<Vagrant::Action::Builtin::SetHostname:0x00000001014560d0>
     INFO synced_folders: Invoking synced folder enable: virtualbox
     INFO subprocess: Starting process: ["/usr/local/bin/VBoxManage", "guestproperty", "get", "560c0ba3-253c-478d-8cc9-97d8c2fbb1da", "/VirtualBox/GuestInfo/OS/Product"]
     INFO subprocess: Command not in installer, restoring original environment...
     INFO interface: output: Mounting shared folders...
     INFO interface: detail: /vagrant => 
     INFO subprocess: Starting process: ["/usr/local/bin/VBoxManage", "showvminfo", "560c0ba3-253c-478d-8cc9-97d8c2fbb1da", "--machinereadable"]
     INFO subprocess: Command not in installer, restoring original environment...
     INFO ssh: SSH is ready!
     INFO ssh: Execute:  (sudo=false)
     INFO guest: Execute capability: mount_virtualbox_shared_folder [#<Vagrant::Machine: default (VagrantPlugins::ProviderVirtualBox::Provider)>, "vagrant", "/vagrant", {:guestpath=>"/vagrant", :hostpath=>"/Users/ahayden/Development/LSS/db_archive_chef", :disabled=>false, :__vagrantfile=>true, :owner=>"vagrant", :group=>"vagrant"}] (ubuntu)
      /sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=/vagrant
    fi
     (sudo=true)
     INFO ssh: Execute: id -u vagrant (sudo=false)
     INFO ssh: Execute: getent group vagrant (sudo=false)
     INFO ssh: Execute: mkdir -p /etc/chef (sudo=true)
     INFO ssh: Execute: mount -t vboxsf -o uid=1000,gid=1000 etc_chef /etc/chef (sudo=true)
     INFO ssh: Execute: chown 1000:1000 /etc/chef (sudo=true)
     INFO ssh: Execute: if command -v /sbin/init && /sbin/init 2>/dev/null --version | grep upstart; then
      /sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=/etc/chef
    fi
     (sudo=true)
     INFO provision: Writing provisioning sentinel so we don't provision again
     INFO interface: info: Running provisioner: chef_solo...
     INFO guest: Execute capability: chef_installed [#<Vagrant::Machine: default (VagrantPlugins::ProviderVirtualBox::Provider)>, "chef", :"12.10.24"] (ubuntu)
     INFO ssh: Execute: test -x /opt/chef/bin/knife&& /opt/chef/bin/knife --version | grep 'Chef: 12.10.24' (sudo=true)
     INFO interface: detail: Installing Chef (12.10.24)...
     INFO interface: detail:     default: Installing Chef (12.10.24)...
        default: Installing Chef (12.10.24)...
     INFO ssh: SSH is ready!
     INFO ssh: Execute:  (sudo=false)
     INFO guest: Execute capability: chef_install [#<Vagrant::Machine: default (VagrantPlugins::ProviderVirtualBox::Provider)>, "chef", :"12.10.24", "stable", "https://omnitruck.chef.io", {:product=>"chef", :channel=>"stable", :version=>:"12.10.24", :omnibus_url=>"https://omnitruck.chef.io", :force=>false, :download_path=>nil}] (ubuntu)
     INFO ssh: Execute: apt-get update -y -qq (sudo=true)
     INFO ssh: Execute: apt-get install -y -qq curl (sudo=true)
     INFO ssh: Execute: curl -sL https://omnitruck.chef.io/install.sh | bash -s -- -P "chef" -c "stable" -v "12.10.24" (sudo=true)
    ==> default: Running chef-solo...
    ==> default: [2018-07-30T17:33:12+00:00] INFO: Forking chef instance to converge...
     INFO interface: info: Starting Chef Client, version 12.10.24
    ==> default: [2018-07-30T17:33:12+00:00] INFO: *** Chef 12.10.24 ***
     INFO interface: info: [2018-07-30T17:33:12+00:00] INFO: Platform: x86_64-linux
     INFO interface: info: [2018-07-30T17:33:14+00:00] INFO: Setting the run_list to ["recipe[chef-vault]", "recipe[db_archive::update]", "recipe[db_archive::install_packages]", "recipe[db_archive::install_hostsfile]", "recipe[db_archive::install_nginx]"] from CLI options
    ==> default: [2018-07-30T17:33:14+00:00] INFO: Starting Chef Run for ahayden
     INFO interface: info: [2018-07-30T17:33:14+00:00] INFO: Running start handlers
     INFO interface: info: ==> default: [2018-07-30T17:33:14+00:00] INFO: Start handlers complete.
    ==> default: [2018-07-30T17:33:14+00:00] INFO: Start handlers complete.
     INFO interface: info: Installing Cookbook Gems:
     INFO interface: info: Running handlers:
    [2018-07-30T17:33:15+00:00] ERROR: Exception handlers complete
    Chef Client failed. 0 resources updated in 03 seconds
    [2018-07-30T17:33:15+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
    [2018-07-30T17:33:15+00:00] ERROR: Expected process to exit with [0], but received '5'
    ---- Begin output of bundle install ----
    STDOUT: Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
    installing your bundle as root will break this application for all non-root
    users on this machine.
    Fetching gem metadata from https://rubygems.org/..........
    Fetching version metadata from https://rubygems.org/..
    Resolving dependencies...
    Installing chef-vault 3.3.0

    Gem::InstallError: chef-vault requires Ruby version >= 2.2.0.
    Using bundler 1.11.2
    An error occurred while installing chef-vault (3.3.0), and Bundler cannot
    continue.
    Make sure that `gem install chef-vault -v '3.3.0'` succeeds before bundling.
    STDERR: 
Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
    ERROR warden: Error occurred: Chef never successfully completed! Any errors should be visible in the
    output above. Please fix your recipes so that they properly complete.
     INFO warden: Beginning recovery process...
     INFO warden: Recovery complete.
     INFO warden: Beginning recovery process...
     INFO warden: Recovery complete.
    ERROR warden: Error occurred: Chef never successfully completed! Any errors should be visible in the
    output above. Please fix your recipes so that they properly complete.
     INFO environment: Released process lock: machine-action-1c8a0b7102d23451e5804c5357d8a327
     INFO environment: Running hook: environment_unload
     INFO runner: Preparing hooks for middleware sequence...
     INFO runner: 1 hooks defined.
     INFO runner: Running action: environment_unload #<Vagrant::Action::Builder:0x0000000101164c50>
    ERROR vagrant: Vagrant experienced an error! Details:
    ERROR vagrant: #<VagrantPlugins::Chef::Provisioner::Base::ChefError: Chef never successfully completed! Any errors should be visible in the
    output above. Please fix your recipes so that they properly complete.>
    ERROR vagrant: Chef never successfully completed! Any errors should be visible in the
    output above. Please fix your recipes so that they properly complete.
    ERROR vagrant: /plugins/provisioners/chef/provisioner/chef_solo.rb:220:in `run_chef_solo'
    /plugins/provisioners/chef/provisioner/chef_solo.rb:65:in `provision'
    /lib/vagrant/action/builtin/provision.rb:138:in `run_provisioner'
   /lib/vagrant/action/warden.rb:95:in `call'
    /lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    /lib/vagrant/action/warden.rb:34:in `call'
    /lib/vagrant/action/builder.rb:116:in `call'
    /lib/vagrant/action/runner.rb:66:in `block in run'
    /lib/vagrant/util/busy.rb:19:in `busy'
    /lib/vagrant/action/runner.rb:66:in `run'
    /lib/vagrant/environment.rb:510:in `hook'
    /lib/vagrant/action/builtin/provision.rb:126:in `call'
    /lib/vagrant/action/builtin/provision.rb:126:in `block in call'
    /lib/vagrant/action/builtin/provision.rb:103:in `each'
   /lib/vagrant/action/builtin/provision.rb:103:in `call'
    /lib/vagrant/action/warden.rb:34:in `call'
    /lib/vagrant-berkshelf/action/upload.rb:23:in `call'
    /lib/vagrant/action/warden.rb:34:in `call'
    /lib/vagrant-berkshelf/action/install.rb:19:in `call'
    /lib/vagrant/action/warden.rb:34:in `call'
    /lib/vagrant-berkshelf/action/save.rb:21:in `call'
    /lib/vagrant/action/warden.rb:34:in `call'
    /plugins/providers/virtualbox/action/clear_forwarded_ports.rb:15:in `call'
    /opt/vagrant/embedded/gems/2.1.2/gems/vagrant-/machine.rb:194:in `call'
    /opt/vagrant/embedded/gems/2.1.2/gems/vagrant-/machine.rb:194:in `action
    /opt/vagrant/embedded/gems/2.1.2/gems/vagrant-/batch_action.rb:82:in `block (2 levels) in run'
     INFO interface: error: Chef never successfully completed! Any errors should be visible in the
    output above. Please fix your recipes so that they properly complete.

I had to omit some things from the backtrace in order to post it... 为了发布它,我不得不从回溯中省略一些东西。

  • The first sign is towards the top WARN global: resolv replacement has not been enabled! 第一个迹象指向WARN global: resolv replacement has not been enabled!最大的WARN global: resolv replacement has not been enabled!

  • The next area of concern util.rb:93: warning: key "io" is duplicated and overwritten on line 107 下一个关注的问题util.rb:93: warning: key "io" is duplicated and overwritten on line 107

  • Then there are many cases of: Starting process: ["/usr/local/bin/VBoxManage", "showvminfo", "92b0cc90-127e-4e19-8c75-73b5bf0b5506"] INFO subprocess: Command not in installer, restoring original environment... . 然后有很多情况: Starting process: ["/usr/local/bin/VBoxManage", "showvminfo", "92b0cc90-127e-4e19-8c75-73b5bf0b5506"] INFO subprocess: Command not in installer, restoring original environment... This happens very man times with VBoxManage and a couple other times with curl and berks. 这在VBoxManage上非常常见,而在curl和berk下则很少。 I think this is the problem. 我认为这是问题所在。

  • At the end, it seems to finally fail with a gem install error for chef-vault. 最后,它似乎最终因厨师库的gem安装错误而失败。 It says the gem requires Ruby version >2.2 which I do have. 它说这颗宝石需要我拥有的> 2.2的Ruby版本。

Vagrantfile: Vagrantfile:

VAGRANTFILE_API_VERSION = '2'

Vagrant.require_version '>= 1.5.0'

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

  config.vm.hostname = 'db-archive'

  if Vagrant.has_plugin?("vagrant-omnibus")
    config.omnibus.chef_version = 'latest'
  end

  config.vm.box = 'bento/ubuntu-14.04'
  config.vm.network :private_network, type: 'dhcp'
  config.vm.network 'forwarded_port', guest: 80, host: 8080
  config.vm.network 'forwarded_port', guest: 443, host: 8443
  config.vm.synced_folder "#{ENV['HOME']}/Documents/src/db_archive", '/var/www/db_archive'
  config.vm.synced_folder "#{ENV['HOME']}/.chef", '/etc/chef'
  config.berkshelf.enabled = true
  config.vm.provision :chef_solo do |chef|
    chef.channel = 'stable'
    chef.version = '12.10.24'
    chef.environment = 'vagrant'
    chef.environments_path = 'environments'
    chef.run_list = [
      "recipe[chef-vault]",
      "recipe[db_archive::update]",
      "recipe[db_archive::install_packages]",
      "recipe[db_archive::install_hostsfile]",
      "recipe[db_archive::install_nginx]"
    ]
    chef.data_bags_path = 'data_bags'
    chef.node_name = 'ahayden'
  end
end

You are using Chef 12, which is no longer supported by the latest chef-vault. 您正在使用Chef 12,而最新的Chef-Vault不再支持该厨师。 You'll need to upgrade your version of Chef. 您需要升级您的Chef版本。

In my metadata.rb file, I changed the line depends 'chef-vault' to depends 'chef-vault', '=2.1.1' . 在我的metadata.rb文件中,我将行depends 'chef-vault'更改为depends 'chef-vault', '=2.1.1' Then when I ran vagrant destroy && vagrant up it worked fine. 然后,当我运行vagrant destroy && vagrant up它运行良好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM