Hello ๐
I had a script being canceled and I don't understand why. Is there a way to check what canceled it?
The mode is set to "restart" but there has not been another instance of triggering of the script.
I am aware of the constraints of having delays in scripts/automations, my question is solely related to how to debug this.
Anybody got a clue to see what triggered canceling the script?
Thank you in advance.
#How can I figure out what canceled a script?
1 messages ยท Page 1 of 1 (latest)
I would assume it is in there. Could you share the complete trace? 3-dots => Download trace.
of course - here's the trace
https://dpaste.com/FQT7SJBA7 here's the same trace again in case you prefer to have it displayable without having to download it
could it be that it was started again?
should be visible by a trace after this one
as you have mode: restart that will cancel the current run
that was my initial thought as well
it was not started again - the trace I sent it the most recent run
did you make changes to the script, or did you restart HA?
not that I'm aware of - I use this script on a regular basis and I'm not aware anything like that happened before
even though the automation calling the script is set to parallel there seems to have been some glitch that aborted the previous run and terminated the script
I now switched it to script.turn_on (@fierce token thanks again for making me aware of this option here #1399986278757302395 message) that should stop this from happening again
thank you both!
Iโm trying to follow along to figure out what happened, so I can learn also. Let me know if this is right:
- You had another script (script 1) that called this script (script 2) from a
parallelblock. It was called via the blocking method (script.script_2) rather thanscript.turn_on. - Other actions were also called from that parallel block.
- Another action in the parallel block errored out, and cancelled script 1
- This cancelled all active actions, including script 2
Does that sound right?
nearly - here's what was happening:
I have a script that I use for warnings (the script in question that got aborted). The mode of this script is set to restart as there might be multiple, independent warnings in a row and I want all of them to be handled.
The script calls another script which is sending a notification the phones of my wife and me, turns lamps in the living room yellow, waits 5 minutes and turns the lamps off again.
The automation that called the "warn script" was set to parallel, in the specific case it told us that the vacuum robot is full. The mode is parallel as we have multiple vacuum robots - also the automation clears the message on our phones when the vacuum was emptied. Until the error happened the warn script was called using the blocking script.scriptname method - I now changed that to the non-blocking script.turn_on method.
Something now aborted the warn script and I have no idea what it was. I did not edit the script, home assistant did not restart and there hasn't been another call that would have aborted the run (because of the restart mode)
In this specific case the result was that the light in the living room stayed yellow until I manually turned it off.
I hope this all makes sense.
But shouldn't the script itself not be set to parallel as well then?