macadmins / installapplications

A tool for dynamically using installapplication
Apache License 2.0
285 stars 62 forks source link

Help Troubleshooting M1 with embedded python #95

Closed WiesBen closed 3 years ago

WiesBen commented 3 years ago

Hi *,

I am trying to run the 2.0.3 IA Version on an M1 MacBook Pro. Also embedded the Python.framework as it was in the release notes.

First error which occured:

2021-07-29 05:34:28.236 Python[859:8814] [InstallApplications] Running Script: /Library/installapplications/preflight.py 
2021-07-29 05:34:28.242 Python[859:8814] [InstallApplications] Failure running script:
Traceback (most recent call last):
  File "/Library/installapplications/installapplications.py", line 220, in runrootscript
    proc = subprocess.Popen(pathname, stdout=subprocess.PIPE,
  File "/Library/installapplications/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 947, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Library/installapplications/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1819, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/Library/installapplications/preflight.py'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/installapplications/installapplications.py", line 615, in <module>
    main()
  File "/Library/installapplications/installapplications.py", line 584, in main
    preflightrun = runrootscript(path, donotwait)
  File "/Library/installapplications/installapplications.py", line 234, in runrootscript
    iaslog(str(err.decode('utf-8')))
AttributeError: 'FileNotFoundError' object has no attribute 'decode'

After fixing this decode error, no root script is running anymore and more and more errors are occuring:

2021-07-29 05:36:39.266 Python[924:9910] [InstallApplications] Beginning preflight
2021-07-29 05:36:39.266 Python[924:9910] [InstallApplications] preflight processing rootscript Preflight at /Library/installapplications/preflight.py
2021-07-29 05:36:39.266 Python[924:9910] [InstallApplications] Starting root script: /Library/installapplications/preflight.py
2021-07-29 05:36:39.266 Python[924:9910] [InstallApplications] Running Script: /Library/installapplications/preflight.py 
2021-07-29 05:36:39.271 Python[924:9910] [InstallApplications] Failure running script:
2021-07-29 05:36:39.271 Python[924:9910] [InstallApplications] [Errno 2] No such file or directory: '/Library/installapplications/preflight.py'
2021-07-29 05:36:39.272 Python[924:9910] [InstallApplications] Preflight did not pass all checks. Continuing run.
2021-07-29 05:36:39.272 Python[924:9910] [InstallApplications] Beginning setupassistant
2021-07-29 05:36:39.272 Python[924:9910] [InstallApplications] setupassistant processing package DEPNotify at /Library/installapplications/DEPNotify-1.1.6.pkg
2021-07-29 05:36:39.298 Python[924:9910] [InstallApplications] Installing DEPNotify from /Library/installapplications/DEPNotify-1.1.6.pkg
2021-07-29 05:36:43.077 Python[924:9910] [InstallApplications] setupassistant processing rootscript DEPNotify Customization at /Library/installapplications/depnotify_customization.py
2021-07-29 05:36:43.078 Python[924:9910] [InstallApplications] Starting root script: /Library/installapplications/depnotify_customization.py
2021-07-29 05:36:43.078 Python[924:9910] [InstallApplications] Running Script: /Library/installapplications/depnotify_customization.py 
2021-07-29 05:36:43.080 Python[924:9910] [InstallApplications] Failure running script:
2021-07-29 05:36:43.080 Python[924:9910] [InstallApplications] [Errno 2] No such file or directory: '/Library/installapplications/depnotify_customization.py'
2021-07-29 05:36:43.080 Python[924:9910] [InstallApplications] Beginning userland
2021-07-29 05:36:43.080 Python[924:9910] [InstallApplications] userland processing userscript DEPNotify User Launcher at /Library/installapplications/userscripts/depnotify_user_launcher.py

Funny thing is: All files are in the place they are, don't know why it can not find them. Checked that with:

cat /Library/installapplications/preflight.py
cat /Library/installapplications/depnotify_customization.py 

Does anybody have a hint for me what I can do? Also the logs are not in the log files under /var/log/installapplications ... those files are all empty....

erikng commented 3 years ago

I'd need to see your JSON file.

WiesBen commented 3 years ago

No problem, I jus replace y url with xxx.net:

{
  "preflight": [
    {
      "file": "/Library/installapplications/preflight.py",
      "hash": "c1655b75625d0ea1d28410a0759010e09a5ce2acd2ec6d0ba741df97a9436b95",
      "name": "Preflight",
      "type": "rootscript",
      "url": "https://xxx.net/v2.0.3/installapplications/scripts/root/preflight.py"
    }
  ],
  "setupassistant": [
    {
      "file": "/Library/installapplications/DEPNotify-1.1.6.pkg",
      "hash": "b1382d3fe604ce703a00e02fb7fea0ee2300e66bbd70d6c01adccc50babe02a9",
      "name": "DEPNotify",
      "packageid": "menu.nomad.depnotify",
      "type": "package",
      "url": "https://xxx.net/v2.0.3/installapplications/pkgs/DEPNotify-1.1.6.pkg",
      "version": "1.1.6"
    },
    {
      "file": "/Library/installapplications/depnotify_customization.py",
      "hash": "faa40c3d36fc996ca9740c156d4c1e4ca9fcf65e8b021e51fe8b3e91cf27fea4",
      "name": "DEPNotify Customization",
      "type": "rootscript",
      "url": "https://xxx.net/v2.0.3/installapplications/scripts/root/depnotify_customization.py"
    }
  ],
  "userland": [
    {
      "file": "/Library/installapplications/userscripts/depnotify_user_launcher.py",
      "hash": "ce4543d75eef113fdac5dc1ad28111a6af0d3e7e971078bf4c1979c23e08dad9",
      "name": "DEPNotify User Launcher",
      "type": "userscript",
      "url": "https://xxx.net/v2.0.3/installapplications/scripts/user/depnotify_user_launcher.py"
    },
    {
      "file": "/Library/installapplications/munkitools_launchd-5.1.2.4115.pkg",
      "hash": "c3e8cf172787fc1d42825ecc2f6e28736943ae4237cf1a085e70508fd842d937",
      "name": "Munki (LaunchD)",
      "packageid": "com.googlecode.munki.launchd",
      "type": "package",
      "url": "https://xxx.net/v2.0.3/installapplications/pkgs/munkitools_launchd-5.1.2.4115.pkg",
      "version": "3.0.3265"
    },
    {
      "file": "/Library/installapplications/munkitools_core-5.2.1.4260.pkg",
      "hash": "8a6f226f7b53f10424b94bbb1eba64491890ff0bdc062e0502944dbe30e5c52a",
      "name": "Munki (Core)",
      "packageid": "com.googlecode.munki.core",
      "type": "package",
      "url": "https://xxx.net/v2.0.3/installapplications/pkgs/munkitools_core-5.2.1.4260.pkg",
      "version": "5.2.1.4260"
    },
    {
      "file": "/Library/installapplications/munkitools_python-5.2.1.4260.pkg",
      "hash": "ba4322401fd1e092ccf17dedb6ac1a352813ce5491cd41424c68c06220f5e7a8",
      "name": "Munki (Python)",
      "packageid": "com.googlecode.munki.python",
      "type": "package",
      "url": "https://xxx.net/v2.0.3/installapplications/pkgs/munkitools_python-5.2.1.4260.pkg",
      "version": "3.8.5.4252"
    },
    {
      "file": "/Library/installapplications/dockutil-3.0.pkg",
      "hash": "faabea87b63c98e5a11823c3b8ec6968a10eaf2e55a50143035e7c8cf1adb207",
      "name": "Dockutil Python3",
      "packageid": "com.installapplicationsdemo.dockutil",
      "type": "package",
      "url": "https://xxx.net/v2.0.3/installapplications/pkgs/dockutil-3.0.pkg",
      "version": "3.0"
    },
    {
      "donotwait": true,
      "file": "/Library/installapplications/caffeinate.py",
      "hash": "e954eb90fd0a02ddf0ac92511e06e86cea3e8636de6c2fd37d0413e346f7e973",
      "name": "Caffeinate Machine",
      "type": "rootscript",
      "url": "https://xxx.net/v2.0.3/installapplications/scripts/root/caffeinate.py"
    },
    {
      "file": "/Library/installapplications/munki_bootstrap.py",
      "hash": "a09c59c3333a9594edb0691bac04faf0bb750e141b100e173f5511ea70865368",
      "name": "Munki Bootsrap",
      "type": "rootscript",
      "url": "https://xxx.net/v2.0.3/installapplications/scripts/root/munki_bootstrap.py"
    },
    {
      "file": "/Library/installapplications/munki_auto_trigger.py",
      "hash": "3af3e5570c9f772d992d1ad40e84ea943134165f4cede9ddd930815fa4ac253a",
      "name": "Munki Auto Trigger",
      "type": "rootscript",
      "url": "https://xxx.net/v2.0.3/installapplications/scripts/root/munki_auto_trigger.py"
    },
    {
      "file": "/Library/installapplications/userscripts/dockutil.py",
      "hash": "3407258da0037ff85e65ffd7a55a9df02d4bd0ed5438dbaf0e8c064eebf6aa46",
      "name": "Dockutil User",
      "type": "userscript",
      "url": "https://xxx.net/v2.0.3/installapplications/scripts/user/dockutil.py"
    },
    {
      "file": "/Library/installapplications/munki_launchd_loader.py",
      "hash": "4c67f45d45e57217d4515d578f8a04953ca08bbc9fc4ce730ee99c2120e65ad5",
      "name": "Munki LaunchD Loader",
      "type": "rootscript",
      "url": "https://xxx.net/v2.0.3/installapplications/scripts/root/munki_launchd_loader.py"
    },
    {
      "file": "/Library/installapplications/depnotify_end.py",
      "hash": "b96c92184f2a28920cc6ffddafdb47f54cd3615a7143401a5ba733407dbcd7a2",
      "name": "DEPNotify End",
      "type": "rootscript",
      "url": "https://xxx.net/v2.0.3/installapplications/scripts/root/depnotify_end.py"
    }
  ]
}
WiesBen commented 3 years ago

Sorry Closing this issue I found out the scripts were not updated correctly. The Shebang Line 1 was pointing to an old python version which did not exist, and that is meant by file not found error.....

erikng commented 3 years ago

Nice. Sorry about never getting back to you. I forgot :/