The AppleScript app I maintain just stops at some point, however what point varies. I suspect it gets stopped for some reason, but I can’t figure out why…
From my own log-statements in AppleScript, I suspect it stops while waiting for the results of a child process. It’s a call to psql
, which queries or updates our postgres database. Something like:
set cmd_result to do shell script "export PGCONNECT_TIMEOUT=5; " & ¬
"/path/to/psql --no-psqlrc postgresql://localhost:5432 " & ¬
"-f /path/to/sql/file.sql"
The psql
command is bundled with the app, and is a Universal build for both Intel as Apple silicon. The app itself is signed, notarized & stapled with SD Notary. I also use the Dialog Toolkit Plus for dialogs.
Because of logging, I know the command has started. And because the database hasn’t been altered (and also the logging after this command hasn’t ran), I guess the process gets stopped somehow. The app just stops (dot under app icon in dock disappears) and there is no error message.
And sometimes the app just runs fine, even running all the pqsl
commands. At the start of the script, there are psql
commands for reading data. I know in the beginning the script also gets stopped, but I haven’t been able to narrow this down. However, at the end, there are two psql
commands: I’ve seen multiple times the app gets stopped at the 1st, but also at the 2nd psql
command…
I haven’t been able to reproduce it reliably. It happens both on Ventura and Sonoma (I haven’t got other installations at the moment). I’ve also ran Console.app
along the crash, and the following entries got my attention, but I haven’t got a clue as what they mean:
applet:
__delegate_identifier__:Performance Diagnostics__:::____message__:This method should not be called on the main thread as it may lead to UI unresponsiveness.
__delegate_identifier__:Performance Diagnostics__:::____message__:Synchronous URL loading of <private> should not occur on this application's main thread as it may lead to UI unresponsiveness. Please switch to an asynchronous networking API such as URLSession.
tccd:
TCCDProcess: identifier=nl.archipunt.zaak-script, pid=19680, auid=502, euid=502, binary_path=/Applications/Script voor Zaken.app/Contents/MacOS/applet attempted to call TCCAccessRequest for kTCCServiceAccessibility without the recommended com.apple.private.tcc.manager.check-by-audit-token entitlement
Prompting policy for hardened runtime; service: kTCCServiceAddressBook requires entitlement com.apple.security.personal-information.addressbook but it is missing for accessing={TCCDProcess: identifier=nl.archipunt.zaak-script, pid=19680, auid=502, euid=502, binary_path=/Applications/Script voor Zaken.app/Contents/MacOS/applet}, requesting={TCCDProcess: identifier=com.apple.mds, pid=339, auid=0, euid=0, binary_path=/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Support/mds},
Prompting policy for hardened runtime; service: kTCCServiceCalendar requires entitlement com.apple.security.personal-information.calendars but it is missing for accessing={TCCDProcess: identifier=nl.archipunt.zaak-script, pid=19680, auid=502, euid=502, binary_path=/Applications/Script voor Zaken.app/Contents/MacOS/applet}, requesting={TCCDProcess: identifier=com.apple.mds, pid=339, auid=0, euid=0, binary_path=/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Support/mds},
runningboardd:
RBSStateCapture remove item called for untracked item 389-324-72111 (target:[app<application.nl.archipunt.zaak-script.6556885.6556894(502)>:19680])
About the Performance Diagnostics__: I suspect they have to do with the Dialog Toolkit Plus, but they don’t seem to be the reason my app is quit.
About the tccd messages:
- I don’t know why I would need the
com.apple.private.tcc.manager.check-by-audit-token
entitlement. - Same for
com.apple.security.personal-information.addressbook.
: as far as I know I don’t use the Contacts.app - Same for
com.apple.security.personal-information.calendars
.
Anyways, I’m a bit stuck here. What information am I missing here.
Why could my app be stopped by presumably MacOS? Where can I look for more info. What do I look for in Console.app. Any answer would be appreciated.