munki / macadmin-scripts

Scripts of possible interest to macOS admins
Other
2.33k stars 523 forks source link

Error while running scripts from InstallESDDmg.pkg #49

Closed macguy-ag closed 4 years ago

macguy-ag commented 4 years ago

Running on Catalina 10.15.5, trying to acquire 10.15.5, getting this failure:

Making empty sparseimage...
installer: Package name is macOS Catalina
installer: Installing at base path /private/tmp/dmg.wgl4HX
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 “InstallESDDmg.pkg”.)
Command '[u'/usr/sbin/installer', u'-pkg', u'./content/downloads/22/25/061-70033-A_0AY28AEJF9/am7836x4645ittkll95lsmfk166h9yeivs/061-70033.English.dist', u'-target', '/private/tmp/dmg.wgl4HX']' returned non-zero exit status 1
Product installation failed.
gregneagle commented 4 years ago

That error message is coming from /usr/sbin/installer — so have you checked /var/log/install.log for clues?

franton commented 4 years ago

Had the same issue. Here's the hopefully relevant section from the installer log.

2020-05-27 12:09:01-07 C02YR4RGLVDR package_script_service[3923]: link_package: /Users/richardpurves/Desktop/content/downloads/22/25/061-70033-A_0AY28AEJF9/am7836x4645ittkll95lsmfk166h9yeivs/InstallESDDmg.pkg on different device than /private/tmp/dmg.QSqTJ4/Applications/Install macOS Catalina.app/Contents/SharedSupport ... copying
2020-05-27 12:09:01-07 C02YR4RGLVDR package_script_service[3923]: link_package: cp: /Users/richardpurves/Desktop/content/downloads/22/25/061-70033-A_0AY28AEJF9/am7836x4645ittkll95lsmfk166h9yeivs/InstallESDDmg.pkg: Operation not permitted
2020-05-27 12:09:01-07 C02YR4RGLVDR package_script_service[3923]: link_package: chflags: /private/tmp/dmg.QSqTJ4/Applications/Install macOS Catalina.app/Contents/SharedSupport/InstallESD.dmg: No such file or directory
2020-05-27 12:09:01-07 C02YR4RGLVDR package_script_service[3923]: Responsibility set back to self.
2020-05-27 12:09:01-07 C02YR4RGLVDR system_installd[615]: PackageKit: releasing backupd
2020-05-27 12:09:01-07 C02YR4RGLVDR system_installd[615]: PackageKit: allow user idle system sleep
2020-05-27 12:09:01-07 C02YR4RGLVDR system_installd[615]: PackageKit: Install Failed: Error Domain=PKInstallErrorDomain Code=112 "An error occurred while running scripts from the package “InstallESDDmg.pkg”." UserInfo={NSFilePath=link_package, NSURL=file://localhost/Users/richardpurves/Desktop/content/downloads/22/25/061-70033-A_0AY28AEJF9/am7836x4645ittkll95lsmfk166h9yeivs/InstallESDDmg.pkg, PKInstallPackageIdentifier=com.apple.pkg.InstallESDDmg, NSLocalizedDescription=An error occurred while running scripts from the package “InstallESDDmg.pkg”.} {
        NSFilePath = "link_package";
        NSLocalizedDescription = "An error occurred while running scripts from the package \U201cInstallESDDmg.pkg\U201d.";
        NSURL = "file://localhost/Users/richardpurves/Desktop/content/downloads/22/25/061-70033-A_0AY28AEJF9/am7836x4645ittkll95lsmfk166h9yeivs/InstallESDDmg.pkg";
        PKInstallPackageIdentifier = "com.apple.pkg.InstallESDDmg";
    }
macguy-ag commented 4 years ago

I can confirm I'm seeing this same pattern in my /var/logs/install.log file.

Had the same issue. Here's the hopefully relevant section from the installer log.

2020-05-27 12:09:01-07 C02YR4RGLVDR package_script_service[3923]: link_package: /Users/richardpurves/Desktop/content/downloads/22/25/061-70033-A_0AY28AEJF9/am7836x4645ittkll95lsmfk166h9yeivs/InstallESDDmg.pkg on different device than /private/tmp/dmg.QSqTJ4/Applications/Install macOS Catalina.app/Contents/SharedSupport ... copying
2020-05-27 12:09:01-07 C02YR4RGLVDR package_script_service[3923]: link_package: cp: /Users/richardpurves/Desktop/content/downloads/22/25/061-70033-A_0AY28AEJF9/am7836x4645ittkll95lsmfk166h9yeivs/InstallESDDmg.pkg: Operation not permitted
2020-05-27 12:09:01-07 C02YR4RGLVDR package_script_service[3923]: link_package: chflags: /private/tmp/dmg.QSqTJ4/Applications/Install macOS Catalina.app/Contents/SharedSupport/InstallESD.dmg: No such file or directory
2020-05-27 12:09:01-07 C02YR4RGLVDR package_script_service[3923]: Responsibility set back to self.
2020-05-27 12:09:01-07 C02YR4RGLVDR system_installd[615]: PackageKit: releasing backupd
2020-05-27 12:09:01-07 C02YR4RGLVDR system_installd[615]: PackageKit: allow user idle system sleep
2020-05-27 12:09:01-07 C02YR4RGLVDR system_installd[615]: PackageKit: Install Failed: Error Domain=PKInstallErrorDomain Code=112 "An error occurred while running scripts from the package “InstallESDDmg.pkg”." UserInfo={NSFilePath=link_package, NSURL=file://localhost/Users/richardpurves/Desktop/content/downloads/22/25/061-70033-A_0AY28AEJF9/am7836x4645ittkll95lsmfk166h9yeivs/InstallESDDmg.pkg, PKInstallPackageIdentifier=com.apple.pkg.InstallESDDmg, NSLocalizedDescription=An error occurred while running scripts from the package “InstallESDDmg.pkg”.} {
      NSFilePath = "link_package";
      NSLocalizedDescription = "An error occurred while running scripts from the package \U201cInstallESDDmg.pkg\U201d.";
      NSURL = "file://localhost/Users/richardpurves/Desktop/content/downloads/22/25/061-70033-A_0AY28AEJF9/am7836x4645ittkll95lsmfk166h9yeivs/InstallESDDmg.pkg";
      PKInstallPackageIdentifier = "com.apple.pkg.InstallESDDmg";
  }
gregneagle commented 4 years ago

Betting this is a Catalina privacy protection issue (at least in Richard's case) since the working directory is inside his Desktop folder. Try moving the working directory to /Users/Shared and see if the problem goes away.

franton commented 4 years ago

Now that's weird. So my terminal has been granted Full Disk Access but moving it to /Users/Shared did the trick.

macguy-ag commented 4 years ago

Yes, mine just finished successfully in /Users/Shared. Thank you.

keehun commented 4 years ago

Might be worth a helpful note in the script when this error happens? A message like This command often fails when installinstallmacos.py script is placed in a restricted directory. Please move it to /Users/Shared/ and try again.

gregneagle commented 4 years ago

It is covered in the README: https://github.com/munki/macadmin-scripts#installinstallmacospy

I'd rather people read documentation than ask me to write more code!