Skip to content
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

Installation fails on macOS 11.2.2 #63

Closed
grischard opened this issue Mar 5, 2021 · 5 comments
Closed

Installation fails on macOS 11.2.2 #63

grischard opened this issue Mar 5, 2021 · 5 comments

Comments

@grischard
Copy link

How to reproduce:

Download the latest release and install

Expected result:

MailTrackerBlocker installation completes

Actual results:

Installation fails in postinst script, and error gets displayed.

Full log:

Mar  5 12:12:43 hylozoist Installer[24747]: @(#)PROGRAM:Install  PROJECT:Install-1000
Mar  5 12:12:43 hylozoist Installer[24747]: @(#)PROGRAM:Installer  PROJECT:Installer-1018
Mar  5 12:12:43 hylozoist Installer[24747]: Hardware: MacBookPro14,1 @ 2.30 GHz (x 4), 16384 MB RAM
Mar  5 12:12:43 hylozoist Installer[24747]: Running OS Build: macOS 11.2.2 (20D80)
Mar  5 12:12:43 hylozoist Installer[24747]: Env: USER=foobar
Mar  5 12:12:43 hylozoist Installer[24747]: Env: SECURITYSESSIONID=186ad
Mar  5 12:12:43 hylozoist Installer[24747]: Env: MallocNanoZone=0
Mar  5 12:12:43 hylozoist Installer[24747]: Env: __CFBundleIdentifier=com.apple.installer
Mar  5 12:12:43 hylozoist Installer[24747]: Env: COMMAND_MODE=unix2003
Mar  5 12:12:43 hylozoist Installer[24747]: Env: DISPLAY=/private/tmp/com.apple.launchd.ZYoidt0HUq/org.macosforge.xquartz:0
Mar  5 12:12:43 hylozoist Installer[24747]: Env: LOGNAME=foobar
Mar  5 12:12:43 hylozoist Installer[24747]: Env: PATH=/usr/bin:/bin:/usr/sbin:/sbin
Mar  5 12:12:43 hylozoist Installer[24747]: Env: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.LnBBQlVeDe/Listeners
Mar  5 12:12:43 hylozoist Installer[24747]: Env: APP_SANDBOX_CONTAINER_ID=com.apple.MobileSMS
Mar  5 12:12:43 hylozoist Installer[24747]: Env: SHELL=/usr/local/bin/zsh
Mar  5 12:12:43 hylozoist Installer[24747]: Env: DIRHELPER_USER_DIR_SUFFIX=com.apple.messages
Mar  5 12:12:43 hylozoist Installer[24747]: Env: HOME=/Users/foobar
Mar  5 12:12:43 hylozoist Installer[24747]: Env: __CF_USER_TEXT_ENCODING=0x1F6:0x0:0x2
Mar  5 12:12:43 hylozoist Installer[24747]: Env: LaunchInstanceID=3D8115DB-1E23-4277-A6C9-68059EC2E9CB
Mar  5 12:12:43 hylozoist Installer[24747]: Env: TMPDIR=/var/folders/1y/hwgwq23x3jbb7cyj0j998yrh0000gp/T/
Mar  5 12:12:43 hylozoist Installer[24747]: Env: XPC_SERVICE_NAME=application.com.apple.installer.1152921500312163448.1152921500312163453
Mar  5 12:12:43 hylozoist Installer[24747]: Env: XPC_FLAGS=0x0
Mar  5 12:12:43 hylozoist Installer[24747]: MailTrackerBlocker  Installation Log
Mar  5 12:12:43 hylozoist Installer[24747]: Opened from: /Users/foobar/Downloads/2021-03-05/MailTrackerBlocker.pkg
Mar  5 12:12:43 hylozoist Installer[24747]: Package Authoring Error: <background_scaling> has an unsupported MIME type: X-NSObject/NSNumber
Mar  5 12:12:43 hylozoist Installer[24747]: Package Authoring Error: <background_alignment> has an unsupported MIME type: X-NSObject/NSNumber
Mar  5 12:12:43 hylozoist Installer[24747]: Package Authoring Error: <layout-direction> has an unsupported MIME type: X-NSObject/NSNumber
Mar  5 12:12:43 hylozoist Installer[24747]: Failed to load specified background image
Mar  5 12:12:43 hylozoist Installer[24747]: Product archive /Users/foobar/Downloads/2021-03-05/MailTrackerBlocker.pkg trustLevel=350
Mar  5 12:12:43 hylozoist Installer[24747]: External component packages (1) trustLevel=350
Mar  5 12:12:43 hylozoist Installer[24747]: Could not load resource readme: (null)
Mar  5 12:12:43 hylozoist Installer[24747]: Could not load resource license: (null)
Mar  5 12:12:48 hylozoist Installer[24747]: ================================================================================
Mar  5 12:12:48 hylozoist Installer[24747]: User picked Standard Install
Mar  5 12:12:48 hylozoist Installer[24747]: Choices selected for installation:
Mar  5 12:12:48 hylozoist Installer[24747]: 	Upgrade: "MailTrackerBlocker"
Mar  5 12:12:48 hylozoist Installer[24747]: 	Upgrade: "(null)"
Mar  5 12:12:48 hylozoist Installer[24747]: 		MailTrackerBlocker.pkg#Core.pkg : com.onefatgiraffe.mailtrackerblocker : 0
Mar  5 12:12:48 hylozoist Installer[24747]: ================================================================================
Mar  5 12:12:48 hylozoist Installer[24747]: It took 0.00 seconds to summarize the package selections.
Mar  5 12:12:48 hylozoist Installer[24747]: -[IFDInstallController(Private) _buildInstallPlanReturningError:]: location = file://localhost
Mar  5 12:12:48 hylozoist Installer[24747]: -[IFDInstallController(Private) _buildInstallPlanReturningError:]: file://localhost/Users/foobar/Downloads/2021-03-05/MailTrackerBlocker.pkg#Core.pkg
Mar  5 12:12:48 hylozoist Installer[24747]: Set authorization level to root for session
Mar  5 12:12:52 hylozoist Installer[24747]: Administrator authorization granted.
Mar  5 12:12:52 hylozoist Installer[24747]: Set authorization level to root for session
Mar  5 12:12:52 hylozoist Installer[24747]: Will use PK session
Mar  5 12:12:52 hylozoist Installer[24747]: Using authorization level of root for IFPKInstallElement
Mar  5 12:12:52 hylozoist Installer[24747]: Starting installation:
Mar  5 12:12:52 hylozoist Installer[24747]: Configuring volume "Macintosh HD"
Mar  5 12:12:52 hylozoist Installer[24747]: Preparing disk for local booted install.
Mar  5 12:12:52 hylozoist Installer[24747]: Free space on "Macintosh HD": 19.74 GB (19744583680 bytes).
Mar  5 12:12:52 hylozoist Installer[24747]: Create temporary directory "/var/folders/1y/hwgwq23x3jbb7cyj0j998yrh0000gp/T//Install.24747eFUhkc"
Mar  5 12:12:52 hylozoist Installer[24747]: IFPKInstallElement (1 packages)
Mar  5 12:12:52 hylozoist Installer[24747]: Current Path: /System/Library/CoreServices/Installer.app/Contents/MacOS/Installer
Mar  5 12:12:52 hylozoist installd[2520]: PackageKit: Adding client PKInstallDaemonClient pid=24747, uid=502 (/System/Library/CoreServices/Installer.app/Contents/MacOS/Installer)
Mar  5 12:12:52 hylozoist Installer[24747]: PackageKit: Enqueuing install with framework-specified quality of service (utility)
Mar  5 12:12:52 hylozoist installd[2520]: PackageKit: ----- Begin install -----
Mar  5 12:12:52 hylozoist installd[2520]: PackageKit: request=PKInstallRequest <1 packages, destination=/>
Mar  5 12:12:52 hylozoist installd[2520]: PackageKit: packages=(
	    "<null>"
	)
Mar  5 12:12:52 hylozoist installd[2520]: PackageKit: Set reponsibility for install to 24747
Mar  5 12:12:52 hylozoist installd[2520]: PackageKit: Skipping stale sandbox at path /Library/InstallerSandboxes/.PKInstallSandboxManager/B8C5EAF5-D09C-48EC-BA04-BECB72EF2F0B.activeSandbox
Mar  5 12:12:52 hylozoist installd[2520]: PackageKit: Extracting file:///Users/foobar/Downloads/2021-03-05/MailTrackerBlocker.pkg#Core.pkg (destination=/Library/InstallerSandboxes/.PKInstallSandboxManager/A8BB6468-110C-4732-8BC2-671E85F637BE.activeSandbox/Root/private/tmp/MailTrackerBlocker-Installation-Temp, uid=0)
Mar  5 12:12:52 hylozoist installd[2520]: PackageKit: prevent user idle system sleep
Mar  5 12:12:52 hylozoist installd[2520]: PackageKit: suspending backupd
Mar  5 12:12:52 hylozoist installd[2520]: PackageKit (package_script_service): Preparing to execute script "./preinstall" in /private/tmp/PKInstallSandbox.75a0ey/Scripts/com.onefatgiraffe.mailtrackerblocker.juA8PD
Mar  5 12:12:52 hylozoist package_script_service[2542]: PackageKit: Executing script "preinstall" in /tmp/PKInstallSandbox.75a0ey/Scripts/com.onefatgiraffe.mailtrackerblocker.juA8PD
Mar  5 12:12:52 hylozoist package_script_service[2542]: Set responsibility to pid: 24747, responsible_path: /System/Library/CoreServices/Installer.app/Contents/MacOS/Installer
Mar  5 12:12:52 hylozoist install_monitor[24855]: Temporarily excluding: /Applications, /Library, /System, /bin, /private, /sbin, /usr
Mar  5 12:12:52 hylozoist package_script_service[2542]: ./preinstall: /private/tmp/MailTrackerBlocker-Installation-Temp/running
Mar  5 12:12:53 hylozoist package_script_service[2542]: Responsibility set back to self.
Mar  5 12:12:53 hylozoist installd[2520]: PackageKit: Using trashcan path /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/PKInstallSandboxTrash/A8BB6468-110C-4732-8BC2-671E85F637BE.sandboxTrash for sandbox /Library/InstallerSandboxes/.PKInstallSandboxManager/A8BB6468-110C-4732-8BC2-671E85F637BE.activeSandbox
Mar  5 12:12:53 hylozoist installd[2520]: PackageKit: Shoving /Library/InstallerSandboxes/.PKInstallSandboxManager/A8BB6468-110C-4732-8BC2-671E85F637BE.activeSandbox/Root (1 items) to /
Mar  5 12:12:53 hylozoist installd[2520]: PackageKit (package_script_service): Preparing to execute script "./postinstall" in /private/tmp/PKInstallSandbox.75a0ey/Scripts/com.onefatgiraffe.mailtrackerblocker.juA8PD
Mar  5 12:12:53 hylozoist package_script_service[2542]: PackageKit: Executing script "postinstall" in /tmp/PKInstallSandbox.75a0ey/Scripts/com.onefatgiraffe.mailtrackerblocker.juA8PD
Mar  5 12:12:53 hylozoist package_script_service[2542]: Set responsibility to pid: 24747, responsible_path: /System/Library/CoreServices/Installer.app/Contents/MacOS/Installer
Mar  5 12:12:53 hylozoist package_script_service[2542]: ./postinstall: mkdir: /Library/Mail/Bundles: Input/output error
Mar  5 12:12:53 hylozoist package_script_service[2542]: Responsibility set back to self.
Mar  5 12:12:53 hylozoist install_monitor[24855]: Re-included: /Applications, /Library, /System, /bin, /private, /sbin, /usr
Mar  5 12:12:53 hylozoist installd[2520]: PackageKit: releasing backupd
Mar  5 12:12:53 hylozoist installd[2520]: PackageKit: allow user idle system sleep
Mar  5 12:12:53 hylozoist installd[2520]: PackageKit: Cleared responsibility for install from 24747.
Mar  5 12:12:53 hylozoist installd[2520]: PackageKit: Cleared permissions on Installer.app
Mar  5 12:12:53 hylozoist installd[2520]: PackageKit: Install Failed: Error Domain=PKInstallErrorDomain Code=112 "An error occurred while running scripts from the package “MailTrackerBlocker.pkg”." UserInfo={NSFilePath=./postinstall, NSURL=file:///Users/foobar/Downloads/2021-03-05/MailTrackerBlocker.pkg#Core.pkg, PKInstallPackageIdentifier=com.onefatgiraffe.mailtrackerblocker, NSLocalizedDescription=An error occurred while running scripts from the package “MailTrackerBlocker.pkg”.} {
	    NSFilePath = "./postinstall";
	    NSLocalizedDescription = "An error occurred while running scripts from the package \U201cMailTrackerBlocker.pkg\U201d.";
	    NSURL = "file:///Users/foobar/Downloads/2021-03-05/MailTrackerBlocker.pkg#Core.pkg";
	    PKInstallPackageIdentifier = "com.onefatgiraffe.mailtrackerblocker";
	}
Mar  5 12:12:53 hylozoist installd[2520]: PackageKit: Running idle tasks
Mar  5 12:12:53 hylozoist Installer[24747]: install:didFailWithError:Error Domain=PKInstallErrorDomain Code=112 "An error occurred while running scripts from the package “MailTrackerBlocker.pkg”." UserInfo={NSFilePath=./postinstall, NSURL=file:///Users/foobar/Downloads/2021-03-05/MailTrackerBlocker.pkg#Core.pkg, PKInstallPackageIdentifier=com.onefatgiraffe.mailtrackerblocker, NSLocalizedDescription=An error occurred while running scripts from the package “MailTrackerBlocker.pkg”.}
Mar  5 12:12:53 hylozoist installd[2520]: PackageKit: Removing client PKInstallDaemonClient pid=24747, uid=502 (/System/Library/CoreServices/Installer.app/Contents/MacOS/Installer)
Mar  5 12:12:53 hylozoist installd[2520]: PackageKit: Done with sandbox removals
Mar  5 12:12:54 hylozoist Installer[24747]: Install failed: The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.
Mar  5 12:12:54 hylozoist Installer[24747]: IFDInstallController C16841C0 state = 8
Mar  5 12:12:54 hylozoist Installer[24747]: Displaying 'Install Failed' UI.
Mar  5 12:12:54 hylozoist Installer[24747]: 'Install Failed' UI displayed message:'The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.'.

@grischard
Copy link
Author

Workaround:

This was caused by /Library/Mail/Bundles being a symlink to /System/Volumes/Data/MailBundles/Library/Mail/Bundles which did not exist (and wouldn't be writable anyway).

One workaround is to:

rm /Library/Mail/Bundles
mkdir /Library/Mail/Bundles

@apparition47
Copy link
Owner

@grischard Thank you for the detailed report (and for solving your own issue?😅).

This seems to be the same as #27. I'm not sure why some users have this symlink to begin with. This makes me a bit iffy about touching it through the postinstall script.

@grischard
Copy link
Author

grischard commented Mar 5, 2021

Indeed! I should have checked how old the link was - no idea where it came from. I've been dragging this user profile from Mac to Mac since forever, so maybe this is ruins from an ancient civilisation of developers or something.

The installer could detect if /Library/Mail/Bundles is a dangling symlink, and auto-fix it? -L means it's a link, ! -e means does not exist.

if [[ -L "$targetDir" ]] && [[ ! -e "$targetDir" ]]; then
  rm "$targetDir"
  mkdir "$targetDir"
fi

The test could also use -w instead or on top of -e to see if we can write to the target.

@apparition47
Copy link
Owner

Thanks for the insight.

I have a clean Big Sur setup (i.e. no prior migrations) and it doesn't have this issue. But I might end up doing your suggestion since this doesn't seem to be an isolated case. Lots of users end up inheriting odd settings like this for every macOS update.

@grischard
Copy link
Author

We can close this then. Thank you very much!

Clean Big Sur setup? I envy you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants