munkiadmin icon indicating copy to clipboard operation
munkiadmin copied to clipboard

macOS 12.0.1 & MunkiAdmin

Open ckarabell opened this issue 3 years ago • 12 comments

I am currently testing macOS 12 for my company, and was running through all our standard softwares, and decided to test my platform management suite, and I got a message when starting MunkiAdmin today that it will not be supported on future macOS releases and needs to be updated. Currently running the most recent release.

No issue as of yet, didn't see any other posts in the "issues" forum, so thought I would just quickly post it here.

ckarabell avatar Oct 27 '21 16:10 ckarabell

I too also saw the message. Not sure why though. According to System Information, it's a Universal app.

RedClawx avatar Nov 01 '21 14:11 RedClawx

That message means that something in the app made a call to the system Python environment. Monterey is most likely the last OS to include that framework so Apple is being overt that soon apps will break that make the call to the system framework.

Best bet would be to include its own python framework in the app going forward.

poundbangbash avatar Nov 01 '21 14:11 poundbangbash

Im getting this warning message when trying to open AutoPkgr on macOS Monterey for the first time and it then sends you too https://www.python.org/doc/sunset-python-2/.

So the python part of the code might need to be updated to python 3 or is it some left over python 2 code maybe?

Seems like AutoPkgr also gets this warning.

image

lifeunexpected avatar Nov 03 '21 09:11 lifeunexpected

I'm getting these prompts too when launching MunkiAdmin the first time on a fresh install. It seems to be triggered by a call to munki's own CLI tools if they exist. Specifically, when MunkiAdmin launches, it runs /usr/local/munki/makepkginfo --version and /usr/local/munki/makecatalogs --version to get their version. Disabling these checks in code makes the prompt disappear.

This is an interesting bug since there's no Python 2 (nor 3) code in MunkiAdmin and there's also no Python 2 in the latest Munki. Yet we get an alert and the system thinks we're trying to run legacy python.

hjuutilainen avatar Nov 08 '21 11:11 hjuutilainen

The code that triggers the prompt can be seen here: https://github.com/hjuutilainen/munkiadmin/blob/d70cff53df629334e7227be327d638775bbd26ca/MunkiAdmin/Singletons/MAMunkiRepositoryManager.m#L3280-L3351

hjuutilainen avatar Nov 08 '21 11:11 hjuutilainen

/usr/local/munki/makecatalogs itself is using a shebang which will resolve to the Python 2.7 interpreter binary.

[jappleseed]:ad-bind # head -n 5 /usr/local/munki/makecatalogs 
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright 2009-2021 Greg Neagle.
#
[jappleseed]:ad-bind # makecatalogs --version
5.5.1.4367

carlashley avatar Nov 11 '21 02:11 carlashley

Still seeing this on 12.1 (21C52), FWIW.

sethgoldin avatar Jan 19 '22 19:01 sethgoldin

Apple removed python 2.7 in the latest Beta of 12.3 https://developer.apple.com/documentation/macos-release-notes/macos-12_3-release-notes

MarcelRei avatar Jan 28 '22 09:01 MarcelRei

I'm going to move to calling the munki python CLI tools through the python3 bundled with munki. So a call to /usr/local/munki/makecatalogs would become /usr/local/munki/munki-python /usr/local/munki/makecatalogs. Seems to work fine in my testing.

And just to be clear: There is no python code in MunkiAdmin, the warning comes from MunkiAdmin calling makecatalogs which uses the system python by default.

hjuutilainen avatar Jan 28 '22 12:01 hjuutilainen

Has there been any update with this update?? 12.3 has broken munkiadmin with the removable of python 2

johndoenulc avatar Mar 17 '22 10:03 johndoenulc

This has been fixed in the latest Munki release (https://github.com/munki/munki/releases/tag/v5.6.3) and no modifications are needed in MunkiAdmin. The makecatalogs tool contained in the latest Munki release doesn't use the system python by default.

hjuutilainen avatar Mar 17 '22 11:03 hjuutilainen

Thanks for the letting me know. i was running munkitools-5.6.2.4398 so that explains my problem

johndoenulc avatar Mar 17 '22 16:03 johndoenulc