Munki - can't install downloaded software during deployment

I’m trying to get MDS to mimic the behaviour of a DeployStudio workflow I used previously. The MDS workflow is such that I have macOS install, munkitools deploys then I set a script to download available software via munki with:

/usr/local/munki/managedsoftwareupdate

Another script should then install the downloaded software:

usr/local/munki/managedsoftwareupdate --installonly

However, once the MDS workflow is complete and I login, munki has not installed anything. The initial download has worked and Managed Software Center informs me there are apps downloaded and ready to be installed but the install command has not worked during the workflow.

The log from munki confirms as much:

Dec 02 2020 13:55:50 +1030 ### Starting managedsoftwareupdate run: custom ###
Dec 02 2020 13:55:50 +1030 Starting...
Dec 02 2020 13:55:50 +1030 Skipping Apple Software Updates because items to be installed from the Munki repo contain Apple items.
Dec 02 2020 13:55:50 +1030     Preventing idle sleep
Dec 02 2020 13:55:50 +1030 ### Beginning managed installer session ###
Dec 02 2020 13:55:50 +1030 Processing installs
Dec 02 2020 13:55:50 +1030 Installing ffmpeg (1 of 22)
Dec 02 2020 13:55:50 +1030 Installing ffmpeg from ffmpeg_64bit_osx.pkg
Dec 02 2020 13:55:53 +1030  Package name is ffmpeg_64bit_osx
Dec 02 2020 13:55:53 +1030  Installing at base path /
Dec 02 2020 13:55:53 +1030     Preparing for installation…
Dec 02 2020 13:55:53 +1030 ERROR: Unexpected error in munkilib.installer:
Dec 02 2020 13:55:53 +1030 Traceback (most recent call last):
  File "/usr/local/munki/managedsoftwareupdate", line 262, in doInstallTasks
    only_unattended=only_unattended)
  File "/usr/local/munki/munkilib/installer/core.py", line 704, in run
    only_unattended=only_unattended))
  File "/usr/local/munki/munkilib/installer/core.py", line 321, in install_with_info
    item, itempath)
  File "/usr/local/munki/munkilib/installer/core.py", line 197, in handle_apple_package_install
    (retcode, needtorestart) = pkg.install(itempath, item)
  File "/usr/local/munki/munkilib/installer/pkg.py", line 259, in install
    retcode = _run_installer(cmd, env_vars, packagename)
  File "/usr/local/munki/munkilib/installer/pkg.py", line 195, in _run_installer
    _display_installer_output(installinfo)
  File "/usr/local/munki/munkilib/installer/pkg.py", line 127, in _display_installer_output
    display.display_status_minor(phase)
  File "/usr/local/munki/munkilib/display.py", line 150, in display_status_minor
    print('    %s' % msg)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2026' in position 30: ordinal not in range(128)

Needless to say if you run the command once logged in, everything installs just fine so there are no issues with munki. Deploystudio used to install everything prior to the login window appearing. Is the same result achievable with MDS? Sorry there is a similar thread to this dated over 12 months ago but it doesn’t seem to have gone anywhere. Thanks.

It looks like ffmpeg is outputing a non-ascii character in the log and munki is blowing up. Try removing the ffmepg and see if the other items installs.

tim

Hi Tim,

One of the many things I’ve tried was to shuffle/remove the pkgs being installed, to no avail.

To try and narrow down whether this is a boot-related issue with that munki command, the only way I have been able to replicate this once booted into the Finder is to run the script as a .pkg - the log file then reports the same errors.

However as I said earlier, if I type the same command from the script or pkg:

/usr/local/munki/managedsoftwareupdate --installonly

…straight into terminal, despite telling me it needs to run as root, it runs without error once I include sudo.

Since MDS turns these scripts into pkgs, I can see how it is failing to run now but not the why?.

Well rather than go down that “why?” rabbit hole, I stumbled across a munki bootstrapping method, which admittedly I had never needed to use before so I didn’t realise existed.

Works a treat with MDS. I set the command as a script to run after macOS and packages are installed and basically once MDS has finished and boots to the login window, munki then takes over downloading/installing packages before a user logs in.