pivotal-sprout / sprout-wrap

Pivotal Labs uses this project with sprout, soloist and librarian-chef to build developer workstations
The Unlicense
157 stars 250 forks source link

Problem with installing XQuartz-2.7.4, CCMenu, KeyCastr, JavaForOSX etc. under Mavericks #33

Closed rdy closed 10 years ago

rdy commented 10 years ago

We got the following output when executing soloist under mavericks when it tried to install osx apps recipes. We had to manually install the XQuartz package in order to proceed. Somehow the installer is not proceeding correctly from soloist.

Looks like packages coming from a dmg file do not work correctly, not sure exactly why. This could be due to some race condition trying to mount the dmg and reading it before it is ready. We are using a late 2013 iMac with an SSD.

It seems like things installed by brew cask install seemed to work correctly, but anything with a custom installation through rsync or by manipulating files in the volume seemed to fail.

    - execute the ruby block attach /var/chef/cache/XQuartz.dmg

  * execute[sudo installer -pkg '/Volumes/XQuartz-2.7.4/XQuartz.pkg' -target /] action run[2014-02-03T13:32:55-08:00] INFO: Processing execute[sudo installer -pkg '/Volumes/XQuartz-2.7.4/XQuartz.pkg' -target /] action run (/Users/pacerpro/workspace/sprout-wrap/cookbooks/dmg/providers/package.rb line 66)
installer: Error the package path specified was invalid: '/Volumes/XQuartz-2.7.4/XQuartz.pkg'.

================================================================================
Error executing action `run` on resource 'execute[sudo installer -pkg '/Volumes/XQuartz-2.7.4/XQuartz.pkg' -target /]'
================================================================================

Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of sudo installer -pkg '/Volumes/XQuartz-2.7.4/XQuartz.pkg' -target / ----
STDOUT: installer: Error the package path specified was invalid: '/Volumes/XQuartz-2.7.4/XQuartz.pkg'.
STDERR: 
---- End output of sudo installer -pkg '/Volumes/XQuartz-2.7.4/XQuartz.pkg' -target / ----
Ran sudo installer -pkg '/Volumes/XQuartz-2.7.4/XQuartz.pkg' -target / returned 1

Resource Declaration:
---------------------
# In /Users/pacerpro/workspace/sprout-wrap/cookbooks/dmg/providers/package.rb

 66:       execute "sudo installer -pkg '/Volumes/#{volumes_dir}/#{new_resource.app}.#{new_resource.type}' -target /" do
 67:         # Prevent cfprefsd from holding up hdiutil detach for certain disk images
 68:         environment('__CFPREFERENCES_AVOID_DAEMON' => '1') if Gem::Version.new(node['platform_version']) >= Gem::Version.new('10.8')
 69:       end
 70:     end

Compiled Resource:
------------------
# Declared in /Users/pacerpro/workspace/sprout-wrap/cookbooks/dmg/providers/package.rb:66:in `block in class_from_file'

execute("sudo installer -pkg '/Volumes/XQuartz-2.7.4/XQuartz.pkg' -target /") do
  action "run"
  retries 0
  retry_delay 2
  command "sudo installer -pkg '/Volumes/XQuartz-2.7.4/XQuartz.pkg' -target /"
  backup 5
  environment {"__CFPREFERENCES_AVOID_DAEMON"=>"1"}
  returns 0
  cookbook_name :"sprout-osx-apps"
end

[2014-02-03T13:32:55-08:00] INFO: Running queued delayed notifications before re-raising exception

================================================================================
Error executing action `install` on resource 'dmg_package[XQuartz]'
================================================================================

Mixlib::ShellOut::ShellCommandFailed
------------------------------------
execute[sudo installer -pkg '/Volumes/XQuartz-2.7.4/XQuartz.pkg' -target /] (/Users/pacerpro/workspace/sprout-wrap/cookbooks/dmg/providers/package.rb line 66) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of sudo installer -pkg '/Volumes/XQuartz-2.7.4/XQuartz.pkg' -target / ----
STDOUT: installer: Error the package path specified was invalid: '/Volumes/XQuartz-2.7.4/XQuartz.pkg'.
STDERR: 
---- End output of sudo installer -pkg '/Volumes/XQuartz-2.7.4/XQuartz.pkg' -target / ----
Ran sudo installer -pkg '/Volumes/XQuartz-2.7.4/XQuartz.pkg' -target / returned 1

Resource Declaration:
---------------------
# In /Users/pacerpro/workspace/sprout-wrap/cookbooks/sprout-osx-apps/recipes/xquartz.rb

  1: dmg_package "XQuartz" do
  2:   source "http://xquartz.macosforge.org/downloads/SL/XQuartz-2.7.4.dmg"
  3:   action :install
  4:   volumes_dir "XQuartz-2.7.4"
  5:   checksum "3f7c156fc4b13e3f0d0e44523ef2bd3cf7ea736126616dd2da28abb31840923c"
  6:   type "pkg"
  7:   owner node['current_user']
  8:   package_id "org.macosforge.xquartz.pkg"
  9: end

