New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error installing Virtualbox #97

Closed
dougireton opened this Issue Feb 12, 2016 · 2 comments

Comments

Projects
None yet
1 participant
@dougireton
Contributor

dougireton commented Feb 12, 2016

Recipe: chefdk_bootstrap::virtualbox
  * homebrew_cask[virtualbox] action install
    * execute[installing cask virtualbox] action run
   ================================================================================
      Error executing action `run` on resource 'execute[installing cask virtualbox]'
      ================================================================================

      Mixlib::ShellOut::ShellCommandFailed
      ------------------------------------
      Expected process to exit with [0], but received '1'
      ---- Begin output of /usr/local/bin/brew cask install virtualbox  ----
      STDOUT: ==> Downloading http://download.virtualbox.org/virtualbox/5.0.14/VirtualBox-5.0.14-105127-OSX.dmg
      ==> Verifying checksum for Cask virtualbox
      ==> Running installer for virtualbox; your password may be necessary.
      ==> Package installers may write to any location; options such as --appdir are ignored.
      ==> sudo: no tty present and no askpass program specified
      STDERR: Error: Command failed to execute!

      ==> Failed command:
      ["/usr/bin/sudo", "-E", "--", "/usr/sbin/installer", "-pkg", "#<Pathname:/opt/homebrew-cask/Caskroom/virtualbox/5.0.14-105127/VirtualBox.pkg>", "-target", "/"]

      ==> Output of failed command:


      ==> Exit status of failed command:
      #<Process::Status: pid 11388 exit 1>
      ---- End output of /usr/local/bin/brew cask install virtualbox  ----
      Ran /usr/local/bin/brew cask install virtualbox  returned 1

      Resource Declaration:
      ---------------------
      # In /var/folders/0l/d20v6pzx1qlg9wmkszr_v9202dm83c/T/chefdk_bootstrap.GlbKsgqX/local-mode-cache/cache/cookbooks/homebrew/providers/cask.rb

       29:   execute "installing cask #{new_resource.name}" do
       30:     command "/usr/local/bin/brew cask install #{new_resource.name} #{new_resource.options}"
       31:     user homebrew_owner
       32:     environment lazy { { 'HOME' => ::Dir.home(homebrew_owner), 'USER' => homebrew_owner } }
       33:     not_if { new_resource.casked? }
       34:   end
       35: end

      Compiled Resource:
      ------------------
      # Declared in /var/folders/0l/d20v6pzx1qlg9wmkszr_v9202dm83c/T/chefdk_bootstrap.GlbKsgqX/local-mode-cache/cache/cookbooks/homebrew/providers/cask.rb:29:in `block in class_from_file'

      execute("installing cask virtualbox") do
        action [:run]
        retries 0
        retry_delay 2
        default_guard_interpreter :execute
        command "/usr/local/bin/brew cask install virtualbox "
        backup 5
        environment #<Chef::DelayedEvaluator:0x007fd6b1647a00@/var/folders/0l/d20v6pzx1qlg9wmkszr_v9202dm83c/T/chefdk_bootstrap.GlbKsgqX/local-mode-cache/cache/cookbooks/homebrew/providers/cask.rb:32>
        returns 0
        user "doug"
        declared_type :execute
        cookbook_name "chefdk_bootstrap"
        homebrew_owner "doug"
        not_if { #code block }
      end


    ================================================================================
    Error executing action `install` on resource 'homebrew_cask[virtualbox]'
    ================================================================================

    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    execute[installing cask virtualbox] (/var/folders/0l/d20v6pzx1qlg9wmkszr_v9202dm83c/T/chefdk_bootstrap.GlbKsgqX/local-mode-cache/cache/cookbooks/homebrew/providers/cask.rb line 29) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
    ---- Begin output of /usr/local/bin/brew cask install virtualbox  ----
    STDOUT: ==> Downloading http://download.virtualbox.org/virtualbox/5.0.14/VirtualBox-5.0.14-105127-OSX.dmg
    ==> Verifying checksum for Cask virtualbox
    ==> Running installer for virtualbox; your password may be necessary.
    ==> Package installers may write to any location; options such as --appdir are ignored.
    ==> sudo: no tty present and no askpass program specified
    STDERR: Error: Command failed to execute!

    ==> Failed command:
    ["/usr/bin/sudo", "-E", "--", "/usr/sbin/installer", "-pkg", "#<Pathname:/opt/homebrew-cask/Caskroom/virtualbox/5.0.14-105127/VirtualBox.pkg>", "-target", "/"]

    ==> Output of failed command:


    ==> Exit status of failed command:
    #<Process::Status: pid 11388 exit 1>
    ---- End output of /usr/local/bin/brew cask install virtualbox  ----
    Ran /usr/local/bin/brew cask install virtualbox  returned 1

    Resource Declaration:
    ---------------------
    # In /var/folders/0l/d20v6pzx1qlg9wmkszr_v9202dm83c/T/chefdk_bootstrap.GlbKsgqX/local-mode-cache/cache/cookbooks/chefdk_bootstrap/recipes/virtualbox.rb

     20:   homebrew_cask 'virtualbox'
     21: end

    Compiled Resource:
    ------------------
    # Declared in /var/folders/0l/d20v6pzx1qlg9wmkszr_v9202dm83c/T/chefdk_bootstrap.GlbKsgqX/local-mode-cache/cache/cookbooks/chefdk_bootstrap/recipes/virtualbox.rb:20:in `from_file'

    homebrew_cask("virtualbox") do
      action [:install]
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      declared_type :homebrew_cask
      cookbook_name "chefdk_bootstrap"
      recipe_name "virtualbox"
    end


Running handlers:
[2016-02-12T14:10:09-08:00] ERROR: Running exception handlers
Running handlers complete
[2016-02-12T14:10:09-08:00] ERROR: Exception handlers complete
Chef Client failed. 15 resources updated in 05 minutes 03 seconds
[2016-02-12T14:10:09-08:00] FATAL: Stacktrace dumped to /var/folders/0l/d20v6pzx1qlg9wmkszr_v9202dm83c/T/chefdk_bootstrap.GlbKsgqX/local-mode-cache/cache/chef-stacktrace.out
[2016-02-12T14:10:09-08:00] ERROR: homebrew_cask[virtualbox] (chefdk_bootstrap::virtualbox line 20) had an error: Mixlib::ShellOut::ShellCommandFailed: execute[installing cask virtualbox] (/var/folders/0l/d20v6pzx1qlg9wmkszr_v9202dm83c/T/chefdk_bootstrap.GlbKsgqX/local-mode-cache/cache/cookbooks/homebrew/providers/cask.rb line 29) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /usr/local/bin/brew cask install virtualbox  ----
STDOUT: ==> Downloading http://download.virtualbox.org/virtualbox/5.0.14/VirtualBox-5.0.14-105127-OSX.dmg
==> Verifying checksum for Cask virtualbox
==> Running installer for virtualbox; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are ignored.
==> sudo: no tty present and no askpass program specified
STDERR: Error: Command failed to execute!

==> Failed command:
["/usr/bin/sudo", "-E", "--", "/usr/sbin/installer", "-pkg", "#<Pathname:/opt/homebrew-cask/Caskroom/virtualbox/5.0.14-105127/VirtualBox.pkg>", "-target", "/"]

==> Output of failed command:


==> Exit status of failed command:
#<Process::Status: pid 11388 exit 1>
---- End output of /usr/local/bin/brew cask install virtualbox  ----
Ran /usr/local/bin/brew cask install virtualbox  returned 1
[2016-02-12T14:10:09-08:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
@dougireton

This comment has been minimized.

Show comment
Hide comment
@dougireton

dougireton Feb 16, 2016

Contributor

If I run this under my user it works, at least the upgrade seems to work. It does ask for my password so maybe the Chef run is failing due to this:

    ==> sudo: no tty present and no askpass program specified

Output when I run it manually and type in my password:

sudo -E -- /usr/sbin/installer -pkg /opt/homebrew-cask/Caskroom/virtualbox/5.0.14-105127/VirtualBox.pkg -target /
Password:
installer: Package name is Oracle VM VirtualBox
installer: Upgrading at base path /
installer: The upgrade was successful.
Contributor

dougireton commented Feb 16, 2016

If I run this under my user it works, at least the upgrade seems to work. It does ask for my password so maybe the Chef run is failing due to this:

    ==> sudo: no tty present and no askpass program specified

Output when I run it manually and type in my password:

sudo -E -- /usr/sbin/installer -pkg /opt/homebrew-cask/Caskroom/virtualbox/5.0.14-105127/VirtualBox.pkg -target /
Password:
installer: Package name is Oracle VM VirtualBox
installer: Upgrading at base path /
installer: The upgrade was successful.

@dougireton dougireton added this to the 1.5.x milestone Feb 18, 2016

@dougireton dougireton changed the title from Error installing Virutalbox to Error installing Virtualbox Feb 18, 2016

@dougireton

This comment has been minimized.

Show comment
Hide comment
@dougireton

dougireton Mar 1, 2016

Contributor

We should probably just switch to the dmg cookbook to install Virtualbox

Use the Virtualbox homebrew cask recipe for reference on how to install the package.

Contributor

dougireton commented Mar 1, 2016

We should probably just switch to the dmg cookbook to install Virtualbox

Use the Virtualbox homebrew cask recipe for reference on how to install the package.

dougireton added a commit that referenced this issue Mar 1, 2016

Release 1.6.0: chocolatey_package & Virtualbox
Switch from chocolatey resource in Chocolatey cookbook to chocolatey_package
resource in Chef 12.7

Install Virtualbox on Mac via dmg_package resource instead of homebrew.

Fixes #97

dougireton added a commit that referenced this issue Mar 1, 2016

Release 1.6.0: chocolatey_package & Virtualbox
Switch from chocolatey resource in Chocolatey cookbook to chocolatey_package
resource in Chef 12.7

Install Virtualbox on Mac via dmg_package resource instead of homebrew.

Fixes #97

@oifland oifland closed this in #108 Mar 2, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment