Homebrew / homebrew-cask

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

Installing cask philips-hue-sync v1.12.0.64 fails with undefined method `rename' for nil #174385

Closed ismarslomic closed 3 months ago

ismarslomic commented 3 months ago

Verification

Description of issue

I have had installed the cask philips-hue-sync for couple of years now and recently, for about two weeks ago, I run brew update and brew upgrade and it failed installing the latest version (v1.12.0.64). I did uninstall it and removed the downloaded cache, but still not able to install this version.

Command that failed

brew install --cask philips-hue-sync

Output of command with --verbose --debug

/opt/homebrew/Library/Homebrew/brew.rb (Cask::CaskLoader::FromAPILoader): loading philips-hue-sync
==> Cask::Installer#install
==> Printing caveats
==> Cask::Installer#fetch
/usr/bin/env /opt/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.3.1\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 14.5\)\ curl/8.6.0 --header Accept-Language:\ en --retry 3 --fail --location --silent --head https://raw.githubusercontent.com/Homebrew/homebrew-cask/52c5c92a501f2566679fa76428e2c5ae3fb04e6c/Casks/p/philips-hue-sync.rb
/usr/bin/env /opt/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.3.1\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 14.5\)\ curl/8.6.0 --header Accept-Language:\ en --retry 3 --fail --location --silent --head --request GET https://raw.githubusercontent.com/Homebrew/homebrew-cask/52c5c92a501f2566679fa76428e2c5ae3fb04e6c/Casks/p/philips-hue-sync.rb
==> Downloading https://raw.githubusercontent.com/Homebrew/homebrew-cask/52c5c92a501f2566679fa76428e2c5ae3fb04e6c/Casks/p/philips-hue-sync.rb
/usr/bin/env /opt/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.3.1\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 14.5\)\ curl/8.6.0 --header Accept-Language:\ en --retry 3 --fail --location --silent --head https://raw.githubusercontent.com/Homebrew/homebrew-cask/52c5c92a501f2566679fa76428e2c5ae3fb04e6c/Casks/p/philips-hue-sync.rb
/usr/bin/env /opt/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.3.1\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 14.5\)\ curl/8.6.0 --header Accept-Language:\ en --retry 3 --fail --location --silent --head --request GET https://raw.githubusercontent.com/Homebrew/homebrew-cask/52c5c92a501f2566679fa76428e2c5ae3fb04e6c/Casks/p/philips-hue-sync.rb
/usr/bin/env /opt/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.3.1\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 14.5\)\ curl/8.6.0 --header Accept-Language:\ en --fail --connect-timeout 15 --retry 3 --remote-time --output /Users/ismarslomic/Library/Caches/Homebrew/downloads/bca294c27243d1bf2d912de54150eae464efeea7203c412dc7ddb1dfb494abd5--philips-hue-sync.rb.incomplete --location https://raw.githubusercontent.com/Homebrew/homebrew-cask/52c5c92a501f2566679fa76428e2c5ae3fb04e6c/Casks/p/philips-hue-sync.rb
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   968  100   968    0     0  16380      0 --:--:-- --:--:-- --:--:-- 16406
==> Verifying checksum for 'bca294c27243d1bf2d912de54150eae464efeea7203c412dc7ddb1dfb494abd5--philips-hue-sync.rb'
/usr/bin/env /opt/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.3.1\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 14.5\)\ curl/8.6.0 --header Accept-Language:\ en --retry 3 --fail --location --silent --head https://firmware.meethue.com/v1/download\?deviceTypeId=HueSyncMac
/usr/bin/env /opt/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.3.1\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 14.5\)\ curl/8.6.0 --header Accept-Language:\ en --retry 3 --fail --location --silent --head --request GET https://firmware.meethue.com/v1/download\?deviceTypeId=HueSyncMac
==> Downloading https://firmware.meethue.com/v1/download?deviceTypeId=HueSyncMac
/usr/bin/env /opt/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.3.1\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 14.5\)\ curl/8.6.0 --header Accept-Language:\ en --retry 3 --fail --location --silent --head https://firmware.meethue.com/v1/download\?deviceTypeId=HueSyncMac
/usr/bin/env /opt/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.3.1\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 14.5\)\ curl/8.6.0 --header Accept-Language:\ en --retry 3 --fail --location --silent --head --request GET https://firmware.meethue.com/v1/download\?deviceTypeId=HueSyncMac
/usr/bin/env /opt/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.3.1\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 14.5\)\ curl/8.6.0 --header Accept-Language:\ en --fail --retry 3 --remote-time --output /Users/ismarslomic/Library/Caches/Homebrew/downloads/7f9a6b36e3ae7df0adf786eb15f250aafdbc998971482c4a3735b4f590e59faf--download.incomplete --location https://firmware.meethue.com/v1/download\?deviceTypeId=HueSyncMac
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   140  100   140    0     0   1532      0 --:--:-- --:--:-- --:--:--  1538
100 79.0M  100 79.0M    0     0  48.9M      0  0:00:01  0:00:01 --:--:-- 60.9M
==> Checking quarantine support
/usr/bin/env /usr/bin/xattr -h
/usr/bin/env /Library/Developer/CommandLineTools/usr/bin/swift -target arm64-apple-macosx14 /opt/homebrew/Library/Homebrew/cask/utils/quarantine.swift
==> Quarantine is available.
==> Verifying Gatekeeper status of /Users/ismarslomic/Library/Caches/Homebrew/downloads/7f9a6b36e3ae7df0adf786eb15f250aafdbc998971482c4a3735b4f590e59faf--download
/usr/bin/env /usr/bin/xattr -p com.apple.quarantine /Users/ismarslomic/Library/Caches/Homebrew/downloads/7f9a6b36e3ae7df0adf786eb15f250aafdbc998971482c4a3735b4f590e59faf--download
==> /Users/ismarslomic/Library/Caches/Homebrew/downloads/7f9a6b36e3ae7df0adf786eb15f250aafdbc998971482c4a3735b4f590e59faf--download is not quarantined
==> Quarantining /Users/ismarslomic/Library/Caches/Homebrew/downloads/7f9a6b36e3ae7df0adf786eb15f250aafdbc998971482c4a3735b4f590e59faf--download
/usr/bin/env /Library/Developer/CommandLineTools/usr/bin/swift -target arm64-apple-macosx14 /opt/homebrew/Library/Homebrew/cask/utils/quarantine.swift /Users/ismarslomic/Library/Caches/Homebrew/downloads/7f9a6b36e3ae7df0adf786eb15f250aafdbc998971482c4a3735b4f590e59faf--download https://firmware.meethue.com/v1/download\?deviceTypeId=HueSyncMac https://www.philips-hue.com/en-us/explore-hue/propositions/entertainment/sync-with-pc
Warning: No checksum defined for cask 'philips-hue-sync', skipping verification.
/usr/bin/env hdiutil imageinfo -format /Users/ismarslomic/Library/Caches/Homebrew/downloads/7f9a6b36e3ae7df0adf786eb15f250aafdbc998971482c4a3735b4f590e59faf--download
==> Installing Cask philips-hue-sync
==> Cask::Installer#stage
==> Extracting primary container
==> Using container class UnpackStrategy::Xar for /Users/ismarslomic/Library/Caches/Homebrew/downloads/7f9a6b36e3ae7df0adf786eb15f250aafdbc998971482c4a3735b4f590e59faf--download
/usr/bin/env xar -x -f /Users/ismarslomic/Library/Caches/Homebrew/downloads/7f9a6b36e3ae7df0adf786eb15f250aafdbc998971482c4a3735b4f590e59faf--download -C /private/tmp/homebrew-unpack20240520-15911-adhvee
/usr/bin/env cp -pR /private/tmp/homebrew-unpack20240520-15911-adhvee/Resources/. /opt/homebrew/Caskroom/philips-hue-sync/1.12.0.64/Resources
/usr/bin/env cp -pR /private/tmp/homebrew-unpack20240520-15911-adhvee/Distribution /opt/homebrew/Caskroom/philips-hue-sync/1.12.0.64/Distribution
/usr/bin/env cp -pR /private/tmp/homebrew-unpack20240520-15911-adhvee/huesync.pkg/. /opt/homebrew/Caskroom/philips-hue-sync/1.12.0.64/huesync.pkg
==> Verifying Gatekeeper status of /Users/ismarslomic/Library/Caches/Homebrew/downloads/7f9a6b36e3ae7df0adf786eb15f250aafdbc998971482c4a3735b4f590e59faf--download
/usr/bin/env /usr/bin/xattr -p com.apple.quarantine /Users/ismarslomic/Library/Caches/Homebrew/downloads/7f9a6b36e3ae7df0adf786eb15f250aafdbc998971482c4a3735b4f590e59faf--download
==> /Users/ismarslomic/Library/Caches/Homebrew/downloads/7f9a6b36e3ae7df0adf786eb15f250aafdbc998971482c4a3735b4f590e59faf--download is quarantined
==> Propagating quarantine from /Users/ismarslomic/Library/Caches/Homebrew/downloads/7f9a6b36e3ae7df0adf786eb15f250aafdbc998971482c4a3735b4f590e59faf--download to /opt/homebrew/Caskroom/philips-hue-sync/1.12.0.64
/usr/bin/env /usr/bin/xattr -p com.apple.quarantine /Users/ismarslomic/Library/Caches/Homebrew/downloads/7f9a6b36e3ae7df0adf786eb15f250aafdbc998971482c4a3735b4f590e59faf--download
/usr/bin/env /usr/bin/xargs -0 -- /bin/chmod -h u+w
/usr/bin/env /usr/bin/xargs -0 -- /usr/bin/xattr -w com.apple.quarantine 0181\;664bb393\;Homebrew\\x20Cask\;9E5D89A3-0C54-4ED0-B356-0FAC32A0CBAC
==> Creating metadata directory: /opt/homebrew/Caskroom/philips-hue-sync/.metadata/1.12.0.64/20240520203323.836
==> Creating metadata subdirectory: /opt/homebrew/Caskroom/philips-hue-sync/.metadata/1.12.0.64/20240520203323.836/Casks
==> Installing artifacts
==> Installing artifact of class Cask::Artifact::PreflightBlock
==> Purging files for version 1.12.0.64 of Cask philips-hue-sync
Error: undefined method `rename' for nil
/Users/ismarslomic/Library/Caches/Homebrew/api-source/Homebrew/homebrew-cask/52c5c92a501f2566679fa76428e2c5ae3fb04e6c/Cask/philips-hue-sync.rb:20:in `block (2 levels) in load'
/opt/homebrew/Library/Homebrew/cask/artifact/abstract_flight_block.rb:47:in `instance_eval'
/opt/homebrew/Library/Homebrew/cask/artifact/abstract_flight_block.rb:47:in `abstract_phase'
/opt/homebrew/Library/Homebrew/cask/artifact/abstract_flight_block.rb:26:in `install_phase'
/opt/homebrew/Library/Homebrew/cask/installer.rb:248:in `block in install_artifacts'
/opt/homebrew/Library/Homebrew/cask/artifact_set.rb:10:in `each'
/opt/homebrew/Library/Homebrew/cask/artifact_set.rb:10:in `each'
/opt/homebrew/Library/Homebrew/cask/installer.rb:241:in `install_artifacts'
/opt/homebrew/Library/Homebrew/cask/installer.rb:113:in `install'
/opt/homebrew/Library/Homebrew/cmd/install.rb:246:in `block in run'
/opt/homebrew/Library/Homebrew/cmd/install.rb:235:in `each'
/opt/homebrew/Library/Homebrew/cmd/install.rb:235:in `run'
/opt/homebrew/Library/Homebrew/brew.rb:92:in `<main>'
Please report this issue:
  https://docs.brew.sh/Troubleshooting

Output of brew doctor and brew config

> brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Some installed formulae are deprecated or disabled.
You should find replacements for the following formulae:
  openssl@1.1

> brew config
HOMEBREW_VERSION: 4.3.1
ORIGIN: https://github.com/Homebrew/brew
HEAD: e0bc557e7b991cb23583679e1cf1c8a92b793aeb
Last commit: 12 hours ago
Core tap JSON: 20 May 20:31 UTC
Core cask tap JSON: 20 May 20:31 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 20
Homebrew Ruby: 3.3.1 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.1/bin/ruby
CPU: 20-core 64-bit arm_firestorm_icestorm
Clang: 15.0.0 build 1500
Git: 2.45.1 => /opt/homebrew/bin/git
Curl: 8.6.0 => /usr/bin/curl
macOS: 14.5-arm64
CLT: 15.3.0.0.1.1708646388
Xcode: N/A
Rosetta 2: false

Output of brew tap

> brew tap
adoptopenjdk/openjdk
go-task/tap
homebrew/services
miccal commented 3 months ago

Try running rm -rf /opt/homebrew/Caskroom/philips-hue-sync and then brew install --force philips-hue-sync.

ismarslomic commented 3 months ago

Try running rm -rf /opt/homebrew/Caskroom/philips-hue-sync and then brew install --force philips-hue-sync.

Still same issue. I have same issue on two different MacBook.

bevanjkay commented 3 months ago

I can see the issue here -

==> Using container class UnpackStrategy::Xar for /Users/ismarslomic/Library/Caches/Homebrew/downloads/7f9a6b36e3ae7df0adf786eb15f250aafdbc998971482c4a3735b4f590e59faf--download

For some reason your system is not following the redirect on the url correctly, which is resulting in the preflight block failing, because it doesn't match any files in what is downloaded. Are you using a VPN or similar on your connection, and can you try a different network?

ismarslomic commented 3 months ago

I can confirm that PR #174402 fixed this issue. I successfully installed v1.12.0.64 now! Thanks for helping out!