I'm looking for general tips and suggestions for generic troubleshooting steps. I'm having a hell of a time troubleshooting this error:
"More than 50 simultaneous macros - aborting everything"
Any suggestions for how to get to the bottom of this are welcome. If I could just figure out what those 50 macros are, I imagine that would help a lot in troubleshooting this. However, nothing shows up in the log other than the 8 macros that I am intentionally running. Nothing else shows up in the KM menu "cancel" drop down, at least not that I have been able to see.
The log is filled with messages like:
2022-05-06 02:54:46 Running application query took a while (11557 us)
2022-05-06 02:54:47 Running application query took a while (10342 us)
2022-05-06 02:54:47 Running application query took a while (7088 us)
2022-05-06 02:54:48 Running application query took a while (15535 us)
2022-05-06 02:54:48 Running application query took a while (13157 us)
It's my understanding from searching this forum that these log errors and common and not to be concerned about, but given my difficulties perhaps they are relevant to my situation.
Is there a way that the debugger might be able to help in troubleshooting a problem like this? Since each macro seems to work fine, I haven't been able to identify any problems using the debugger, but maybe it has more functionality than I am aware of.
Is there an "advanced logging" feature that might show what actual 50 macros are trying to run or other useful information?
None of my macros trigger themselves based on timers or anything else, they are only started manually with a hot key and run continuously until cancelled.
I use one hot key macro to manually start the 8 macros I am using, and a separate macro hot key that runs the "cancel all macros" command when I want to stop.
My macros are very long and complicated and interact with variables set by each other and I imagine they are more than is reasonable to support here, so I'm particularly interested in learning more troubleshooting steps so that I can improve my skills in continue working through the problems as they come up.
Keyboard Maestro is an invaluable tool and an amazing asset to my workflow, and I imagine I am using it well beyond the intended design so better understanding the tool is very helpful for me.
A general overview of my macro arrangement follows, but can likely be ignored as I am looking more for troubleshooting methodology than specific macro coding.
A general overview of my macro setup:
The 8 macros I am intentionally running are continuous macros that run until cancelled.
They work together as a set, so they are functionally really one purpose (real time monitoring of application states and progress bars in a 25-node 3D rendering farm and sending keystrokes when appropriate).
1 macro monitors pixels on the screen for my actions, progress bars, etc, and sets and adjusts variables accordingly.
1 macro tracks timers based on when functions are used or states are reached and sets variables accordingly.
5 macros are one per application I wish to control. They simply monitor the variables as set by the first two macros, and send the actual keystrokes to the appropriate application as needed.
These macros are used real-time as I am actively working through the day. I am also dynamically changing variables using a floating palette that activates or skips functions in the macros based on my palette selections, just a simple "on/off" state corresponding to If/Then statements in the macro running on a loop. I'm typically working in the front application, with the macros sending keystrokes to the background applications based on my workflow.
I am very commonly stopping and starting my macros based on the workflow needs, so I have one macro that starts the other 7 and one macro that simply stops all macros. These two are used frequently throughout the day.
Every macro has a semaphore lock set on it, with a 1 hundredths second timeout with "abort macro after timeout" - I can't find any macro in my arrangement that should be possible to run more than once, and there are only 8 macros. The "more than 50" error is quite baffling.
My macro that starts my macros also has as it's second command (just after the semaphore lock) "Cancel All other Macros", which shouldn't be needed with the semaphore locks but was added in the hopes it would help with the "more than 50" error - the slate should be wiped clean every time I start the system.
The issue is very intermittent, many times things work as expected, and then sometimes I get the "more than 50" error and things stop, which causes a lot of pain when renders can take many hours.
I cannot reproduce the problem by starting my macros over and over again, the semaphore lock seems to be working in that regard - no matter how many times I try and run a macro, it only seems to run once.