munki / macadmin-scripts

Scripts of possible interest to macOS admins
Other
2.32k stars 524 forks source link

Bug workaround try handler issue? #118

Open jhaug opened 1 year ago

jhaug commented 1 year ago

I've downloaded the latest version of the installinstallmacos.py script, and ensured that my python was updated via brew, etc. It seems that you've built in a handler to address this issue, but it doesn't seem to handle correctly. (Unless my issue is different). The script is running from a non-boot volume, under the path /Volumes/Samsung2TB/macOS/installinstallmacos.py ; Here's the console output beginning at the point where I make the release selection for Ventura 13.1:

Choose a product to download (1-29): 27
Downloading https://swcdn.apple.com/content/downloads/30/37/012-60271-A_QUUGE8KIJ8/yp0xtj55orcpxszdtd13xjhujppspsztj3/UpdateBrain.zip...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 3379k  100 3379k    0     0  9434k      0 --:--:-- --:--:-- --:--:-- 9573k
Downloading https://swcdn.apple.com/content/downloads/30/37/012-60271-A_QUUGE8KIJ8/yp0xtj55orcpxszdtd13xjhujppspsztj3/InstallInfo.plist...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   181  100   181    0     0   2294      0 --:--:-- --:--:-- --:--:--  2479
Downloading https://swcdn.apple.com/content/downloads/30/37/012-60271-A_QUUGE8KIJ8/yp0xtj55orcpxszdtd13xjhujppspsztj3/BuildManifest.plist...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 3276k  100 3276k    0     0  9455k      0 --:--:-- --:--:-- --:--:-- 9609k
Downloading https://swcdn.apple.com/content/downloads/30/37/012-60271-A_QUUGE8KIJ8/yp0xtj55orcpxszdtd13xjhujppspsztj3/MajorOSInfo.pkg...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1303k  100 1303k    0     0  5076k      0 --:--:-- --:--:-- --:--:-- 5172k
Downloading https://swdist.apple.com/content/downloads/30/37/012-60271-A_QUUGE8KIJ8/yp0xtj55orcpxszdtd13xjhujppspsztj3/MajorOSInfo.pkm...
Downloading https://swcdn.apple.com/content/downloads/30/37/012-60271-A_QUUGE8KIJ8/yp0xtj55orcpxszdtd13xjhujppspsztj3/InstallAssistant.pkg...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 11.3G  100 11.3G    0     0  69.9M      0  0:02:46  0:02:46 --:--:-- 81.6M
Downloading https://swdist.apple.com/content/downloads/30/37/012-60271-A_QUUGE8KIJ8/yp0xtj55orcpxszdtd13xjhujppspsztj3/InstallAssistant.pkm...
Downloading https://swcdn.apple.com/content/downloads/30/37/012-60271-A_QUUGE8KIJ8/yp0xtj55orcpxszdtd13xjhujppspsztj3/Info.plist...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  5041  100  5041    0     0  44678      0 --:--:-- --:--:-- --:--:-- 47112
Making empty sparseimage...
installer: Package name is macOS Ventura
installer: Installing at base path /private/tmp/dmg.mKYeWj
installer: The install failed. (The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance. An error occurred while running scripts from the package “InstallAssistant.pkg”.)
Command '['/usr/sbin/installer', '-pkg', './content/downloads/30/37/012-60271-A_QUUGE8KIJ8/yp0xtj55orcpxszdtd13xjhujppspsztj3/012-60271.English.dist', '-target', '/private/tmp/dmg.mKYeWj']' returned non-zero exit status 1.
Product installation failed.

Output from other commands which may be useful:

iMac-Pro:macOS josh$ find /private/tmp -type d | grep dmg
/private/tmp/dmg.mKYeWjApplications
/private/tmp/dmg.mKYeWjApplications/Install macOS Ventura.app
/private/tmp/dmg.mKYeWjApplications/Install macOS Ventura.app/Contents
/private/tmp/dmg.mKYeWjApplications/Install macOS Ventura.app/Contents/SharedSupport

iMac-Pro:/ josh$ find /Volumes/Samsung2TB/macOS -maxdepth 2
/Volumes/Samsung2TB/macOS
/Volumes/Samsung2TB/macOS/Install_macOS_13.1-22C65.sparseimage
/Volumes/Samsung2TB/macOS/content
/Volumes/Samsung2TB/macOS/content/catalogs
/Volumes/Samsung2TB/macOS/content/downloads
/Volumes/Samsung2TB/macOS/installinstallmacos.py

Additionally, here is the partial output from the script when run from /private/tmp/macOS/installinstallmacos.py:

Making empty sparseimage...
installer: Package name is macOS Ventura
installer: Installing at base path /private/tmp/dmg.kqw3uW
installer: The install was successful.
*********************************************************
*** Working around a very dumb Apple bug in a package ***
*** postinstall script that fails to correctly target ***
*** the Install macOS.app when installed to a volume  ***
*** other than the current boot volume.               ***
***       Please file feedback with Apple!            ***
*********************************************************
Product downloaded and installed to /private/tmp/macOS/Install_macOS_13.1-22C65.sparseimage
Making read-only compressed disk image containing Install macOS Ventura.app...
.............................................................................................................................
created: /private/tmp/macOS/Install_macOS_13.1-22C65.dmg
Disk image created at: ./Install_macOS_13.1-22C65.dmg

In both instances, command is run with sudo and using a volume formatted with APFS. Hope this is helpful, I tried to check if there were similar reports but didn't see any. I'm running macOS Monterey 12.6.2. --Josh

gregneagle commented 1 year ago

This might be TCC privacy protections preventing certain operations on removable volumes.