Compiled Resource:
------------------
# Declared in /Users/pacerpro/workspace/sprout-wrap/cookbooks/sprout-osx-apps/recipes/xquartz.rb:1:in `from_file'

dmg_package("XQuartz") do
  action [:install]
  updated true
  updated_by_last_action true
  retries 0
  retry_delay 2
  cookbook_name :"sprout-osx-apps"
  recipe_name "xquartz"
  source "http://xquartz.macosforge.org/downloads/SL/XQuartz-2.7.4.dmg"
  volumes_dir "XQuartz-2.7.4"
  checksum "3f7c156fc4b13e3f0d0e44523ef2bd3cf7ea736126616dd2da28abb31840923c"
  type "pkg"
  owner "pacerpro"
  package_id "org.macosforge.xquartz.pkg"
  app "XQuartz"
  destination "/Applications"
end
gal-at-aljazeera commented 10 years ago

I just logged the same issue (#34)

kfitzpatrick commented 10 years ago

I saw the same issue on 10.8.5 Mountain Lion

https://gist.github.com/kfitzpatrick/dc7b1816654d1f7672a1

hiremaga commented 10 years ago

Thanks for reporting this @rdy & @gal-at-aljazeera, I'm working on fixes.

For the things that work with cask you should be able edit your soloistrc to switch to using sprout-homebrew::casks to install the cask instead of sprout-osx-apps. We're planning to drop recipes in sprout-osx-apps that have a corresponding cask.

@kfitzpatrick we've dropped support for mountain-lion unfortunately. Happy to review and accept a PR to the mountain-lion branch of sprout (not sprout-wrap) if it's a really important fix (e.g. a security update).

hiremaga commented 10 years ago

@rdy, @gal-at-aljazeera, @kfitzpatrick

Any chance you'd be able to submit individual issues for each recipe that's broken on Mavericks to the sprout (not sprout-wrap) since that's where the recipes live.

PRs to convert them to use homebrew cask with the provided LWRP would be even more awesome.

I'm working on converting xquartz and java. KeyCastr seems to work for me.

If there is a more general DMG mounting issue on Mavericks, perhaps the best place to report & fix this is in Opscode's dmg cookbook?

kfitzpatrick commented 10 years ago

Thanks Abhi.


Kevin Fitzpatrick

@kfitzpatrick 267.254.6225

On Feb 4, 2014, at 6:14 PM, Abhi Hiremagalur notifications@github.com wrote:

Thanks for reporting this @rdy & @gal-at-aljazeera, I'm working on fixes.

For the things that work with cask you should be able edit your soloistrc to switch to using sprout-homebrew::casks to install the cask instead of sprout-osx-apps. We're planning to drop recipes in sprout-osx-apps that have a corresponding cask.

@kfitzpatrick we've dropped support for mountain-lion unfortunately. Happy to review and accept a PR to the mountain-lion branch of sprout (not sprout-wrap) if it's a really important fix (e.g. a security update).

\ Reply to this email directly or view it on GitHub.

hiremaga commented 10 years ago

@rdy @kfitzpatrick @gal-at-aljazeera I just pushed 6ff8d1a48828c, this does fix things for you?

Thanks.

gal-at-aljazeera commented 10 years ago

Will try to run again on the next machine as soon as I can and report back. If it still happens - I'll try to do as @hiremaga describes, at least I can give it a shot. If you have a commit in place for the ones you fixed, can you point me to it?

rdy commented 10 years ago

@hiremaga I'll give this a try soon and let you know.

kfitzpatrick commented 10 years ago

Works like a charm. I upgraded to Mavericks this afternoon and it ran perfectly the first time and had a fast, clean second run

On Wed, Feb 5, 2014 at 2:16 PM, Ryan Dy notifications@github.com wrote:

@hiremaga https://github.com/hiremaga I'll give this a try soon and let you know.

Reply to this email directly or view it on GitHubhttps://github.com/pivotal-sprout/sprout-wrap/issues/33#issuecomment-34260220 .

codeword commented 10 years ago

is this issue closable? @rdy is your issue resolved?

gal-at-aljazeera commented 10 years ago

Yes - this worked for us as well. Thank you.

rdy commented 10 years ago

@hiremaga @codeword yup this fixes my issue, I'd love to see this released when you can.

hiremaga commented 10 years ago

Great!

The fix in sprout is referenced by head of sprout-wrap's master, is that what you meant by released?

On Monday, February 10, 2014, Ryan Dy notifications@github.com wrote:

@hiremaga https://github.com/hiremaga @codewordhttps://github.com/codewordyup this fixes my issue, I'd love to see this released when you can.

Reply to this email directly or view it on GitHubhttps://github.com/pivotal-sprout/sprout-wrap/issues/33#issuecomment-34684626 .

rdy commented 10 years ago

ya sorry, it looks good.