I set the Timer for a Server Action, but it is not working at a scheduled time. I checked the Action itself, and it works. Tried both local and UTC time zones. Then I activated and ran the Timer from the Service Center as well, but it is not running. The 'Last Run' is always set to 'never'. What can be the reason?
Quick answer:
Timeout is set to 0 minutes. It can't start as it would be late.
Why:
In OutSystems you need to set a timeout for timer. 0 does not mean "run forever". Timers should run fast and if there is a lot of data, run often.
How to see it:
On the logs you can see "Timer failed before starting: please check if there are any errors in this module " and on details "The operation has timed out".
Oh crap! I set it to zero right when I added this Timer, thinking it is a parameter for delay. I'm not sure why it's set to 20 by default, but according to your explanation it should be any positive number to be able to run. As far as I get, timeout is the amount of time within which the action must be completed, am I right?
Now it works. Thank you so much!
Yes. Timeout is for how long it could run. A margin of 10% is given before killing it to prevent "almosts", but should run in less than the time given.
You said to finish in 0 minutes. With 10% more it goes to 0 minutes so it failed to start as it was already time to kill it.
That delay that you wanted is not configurable. The "run at" is in fact a "try to start at" and there is always a delay that can be just a couple of seconds or some hours depending on the load, number of servers, priority...
There are some videos and masterclasses on timers that you should watch.
Got it, thanks!
Do check
Hi @Smus ,
Please run the timer manually from the Service Center and debug the issue. If it still doesn't work, I recommend contacting OutSystems support.
Thanks,
Vipin Yadav
I noticed that my comment was disliked, even though I believe it is correct. Could the person who disliked it kindly share their feedback or reason? It would help me understand and improve.
I checked your OML and faced the same issue as you. However, I created another timer and ran it from the Service Center, and it worked successfully.
I have attached the OML file for your reference. Please check.
Hi,
Here you can follow step by step approach to find out the root cause.
1. Check the schedule of the timer in service center and ensure its activated or not. If not need to activate before.
2. Ensure you are not updating timer's scheduled time programmatically.
3. If still not working run timer manually from service center and ensure it get executed without error.
regards
I tried to run it manually again. Upon clicking on 'Run now' the message 'The Timer was scheduled to run immediately.' appears, but nothing is happening.
Environment health shows 0 errors.
Monitoring -> Timers - "No logs to show".
I also tried assigning another Server Action, but it doesn't work. Both actions work from the button widget.
The only thing I can think of is: both actions use SQL to UPDATE data in the entity. Might there be any restrictions for that kind of actions if you use Timers? I doubt it, but what if?
Check the errors tab if there is an error from some action that is been used by the timer.
Regards
Gonçalo Almeida
No errors at all.
Have you tried @Vikas Sharma answer ? specially number 1.
If this is disabled, then you need to start the scheduler service
Hey @Smus
If you have already reviewed the Environmental Health, checked the error logs, and debugged the timer by running it manually, but still cannot identify the root cause, I recommend raising a support ticket with OutSystems. Ensure you include all relevant details to expedite the resolution process.
Additionally, if feasible, try running the timer in a different environment to determine whether the issue is environment-specific or persists across all environments.
Hi Smus,
Is it just this specific timer that doesn't run? Do other timers run without a problem?
Yes, thanks. I am about to open a support ticket. Not yet checked deeper into the Environment Health, but I'll let you know if something wrong there.
@Kilian Hekhuis I only tried another Server Action, as I mentioned, but they both include SQL widget. Perhaps I need to assign something different.
I'll attach a screenshot of the Timer & SQL script, and app's .oml file as well.