Homebrew / homebrew-cask

🍻 A CLI workflow for the administration of macOS applications distributed as binaries
https://brew.sh
BSD 2-Clause "Simplified" License
20.93k stars 10.71k forks source link

Brew cask install xquartz fails on /bin/launchctl load /Library/LaunchAgents/org.macosforge.xquartz.startx.plist #38062

Closed GlenHenshaw closed 7 years ago

GlenHenshaw commented 7 years ago

General troubleshooting steps

Description of issue

Upgrading xquartz fails as follows:

Output of your command with --verbose --debug

frogstar:~ glenhenshaw$ brew cask install --verbose --debug xquartz
==> Hbc::Installer#install
==> Printing caveats
==> Hbc::Installer#fetch
==> Satisfying dependencies
==> Downloading
==> Downloading https://dl.bintray.com/xquartz/downloads/XQuartz-2.7.11.dmg
Already downloaded: /Users/glenhenshaw/Library/Caches/Homebrew/Cask/xquartz--2.7.11.dmg
==> Downloaded to -> /Users/glenhenshaw/Library/Caches/Homebrew/Cask/xquartz--2.7.11.dmg
==> Verifying download
==> Determining which verifications to run for Cask xquartz
==> Checking for verification class Hbc::Verify::Checksum
==> 1 verifications defined
Hbc::Verify::Checksum
==> Running verification of class Hbc::Verify::Checksum
==> Verifying checksum for Cask xquartz
==> SHA256 checksums match
==> Installing Cask xquartz
==> Hbc::Installer#stage
==> Extracting primary container
==> Determining which containers to use based on filetype
==> Checking container class Hbc::Container::Pkg
==> Checking container class Hbc::Container::Ttf
==> Checking container class Hbc::Container::Otf
==> Checking container class Hbc::Container::Air
==> Checking container class Hbc::Container::Cab
==> Checking container class Hbc::Container::Dmg
==> Executing: ["/usr/bin/hdiutil", "imageinfo", "/Users/glenhenshaw/Library/Caches/Homebrew/Cask/xquartz--2.7.11.dmg"]
==> Using container class Hbc::Container::Dmg for /Users/glenhenshaw/Library/Caches/Homebrew/Cask/xquartz--2.7.11.dmg
==> Executing: ["/usr/bin/hdiutil", "attach", "-plist", "-nobrowse", "-readonly", "-noidme", "-mountrandom", "/var/folders/kp/09zct2x14bn0gzqm3q5ztsgr0000gq/T/d20170828-4845-1id3vcc", "/Users/glenhenshaw/Library/Caches/Homebrew/Cask/xquartz--2.7.11.dmg"]
==> Executing: ["/usr/bin/mkbom", "-s", "-i", "/var/folders/kp/09zct2x14bn0gzqm3q5ztsgr0000gq/T/20170828-4845-199gml7.list", "--", "/var/folders/kp/09zct2x14bn0gzqm3q5ztsgr0000gq/T/20170828-4845-ae37z5.bom"]
==> Executing: ["/usr/bin/ditto", "--bom", "/var/folders/kp/09zct2x14bn0gzqm3q5ztsgr0000gq/T/20170828-4845-ae37z5.bom", "--", "/private/var/folders/kp/09zct2x14bn0gzqm3q5ztsgr0000gq/T/d20170828-4845-1id3vcc/dmg.IFUBuW", "/usr/local/Caskroom/xquartz/2.7.11"]
==> Executing: ["/usr/sbin/diskutil", "eject", "/private/var/folders/kp/09zct2x14bn0gzqm3q5ztsgr0000gq/T/d20170828-4845-1id3vcc/dmg.IFUBuW"]
==> Creating metadata directory /usr/local/Caskroom/xquartz/.metadata/2.7.11/20170828162752.667.
==> Creating metadata subdirectory /usr/local/Caskroom/xquartz/.metadata/2.7.11/20170828162752.667/Casks.
==> Installing artifacts
==> Determining which artifacts are present in Cask xquartz
==> 4 artifact/s defined
#<Hbc::Artifact::Uninstall:0x007fb9cf102300>
#<Hbc::Artifact::Pkg:0x007fb9cf102210>
#<Hbc::Artifact::PostflightBlock:0x007fb9cf101f68>
#<Hbc::Artifact::Zap:0x007fb9cf101ef0>
==> Installing artifact of class Hbc::Artifact::Pkg
==> Running installer for xquartz; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are ignored.
==> Executing: ["/usr/bin/sudo", "-E", "--", "/usr/sbin/installer", "-pkg", "/usr/local/Caskroom/xquartz/2.7.11/XQuartz.pkg", "-target", "/", "-verboseR"]
==> installer: Package name is XQuartz 2.7.11
==> installer: Upgrading at base path /
==> installer:PHASE:Preparing for installation…
==> installer:PHASE:Preparing the disk…
==> installer:PHASE:Preparing XQuartz 2.7.11…
==> installer:PHASE:Waiting for other installations to complete…
==> installer:PHASE:Configuring the installation…
==> installer:STATUS:
==> installer:%7.518948
==> installer:PHASE:Writing files…
==> installer:%24.352511
==> installer:PHASE:Writing files…
==> installer:%28.560901
==> installer:PHASE:Writing files…
==> installer:%30.665097
==> installer:PHASE:Writing files…
==> installer:%32.769292
==> installer:PHASE:Writing files…
==> installer:%39.081878
==> installer:PHASE:Writing files…
==> installer:PHASE:Writing files…
==> installer:PHASE:Writing files…
==> installer:%63.037357
==> installer:PHASE:Moving items into place…
==> installer:%64.094521
==> installer:PHASE:Moving items into place…
==> installer:%65.153569
==> installer:PHASE:Moving items into place…
==> installer:%66.190519
==> installer:PHASE:Moving items into place…
==> installer:%67.257958
==> installer:PHASE:Moving items into place…
==> installer:%68.314965
==> installer:PHASE:Moving items into place…
==> installer:%83.495747
==> installer:PHASE:Running package scripts…
==> installer:%84.545793
==> installer:PHASE:Running package scripts…
==> installer:%85.374175
==> installer:PHASE:Running package scripts…
.
.
.
==> installer:PHASE:Running package scripts…
==> installer:PHASE:Validating packages…
==> installer:PHASE:Validating packages…
==> installer:%97.750000
==> installer:STATUS:Running installer actions…
==> installer:STATUS:
==> installer:PHASE:Finishing the Installation…
==> installer:STATUS:
==> installer:%100.000000
==> installer:PHASE:The software was successfully installed.
==> installer: The upgrade was successful.
==> Installing artifact of class Hbc::Artifact::PostflightBlock
==> Executing: ["/usr/bin/defaults", "write", "com.apple.applescript", "ApplicationMap", "-dict-add", "X11", "file://localhost/Applications/Utilities/XQuartz.app/"]
==> Executing: ["/bin/launchctl", "load", "/Library/LaunchAgents/org.macosforge.xquartz.startx.plist"]
==> Could not find domain for 
==> Purging files for version 2.7.11 of Cask xquartz
Error: Command failed to execute!

==> Failed command:
/bin/launchctl load /Library/LaunchAgents/org.macosforge.xquartz.startx.plist

==> Standard Output of failed command:

==> Standard Error of failed command:
Could not find domain for 

==> Exit status of failed command:
#<Process::Status: pid 5110 exit 112>
Error: Install incomplete.
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/install.rb:13:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/abstract_command.rb:35:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:97:in `run_command'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:167:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:131:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:8:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:95:in `<main>'
Error: Kernel.exit
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:172:in `exit'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:172:in `rescue in run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:155:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:131:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:8:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:95:in `<main>'

Output of brew cask doctor

frogstar:~ glenhenshaw$ brew cask doctor
==> Homebrew-Cask Version
Homebrew-Cask 1.3.1-111-g551e5dd
caskroom/homebrew-cask (git revision a8f37; last commit 2017-08-28)
==> Homebrew-Cask Install Location
<NONE>
==> Homebrew-Cask Staging Location
/usr/local/Caskroom
==> Homebrew-Cask Cached Downloads
~/Library/Caches/Homebrew/Cask (3 files, 135.5MB)
==> Homebrew-Cask Taps:
/usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask (3714 casks)
==> Contents of $LOAD_PATH
/usr/local/Homebrew/Library/Homebrew/cask/lib
/usr/local/Homebrew/Library/Homebrew
/Library/Ruby/Site/2.0.0
/Library/Ruby/Site/2.0.0/x86_64-darwin16
/Library/Ruby/Site/2.0.0/universal-darwin16
/Library/Ruby/Site
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0/x86_64-darwin16
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0/universal-darwin16
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/x86_64-darwin16
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin16
==> Environment Variables
LC_ALL="en_US.UTF-8"
PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Applications/Server.app/Contents/ServerRoot/usr/bin:/Applications/Server.app/Contents/ServerRoot/usr/sbin:/usr/local/Homebrew/Library/Homebrew/shims/scm"
SHELL="/bin/bash"

Note the output of the mandated checklist items:

frogstar:~ glenhenshaw$ brew doctor
Your system is ready to brew.
frogstar:~ glenhenshaw$ brew update-reset && brew update
==> Fetching /usr/local/Homebrew...

==> Resetting /usr/local/Homebrew...
Branch master set up to track remote branch master from origin.
Switched to and reset branch 'master'

==> Fetching /usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask...

==> Resetting /usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask...
Branch master set up to track remote branch master from origin.
Reset branch 'master'
Your branch is up-to-date with 'origin/master'.

==> Fetching /usr/local/Homebrew/Library/Taps/dartsim/homebrew-dart...

==> Resetting /usr/local/Homebrew/Library/Taps/dartsim/homebrew-dart...
Branch master set up to track remote branch master from origin.
Reset branch 'master'
Your branch is up-to-date with 'origin/master'.

==> Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-boneyard...

==> Resetting /usr/local/Homebrew/Library/Taps/homebrew/homebrew-boneyard...
Branch master set up to track remote branch master from origin.
Reset branch 'master'
Your branch is up-to-date with 'origin/master'.

==> Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core...

==> Resetting /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core...
Branch master set up to track remote branch master from origin.
Reset branch 'master'
Your branch is up-to-date with 'origin/master'.

==> Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-dupes...

==> Resetting /usr/local/Homebrew/Library/Taps/homebrew/homebrew-dupes...
Branch master set up to track remote branch master from origin.
Reset branch 'master'
Your branch is up-to-date with 'origin/master'.

==> Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-python...

==> Resetting /usr/local/Homebrew/Library/Taps/homebrew/homebrew-python...
Branch master set up to track remote branch master from origin.
Reset branch 'master'
Your branch is up-to-date with 'origin/master'.

==> Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-science...

==> Resetting /usr/local/Homebrew/Library/Taps/homebrew/homebrew-science...
Branch master set up to track remote branch master from origin.
Reset branch 'master'
Your branch is up-to-date with 'origin/master'.

==> Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-versions...

==> Resetting /usr/local/Homebrew/Library/Taps/homebrew/homebrew-versions...
Branch master set up to track remote branch master from origin.
Reset branch 'master'
Your branch is up-to-date with 'origin/master'.

==> Fetching /usr/local/Homebrew/Library/Taps/osrf/homebrew-simulation...

==> Resetting /usr/local/Homebrew/Library/Taps/osrf/homebrew-simulation...
Branch master set up to track remote branch master from origin.
Reset branch 'master'
Your branch is up-to-date with 'origin/master'.

==> Fetching /usr/local/Homebrew/Library/Taps/ros/homebrew-deps...

==> Resetting /usr/local/Homebrew/Library/Taps/ros/homebrew-deps...
Branch master set up to track remote branch master from origin.
Reset branch 'master'
Your branch is up-to-date with 'origin/master'.

Already up-to-date.
frogstar:~ glenhenshaw$ brew cask install xquartz
==> Satisfying dependencies
==> Downloading https://dl.bintray.com/xquartz/downloads/XQuartz-2.7.11.dmg
Already downloaded: /Users/glenhenshaw/Library/Caches/Homebrew/Cask/xquartz--2.7.11.dmg
==> Verifying checksum for Cask xquartz
==> Installing Cask xquartz
==> Running installer for xquartz; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are ignored.
Password:
==> installer: Package name is XQuartz 2.7.11
==> installer: Upgrading at base path /
==> installer: The upgrade was successful.
==> Could not find domain for 
Error: Command failed to execute!

==> Failed command:
/bin/launchctl load /Library/LaunchAgents/org.macosforge.xquartz.startx.plist

==> Standard Output of failed command:

==> Standard Error of failed command:
Could not find domain for 

==> Exit status of failed command:
#<Process::Status: pid 4709 exit 112>
Error: Install incomplete.
commitay commented 7 years ago

@GlenHenshaw How are you running brew cask install xquartz? Locally or via ssh / other tools?

GlenHenshaw commented 7 years ago

Via ssh, as it happens.

GlenHenshaw commented 7 years ago

Ah. No windowing system, so launchctl fails. Yes?

commitay commented 7 years ago

Yes, there are a few ways to work around this but I can't really recommend a specific solution.

The Apple and JAMF forums have several posts about this with different solutions.

Closing as this is not a Cask issue.

samnissen commented 7 years ago

@commitay as these commands that fail with no windowing system can work with sudo, can this command be run optionally with sudo? Also, in the interim, can you provide any links to the solutions? I can't find anything...