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

Restart fails with "The operation couldn't be completed. (Cocoa error 132001.) #25

Closed
robisonba opened this issue Aug 26, 2019 · 10 comments

Comments

@robisonba
Copy link

Testing erase-install from the self-service app and I receive the error:
Restart fails with "The operation couldn't be completed. (Cocoa error 132001.)

I believe this is related to quitting the Self Service app. If I wait before clicking OK I see the following message on the screen:

Your Mac hasn't restarted because "Self Service" failed to quit. To continue restarting, quit "Self Service".

Clicking OK on the Cocoa message and clicking Try Again on the "hasn't restarted" message results in the machine restarting with the installer.

@grahampugh
Copy link
Owner

I've also come across this, but not exclusively when using erase-install, but when running any policy that takes longer, such as an Office or Adobe installation. I consider it a bug with Self Service, but I will ask if there is a recommended way to close the app by script (I use pkill).

@ZJPat
Copy link

ZJPat commented Dec 26, 2019

I have the same issue as well it failed to reboot. I did what Grahampugh suggested and run it the self-service from terminal and succeeded. I will open a ticket with JAMF if someone has a reference bug I would appreciate it.

@ryangball
Copy link
Contributor

@grahampugh was this resolved with your updates in 900ad86?

@grahampugh
Copy link
Owner

grahampugh commented Feb 19, 2020

Hard to say as it doesn’t usually happen to me - only if the download takes so long that Self Service does its silly timeout thing, which hasn’t happened to me in testing these changes. Please test :)

@ryangball
Copy link
Contributor

@grahampugh Tested on a VM that is connected to a NAS for storage (so not super quick). 900ad86 worked fine for me. I will test again tomorrow and see about how long the download takes. I tend to always use --overwrite as I've seen issues in the past with Apple's expired certs in Mojave installers. @robisonba and @zpatrickson, if you are able to test, please do.

@ZJPat
Copy link

ZJPat commented Feb 28, 2020

I had a chance to further test the script, I'm still facing the same issue mostly with Catalina build when I run the Erase-Install from Self-Service. If I rerun the policy off of terminal no problem at all.

@ryangball
Copy link
Contributor

I was able to successfully run the script by manually adding install_args+=("--forcequitapps") on line 629, which forced the argument even on non-Catalina machines. This VM was running Mojave and using the 10.15.4 installer. The existing script is set up in a way where the --forcequitapps argument is only available to machines with Catalina already installed, but I believe the --forcequitapps argument is available when using the Catalina installer even on non-Catalina machines.

Output from ./startosinstall --usage on a Mojave machine with the 10.15.4 installer:

$ ./startosinstall --usage
Usage: startosinstall

Arguments
--license, prints the user license agreement only.
--agreetolicense, agree to the license you printed with --license.
--rebootdelay, how long to delay the reboot at the end of preparing. This delay is in seconds and has a maximum of 300 (5 minutes).
--pidtosignal, Specify a PID to which to send SIGUSR1 upon completion of the prepare phase. To bypass "rebootdelay" send SIGUSR1 back to startosinstall.
--installpackage, the path of a package (built with productbuild(1)) to install after the OS installation is complete; this option can be specified multiple times.
--eraseinstall, (Requires APFS) Erase all volumes and install to a new one. Optionally specify the name of the new volume with --newvolumename.
--newvolumename, the name of the volume to be created with --eraseinstall.
--preservecontainer, preserves other volumes in your APFS container when using --eraseinstall.
--forcequitapps, on restart applications are forcefully quit. This is the default if no users are logged in.
--usage, prints this message.

Example: startosinstall

I bring this up because making --forcequitapps default when using Catalina installers might help this issue.

@ryangball
Copy link
Contributor

ryangball commented Apr 9, 2020

Okay after a second glance, I think that there is a typo on line 629.

Current line:
elif [[ "$installed_os_version" -ge "15" ]]; then

What it should be:
elif [[ "$installer_os_version" -ge "15" ]]; then

This would force --forcequitapps if the installer is a Catalina installer.

@ryangball
Copy link
Contributor

Created #37 to fix above.

@grahampugh
Copy link
Owner

I've merged your PR. Hopefullt that does the trick - thanks!

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

4 participants