Task stops executing until tasker is disabled and re-enabled

358 views
Skip to first unread message

Nick Gardner

unread,
Jan 20, 2018, 6:25:30 AM1/20/18
to Tasker
I have a task running on a loop. To ensure that it never dies completely I have a profile set for every 2 minutes to run the task. Since the task aborts copies, this sort of acts as a watchdog.

This used to work great for me, most of the time it would run from days to weeks without issues. But now that I have changed most of my logic to Javascript I am having problems after a few hours.

One of the things I tried was to have a rerun task that the origin task runs at priority+1. The rerun task first stops the origin task entirely, then runs it again at priority-1 so that the rerun task won't stay running.

This helped, but at some point, the task will not run at all until tasker is disabled and enabled again.

Here is an example of it working normally:

20180120 02.56.00 P Instant  ID4       Every 2m
20180120 02.56.00 E Start    ID0:0.0  TaskService
20180120 02.56.00 T Running  ID3      Run
20180120 02.56.00 A OK       ID3.1    Run.If
20180120 02.56.00 A OK       ID3.2    Run.HTTP Get
20180120 02.56.00 A OK       ID3.3    Run.Var Set, %LastScript=1516445820
20180120 02.56.00 T Running  ID5:2    Rerun
20180120 02.56.00 A OK       ID3.4    Run.Perform Task, Rerun
20180120 02.56.00 A OK       ID5:2.1  Rerun.Stop
20180120 02.56.00 T ExitOK   ID3      Run
20180120 02.56.01 A OK       ID5:2.2  Rerun.Wait
20180120 02.56.01 T Running  ID3:3    Run
20180120 02.56.01 A OK       ID5:2.3  Rerun.Perform Task, Run
20180120 02.56.01 T ExitOK   ID5:2    Rerun
20180120 02.56.01 A OK       ID3:3.1  Run.If
20180120 02.56.01 A OK       ID3:3.6  Run.JavaScript
20180120 02.56.01 T Running  ID-354:4 JSI:3:-936496730
20180120 02.56.01 A OK       ID-354:4.1 JSI:3:-936496730.Run Shell
20180120 02.56.01 T ExitOK   ID-354:4 JSI:3:-936496730
20180120 02.56.01 T Running  ID-355:5 JSI:3:1425153782
20180120 02.56.01 A OK       ID-355:5.1 JSI:3:1425153782.Run Shell
20180120 02.56.02 T ExitOK   ID-355:5 JSI:3:1425153782
20180120 02.56.02 T Running  ID-356:6 JSI:3:1649921135
20180120 02.56.02 A OK       ID-356:6.1 JSI:3:1649921135.Run Shell
20180120 02.56.03 T ExitOK   ID-356:6 JSI:3:1649921135
20180120 02.56.03 T Running  ID-357:7 JSI:3:385713919
20180120 02.56.03 A OK       ID-357:7.1 JSI:3:385713919.Run Shell
20180120 02.56.03 T ExitOK   ID-357:7 JSI:3:385713919
20180120 02.56.03 T Running  ID-358:8 JSI:3:-1476669316
20180120 02.56.03 A OK       ID-358:8.1 JSI:3:-1476669316.Run Shell
20180120 02.56.03 T ExitOK   ID-358:8 JSI:3:-1476669316
20180120 02.56.03 T Running  ID-359:9 JSI:3:1898177403
20180120 02.56.03 A OK       ID-359:9.1 JSI:3:1898177403.Run Shell
20180120 02.56.05 T Running  ID-360:10 JSI:3:743893578
20180120 02.56.05 A OK       ID-360:10.1 JSI:3:743893578.Wait
20180120 02.56.05 T ExitOK   ID-360:10 JSI:3:743893578
20180120 02.56.05 T Running  ID-361:11 JSI:3:-350372945
20180120 02.56.05 A Err      ID-361:11.1 JSI:3:-350372945.Load Image
20180120 02.56.05 T ExitErr  ID-361:11 JSI:3:-350372945
20180120 02.56.05 T Running  ID-362:12 JSI:3:-1271801810
20180120 02.56.06 A OK       ID-362:12.1 JSI:3:-1271801810.Wait
20180120 02.56.06 T ExitOK   ID-362:12 JSI:3:-1271801810
20180120 02.56.06 T Running  ID-363:13 JSI:3:635163085
20180120 02.56.06 A Err      ID-363:13.1 JSI:3:635163085.Save Image
20180120 02.56.06 T ExitErr  ID-363:13 JSI:3:635163085
20180120 02.56.06 T Running  ID-364:14 JSI:3:1885022614
20180120 02.56.06 A OK       ID-364:14.1 JSI:3:1885022614.Wait
20180120 02.56.06 T ExitOK   ID-364:14 JSI:3:1885022614
20180120 02.56.06 T Running  ID-365:15 JSI:3:-248350903
20180120 02.56.06 A OK       ID-365:15.1 JSI:3:-248350903.Run Shell
20180120 02.56.06 T ExitOK   ID-365:15 JSI:3:-248350903
20180120 02.56.07 T Running  ID-366:16 JSI:3:-493326862
20180120 02.56.07 A OK       ID-366:16.1 JSI:3:-493326862.Wait
20180120 02.56.07 T ExitOK   ID-366:16 JSI:3:-493326862
20180120 02.56.07 T Running  ID-367:17 JSI:3:-1000642666
20180120 02.56.07 A OK       ID-367:17.1 JSI:3:-1000642666.Run Shell
20180120 02.56.07 T ExitOK   ID-367:17 JSI:3:-1000642666
20180120 02.56.07 T Running  ID-368:18 JSI:3:790912091
20180120 02.56.07 A OK       ID-368:18.1 JSI:3:790912091.Run Shell
20180120 02.56.07 T ExitOK   ID-368:18 JSI:3:790912091
20180120 02.56.07 T Running  ID-369:19 JSI:3:-732474446
20180120 02.56.07 A OK       ID-369:19.1 JSI:3:-732474446.Run Shell
20180120 02.56.08 T ExitOK   ID-359:9 JSI:3:1898177403
20180120 02.56.09 T ExitOK   ID-369:19 JSI:3:-732474446

And here is an example of when it is no longer working:

20180120 03.04.00 P Instant  ID4       Every 2m
20180120 03.04.00 T Running  ID-3004:375 JSI:2302:-984201292
20180120 03.04.00 T Running  ID-3005:376 JSI:2302:-119799323
20180120 03.04.00 A OK       ID-3005:376.1 JSI:2302:-119799323.Run Shell
20180120 03.04.00 T Running  ID-3006:377 JSI:2302:263550860
20180120 03.04.00 T Running  ID-3007:378 JSI:2302:-507455570
20180120 03.04.00 A OK       ID-3007:378.1 JSI:2302:-507455570.Run Shell
20180120 03.04.00 A OK       ID-3006:377.1 JSI:2302:263550860.Run Shell
20180120 03.04.00 T ExitOK   ID-3005:376 JSI:2302:-119799323
20180120 03.04.00 A OK       ID-3004:375.1 JSI:2302:-984201292.Run Shell
20180120 03.04.00 T ExitOK   ID-3007:378 JSI:2302:-507455570
20180120 03.04.00 T ExitOK   ID-3004:375 JSI:2302:-984201292
20180120 03.04.01 T ExitOK   ID-3006:377 JSI:2302:263550860
20180120 03.06.00 P Instant  ID4       Every 2m
20180120 03.06.00 T Running  ID-3009:379 JSI:2302:-2134589073
20180120 03.06.00 T Running  ID-3010:380 JSI:2302:-1827936338
20180120 03.06.00 A OK       ID-3010:380.1 JSI:2302:-1827936338.Run Shell
20180120 03.06.00 T Running  ID-3011:381 JSI:2302:2074347881
20180120 03.06.00 A OK       ID-3011:381.1 JSI:2302:2074347881.Run Shell
20180120 03.06.00 T Running  ID-3012:382 JSI:2302:-169384417
20180120 03.06.00 A OK       ID-3012:382.1 JSI:2302:-169384417.Run Shell
20180120 03.06.00 A OK       ID-3009:379.1 JSI:2302:-2134589073.Run Shell
20180120 03.06.00 T ExitOK   ID-3010:380 JSI:2302:-1827936338
20180120 03.06.00 T ExitOK   ID-3009:379 JSI:2302:-2134589073
20180120 03.06.00 T ExitOK   ID-3011:381 JSI:2302:2074347881
20180120 03.06.00 T ExitOK   ID-3012:382 JSI:2302:-169384417

Rich D

unread,
Jan 20, 2018, 8:27:08 AM1/20/18
to Tasker Google Groups Post


Here is an example of it working normally:


It might help to post the exported profile and task descriptions.



To post your profile or task here...  Long press on the profile or task name / ( 3 dot menu with 4.0+ ) export / export "DESCRIPTION" to clipboard (not XML)

Any linked tasks will be exported with the profile they are linked to..

To be able to export, The beginner mode needs to be off and the profile needs to be named by you (Not the Tasker listed name.  Tasker will list your profile with the context name if you have not given it one).



20180120 03.06.00 T ExitOK   ID-3010:380 JSI:2302:-1827936338

I am not familiar with the run log from a javascript like this. usually a negative ID number indicates a internal Tasker task is running but it must also be used for javascripts as well.

There is definitely a issue with the task execution numbers. I do not believe these should ever get this high. (this is where the descriptions might help)

It certainly looks and sounds like a issue I had in the past that did turn out to be a Tasker bug.


Try backing all the way out of tasker then run the tasks above see if the execution numbers keep building. 

Nick Gardner

unread,
Jan 20, 2018, 6:22:56 PM1/20/18
to Tasker
  1. Profile: Every 2m (4)
  2.     Time:  Every 2m
  3. Enter: Anon (6)
  4.     A1: Perform Task [ Name:Run Priority:%priority -1 Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ] If [ %TRUN !~ *,Run,* ]
  5.  
  6. Run (3)
  7.     A1: If [ %TIMES > %LastScript ]
  8.     A2: HTTP Get [ Server:Port:http://%Host/getjs/ Path: Attributes: Cookies: User Agent: Timeout:10 Mime Type: Output File:run.js Trust Any Certificate:Off Continue Task After Error:On ]
  9.     A3: Variable Set [ Name:%LastScript To:%TIMES + 60 Recurse Variables:Off Do Maths:On Append:Off ]
  10.     A4: Perform Task [ Name:Rerun Priority:%priority + 1 Parameter 1 (%par1):Run Parameter 2 (%par2): Return Value Variable: Stop:Off ]
  11.     A5: End If
  12.     A6: JavaScript [ Path:run.js Libraries: Auto Exit:Off Timeout (Seconds):50 Continue Task After Error:On ]
  13.     A7: Wait [ MS:%waittime Seconds:0 Minutes:0 Hours:0 Days:0 ]
  14.     A8: Goto [ Type:Action Number Number:1 Label: ]
  15.  
  16.  
  17. Rerun (2)
  18.     A1: Stop [ With Error:Off Task:%par1 ]
  19.     A2: Wait Until [ MS:0 Seconds:15 Minutes:0 Hours:0 Days:0 ] If [ %TRUN !~ *,Run,* ]
  20.     A3: Perform Task [ Name:%par1 Priority:%priority - 1 Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ]

I realize it looks weird but I am just trying things to get it to not stack up the task queue. Even though "Run" is set to abort new executions, I was still getting task queue alerts. I think it is fixed by manually telling the profile not to execute "Run" if it's already running and but using "Rerun" to kill "Run" and start it again every minute.

However despite the fact that I am killing "Run" and restarting it every minute, I still get that JS task id build up.

Everything works fine until after a few hours and it just stops doing anything. Backing out of tasker doesn't fix it. I would happily accept any solution, even a hacky one, to get this working.

Rich D

unread,
Jan 20, 2018, 6:46:10 PM1/20/18
to Tasker Google Groups Post

  1. Run (3)
  2.     A1: If [ %TIMES > %LastScript ]
  3.     A2: HTTP Get [ Server:Port:http://%Host/getjs/ Path: Attributes: Cookies: User Agent: Timeout:10 Mime Type: Output File:run.js Trust Any Certificate:Off Continue Task After Error:On ]
  4.     A3: Variable Set [ Name:%LastScript To:%TIMES + 60 Recurse Variables:Off Do Maths:On Append:Off ]
  5.     A4: Perform Task [ Name:Rerun Priority:%priority + 1 Parameter 1 (%par1):Run Parameter 2 (%par2): Return Value Variable: Stop:Off ]
  6.     A5: End If
  7.     A6: JavaScript [ Path:run.js Libraries: Auto Exit:Off Timeout (Seconds):50 Continue Task After Error:On ]
  8.     A7: Wait [ MS:%waittime Seconds:0 Minutes:0 Hours:0 Days:0 ]

I realize it looks weird but I am just trying things to get it to not stack up the task queue. Even though "Run" is set to abort new executions,


Double check that 'run' is set to 'abort existing task'. It should be shown in the description as below and I do  not see it your description. 


Profile: every 2 (437)
Time: 6:34PM
Enter: Task A (438)
Abort Existing Task
A1: Flash [ Text:running Long:On ] 


Rich D

unread,
Jan 20, 2018, 6:56:37 PM1/20/18
to Tasker Google Groups Post
I have very little javascript knowledge. 

What does this action do exactly?

Nick Gardner

unread,
Jan 20, 2018, 8:13:07 PM1/20/18
to Tasker
Run is set to Abort New Task because I don't want to interrupt it if it is already running and it is supposed to be running most of the time. The profile is simply meant to ensure that if the loop ever stops, it will start up again within 2 minutes.

The javascript action is running a javascript file that it downloads. That script is doing a bunch of shell commands and different logic. It's actually fairly complex.

I don't know if it is because of the complexity, but it does seem to have to do with the javascript action. As I said before, I had a similar setup with no issues where I did everything with actions.

I have noticed that the javascript action will use the same script, even if it loops and I tell it to use a different file. It will load the JS file once and use that one to matter what until the task actually stops and starts again. This is partly why I have the weird loop setup with the Rerun task. It seems that possibly tasker is doing something weird when a javascript action is called many times in a loop. Like, there is a stack or something that is never popped during the execution service.

Rich D

unread,
Jan 21, 2018, 9:35:10 AM1/21/18
to Tasker Google Groups Post

Run is set to Abort New Task because I don't want to interrupt it if it is already running and it is supposed to be running most of the time. The profile is simply meant to ensure that if the loop ever stops, it will start up again within 2 minutes.

Ok. 


The javascript action is running a javascript file that it downloads. That script is doing a bunch of shell commands and different logic. It's actually fairly complex.

I don't know if it is because of the complexity, but it does seem to have to do with the javascript action.

Agreed. This definitely is something for Pent to look at. I would suggest getting the javascript action to the simplest form that still creates this issue. It appears that Tasker treats (or at least reports ) the javascript action as as a task and   one of the actions within the script is causing another iteration of this sudo task. 



Nick Gardner

unread,
Jan 22, 2018, 4:02:43 AM1/22/18
to Tasker
I have played with it a bit and set up a profile that every 30 minutes, waits 30 seconds (to wait until after the 2 minute watchdog profile) and iterates through all running tasks and closes them all except for the one running. It runs at highest priority. My idea is that the task service would stop after this and restart at the next 2 minute mark. And the logs show that the task service does actually stop then start again after the 2 minute profile runs.

This log is starting right at the end of that that that stops the taskservice and has the first few JSI entries after it. I am not sure what the number means after the dash after ID. But it doesn't seem to be completely resetting whatever needs to be reset. I should add that a single JSI entry seems to show up in the running tasks list and it is successfully stopped. But these numbers don't seem to reset still.

I have not yet had a chance to try to replicate the problem with a smaller piece of javascript.

At this point I would be happy to try anything to reset whatever needs to be reset without interrupting the functioning of the phone.

20180122 00.00.32 T ExitOK   ID5:1426 Killtask
20180122 00.00.32 E Stop     ID0:0.0  TaskService
20180122 00.02.00 P Instant  ID4      Every 2m
20180122 00.02.00 E Start    ID0:0.0  TaskService
20180122 00.02.00 T Running  ID6      Anon
20180122 00.02.00 T Running  ID3:2    Run
20180122 00.02.00 A OK       ID6.1    Anon.Perform Task, Run
20180122 00.02.00 T ExitOK   ID6      Anon
20180122 00.02.00 A OK       ID3:2.1  Run.If
20180122 00.02.00 A OK       ID3:2.2  Run.HTTP Get
20180122 00.02.00 A OK       ID3:2.3  Run.Var Set, %LastScript=1516608180
20180122 00.02.00 T Running  ID2:3    Rerun
20180122 00.02.00 A OK       ID3:2.4  Run.Perform Task, Rerun
20180122 00.02.00 A OK       ID2:3.1  Rerun.Stop
20180122 00.02.00 T ExitOK   ID3:2    Run
20180122 00.02.00 A OK       ID2:3.2  Rerun.Wait Until
20180122 00.02.00 T Running  ID3:4    Run
20180122 00.02.00 A OK       ID2:3.3  Rerun.Perform Task, Run
20180122 00.02.00 T ExitOK   ID2:3    Rerun
20180122 00.02.00 A OK       ID3:4.1  Run.If
20180122 00.02.00 A OK       ID3:4.6  Run.JavaScript
20180122 00.02.00 T Running  ID-9349:5 JSI:4:2114289858
20180122 00.02.00 A OK       ID-9349:5.1 JSI:4:2114289858.Run Shell
20180122 00.02.00 T ExitOK   ID-9349:5 JSI:4:2114289858
20180122 00.02.00 T Running  ID-9350:6 JSI:4:-1155935881
20180122 00.02.00 A OK       ID-9350:6.1 JSI:4:-1155935881.Run Shell
20180122 00.02.02 T ExitOK   ID-9350:6 JSI:4:-1155935881
20180122 00.02.02 T Running  ID-9351:7 JSI:4:-756807822
20180122 00.02.02 A OK       ID-9351:7.1 JSI:4:-756807822.Run Shell
20180122 00.02.02 T ExitOK   ID-9351:7 JSI:4:-756807822
20180122 00.02.02 T Running  ID-9352:8 JSI:4:-135088493
20180122 00.02.02 A OK       ID-9352:8.1 JSI:4:-135088493.Run Shell
20180122 00.02.03 T ExitOK   ID-9352:8 JSI:4:-135088493



Rich D

unread,
Jan 22, 2018, 4:58:55 AM1/22/18
to Tasker Google Groups Post

Hoping Pent could chime in on this one as I do not have much experience with the javascript and how Tasker handles it. These run log entries could actually be correct for all I know. After looking again it almost looks like Tasker starts a separate task for every action in the script. It assigns a new task id number and a new execution ID number. The high execution ID number actually does not seem to be a issue since I am sure you have not set you max queued tasks in tasker preferences  to over 300 and I have seen larger task execution id's working in your run log. 

One thing I do know is that when you stop a task in tasker it will stop the task but  "finish the current action". Looking at your log now you have task id numbers up to 9352. This indicates your Java action has really never completed. So I am assuming the task 'run' has stopped but the Sudo task for your javascript keeps looping. 

Can you just have the javascript loop once within the javascript action then do the loop with a Tasker goto action?  I think that might solve the issue. 

You  will occasionally course need to disable and re-enable Tasker to stop the currently running javascript action. I would even do a reboot while Tasker is disabled to be sure to stop everything. 

Rich D

unread,
Jan 22, 2018, 5:00:37 AM1/22/18
to Tasker Google Groups Post


You  will occasionally course need to disable and re-enable Tasker to stop the currently running javascript action. I would even do a reboot while Tasker is disabled to be sure to stop everything. 

Damm you auto correct......

You  will // of course //  need to disable and re-enable Tasker to stop the currently running javascript action. I would even do a reboot while Tasker is disabled to be sure to stop everything.

Nick Gardner

unread,
Jan 22, 2018, 5:20:43 AM1/22/18
to Tasker
Can you just have the javascript loop once within the javascript action then do the loop with a Tasker goto action?  I think that might solve the issue. 

That's how it works. The javascript runs through and exits. I have an exit() statement and also auto-exit turned on. I use a goto to loop the task and the Javascript action is called again. I don't think it's an issue of the Javascript action not stopping because the task loops fine.

It looks to me like it is specifically the shell function calls that are building up and never resetting. Unfortunately, all the shell calls are pretty necessary. I can't use perform task because I need to run them synchronously and get a result back.

I am not super clear what the numbers actually mean. The runlog page doesn't explain the difference between something like "ID-2:3" and "ID2:3"

Rich D

unread,
Jan 22, 2018, 5:44:50 AM1/22/18
to Tasker Google Groups Post


That's how it works. The javascript runs through and exits. I have an exit() statement and also auto-exit turned on. I use a goto to loop the task and the Javascript action is called again. I don't think it's an issue of the Javascript action not stopping because the task loops fine.

I did not see any regular task actions in your logs once the javascript started. How many shell actions are in the javascript?





I am not super clear what the numbers actually mean. The runlog page doesn't explain the difference between something like "ID-2:3" and "ID2:3"

Yea, I wish Pent would put that in the docs.

It is my understanding that any 'negitive'  task I'd number is a internal Tasker generated task. 

Rich D

unread,
Jan 22, 2018, 6:07:21 AM1/22/18
to Tasker Google Groups Post


That's how it works. The javascript runs through and exits. I have an exit() statement and also auto-exit turned on.

Have you tried turning auto-exit off ? It does specify in the docs one or the other. 

JavaScript(let): Auto Exit

By default, the JavaScript(let) action will end when the main execution sequence is finished.

If you are using asynchronous code e.g. via setTimeout() or other callbacks, you should deselect Auto Exit. You are then responsible yourself for telling Tasker to continue the task by calling exit().

In any case, execution will stop when the timeout configured for the action is reached.


Nick Gardner

unread,
Jan 22, 2018, 7:11:11 AM1/22/18
to Tasker
Quite a few shell functions can be called. It depends on the logic but most of the things I am doing are implemented through shell calls. I will post more log next time I get a chance that shows it going through the Goto to restart the action. But the javascript code has no loops of the main logic, so the fact that it works for a few hours means it is at least looping through the entire task and presumably not hanging in the javascript action.

I have tried every combination of auto-exit and an explicit exit in my code. It was actually originally just the explicit exit with auto exit turned off when I started this thread. I have since tried many combinations of anything I can think of.

Rich D

unread,
Jan 22, 2018, 1:10:12 PM1/22/18
to Tasker Google Groups Post
In the example above for 'not working correctly' it looks like the shell actions are not going in order. Is there any logic in your JavaScript to ensure one shell actions finishes before the next runs? 

Nick Gardner

unread,
Jan 22, 2018, 4:46:55 PM1/22/18
to Tasker
In the example above for 'not working correctly' it looks like the shell actions are not going in order. Is there any logic in your JavaScript to ensure one shell actions finishes before the next runs? 

The shell actions run synchronously, so the entire script blocks until it is done. There is a lot of logic in the script so it is expected for them to not run in the order that they appear in the script. Most of them are wrapped in functions. However, everything in my script is definitely running synchronously, there is no way it would be working at all if it wasn't. I am usually using the result of the shell call. 

Rich D

unread,
Jan 22, 2018, 6:49:24 PM1/22/18
to Tasker Google Groups Post
Ok, here is another theory.  You have this set up so the task 'run'  never gets stopped. Perhaps if you stopped and restarted the task the javascript action might reset as well. Several ways you could do this but I would make a profile with a context of state variable value %trun !~ *,run,* and have that linked to the 'run' task, and just put stop action in place of the goto action in the task. 

Nick Gardner

unread,
Jan 22, 2018, 7:01:30 PM1/22/18
to Tasker
I mentioned a few comments back that I have a profile that kills all tasks every 30 minutes. I can verify in the logs that the taskservice completely stops, nothing is running for about 90 seconds. Yet when it comes back on, the IDs don't reset.

However, for the sake of desperation, I will try the way you just mentioned after I am done testing a minimal JS version that hopefully someone else could reproduce.

Rich D

unread,
Jan 22, 2018, 7:08:53 PM1/22/18
to Tasker Google Groups Post


On Jan 22, 2018 7:01 PM, "Nick Gardner" <nichol...@gmail.com> wrote:
I mentioned a few comments back that I have a profile that kills all tasks every 30 minutes.

sorry, missed that. 







However, for the sake of desperation, I will try the way you just mentioned

It could be a  little different because you are most likely  killing the task while the javascript is running.  The approach I mentioned would stop the task after the javascript has completed.   Might be worth a shot. :/ 





after I am done testing a minimal JS version that hopefully someone else could reproduce.

That would be very helpful. 




Nick Gardner

unread,
Jan 23, 2018, 6:48:11 PM1/23/18
to Tasker
Using the setup where the Task "Test" is called when %TRUN !~ *,Test,* still causes the JSI ID to rise and never reset.

I was able to reproduce the problem with this simple project. Unfortunately it takes hours for it to actually stop working but you can at least see the IDs rising forever. In fact, I am finding that they continue to rise even after tasker is disabled and re-enabled. It requires a restart of the phone to get the number to reset.


<TaskerData sr="" dvi="1" tv="5.1m">
 
<Profile sr="prof3" ve="2">
 
<cdate>1516660002648</cdate>
 
<edate>1516750383472</edate>
 
<id>3</id>
 
<mid0>2</mid0>
 
<Time sr="con0">
 
<fh>-1</fh>
 
<fm>-1</fm>
 
<rep>2</rep>
 
<repval>2</repval>
 
<th>-1</th>
 
<tm>-1</tm>
 
</Time>
 
</Profile>
 
<Project sr="proj0" ve="2">
 
<cdate>1516750359333</cdate>
 
<name>Testproject</name>
 
<pids>3</pids>
 
<tids>2</tids>
 
</Project>
 
<Task sr="task2">
 
<cdate>1516659500421</cdate>
 
<edate>1516750323352</edate>
 
<id>2</id>
 
<nme>Test</nme>
 
<pri>100</pri>
 
<Action sr="act0" ve="7">
 
<code>129</code>
 
<se>false</se>
 
<Str sr="arg0" ve="3">var test = function(){
  return shell('settings get secure android_id', true, 10);
}


for (var i = 0; i&lt;10;i++) {
  test(); // simulate 10 more shell calls
}


flash(test()); // signal that its working


exit();
</Str>
 
<Str sr="arg1" ve="3"/>
 
<Int sr="arg2" val="1"/>
 
<Int sr="arg3" val="45"/>
 
</Action>
 
<Action sr="act1" ve="7">
 
<code>30</code>
 
<Int sr="arg0" val="0"/>
 
<Int sr="arg1" val="4"/>
 
<Int sr="arg2" val="0"/>
 
<Int sr="arg3" val="0"/>
 
<Int sr="arg4" val="0"/>
 
</Action>
 
<Action sr="act2" ve="7">
 
<code>135</code>
 
<Int sr="arg0" val="0"/>
 
<Int sr="arg1" val="1"/>
 
<Str sr="arg2" ve="3"/>
 
</Action>
 
</Task>
</TaskerData>


Rich D

unread,
Jan 23, 2018, 7:27:57 PM1/23/18
to Tasker Google Groups Post


On Jan 23, 2018 6:48 PM, "Nick Gardner" <nichol...@gmail.com> wrote:
Using the setup where the Task "Test" is called when %TRUN !~ *,Test,* still causes the JSI ID to rise and never reset.

I was able to reproduce the problem with this simple project. Unfortunately it takes hours for it to actually stop working but you can at least see the IDs rising forever. In fact, I am finding that they continue to rise even after tasker is disabled and re-enabled. It requires a restart of the phone to get the number to reset.



Great, could you export to sd and post the file as a attachment here? I can't seem to get that xml into tasker. 

Nick Gardner

unread,
Jan 23, 2018, 7:33:39 PM1/23/18
to Tasker
Sure, I didn't realize I could do an attachment.
Testproject.prj.xml

Rich D

unread,
Jan 23, 2018, 8:10:06 PM1/23/18
to Tasker Google Groups Post
Interesting  that the task id on my device started at -2673. I have run javascriptlets before but I have never noticed these negative ID numbers.  So my guess is that the incrementing id is "normal" but does seem strange.


A test with the task liked to a profile with the variable value context of %TRUN !~ *,test,*  shows the id number will continually increase However the execution number Does get reset. 

To be clear in the example below the task execution number is 378

20180120 03.04.00 T ExitOK   ID-3007:378 JSI:2302:-507455570

Can you confirm that the execution number does not reset on your device?


Screenshot_20180123-200147.png

Nick Gardner

unread,
Jan 23, 2018, 8:23:15 PM1/23/18
to Tasker
How long did you run it for? Because using the %TRUN profile method, my JSI execution numbers do still increment. However they do seem to at least reset when the taskservice restarts.

Rich D

unread,
Jan 23, 2018, 8:35:50 PM1/23/18
to Tasker Google Groups Post


How long did you run it for?


Just a few cycles.



Because using the %TRUN profile method, my JSI execution numbers do still increment. However they do seem to at least reset when the taskservice restarts.

Huh..  I will try letting it run longer but the log shows my task service stops and starts with every activation of the profile IE every time the task is stopped and started.  The only reason for the task service to not stop at this point would be if you have another task running.  

To stop all running tasks you can long press the task tab and "IF" any tasks are running there will be a option to stop all tasks. 

BTW the errors shown in my other screen shot were because you had the root option enabled in the shell call. I turned off root and now do not get the errors.




Screenshot_20180123-202748.png

Nick Gardner

unread,
Jan 23, 2018, 8:56:07 PM1/23/18
to Tasker
Strange, the task service does not stop for me. I am testing on a phone with no other tasks or profiles. I killed all tasks just to be sure. I also set root to false just to be sure it wasn't that. I am also backing all the way out of tasker.

Rich D

unread,
Jan 23, 2018, 9:12:55 PM1/23/18
to Tasker Google Groups Post


Strange, the task service does not stop for me.

Well that does not sound good. 

What version of Tasker do you have and what android version is the device?

I have a pixel c tablet  /  Android 8.0 / Tasker Version: 5.1m

I have started the task looping with the %TRUN context. I set the wait to 500ms and took out the flash action. Instead I put in write file action to just put a time stamp in the file. I will let it go for as long as it will go for. 

Rich D

unread,
Jan 24, 2018, 4:06:55 AM1/24/18
to Tasker Google Groups Post
6 hrs and she is still going.. Another update in 8-12 hrs after work.

Rich D

unread,
Jan 24, 2018, 6:58:24 PM1/24/18
to Tasker Google Groups Post
22 hrs still going strong.

I think we can safely assume it is the fact that  on your device the task service is not stopping. 
Screenshot_20180124-184148.png

Nick Gardner

unread,
Jan 24, 2018, 10:38:48 PM1/24/18
to Tasker
I agree. My little profile to kill all tasks every 30 minutes seems to help a lot. After about 24 hours, 1 of 4 phones (they are all identical models and software) stopped working with an execution ID up around 700 something. My hope is that lowering that number to 15 minutes will eliminate any chance of this happening.

So I guess now the question is, why my phones don't stop the task service when using the %TRUN!~ method, and is there something that Pent could do prevent the execution id buildup.

I am using Moto G xt1031, Android 7.1.2 and Tasker 5.1m.

Rich D

unread,
Jan 25, 2018, 5:16:03 AM1/25/18
to Tasker Google Groups Post

Still going after 32 hrs.




I agree. My little profile to kill all tasks every 30 minutes seems to help a lot. After about 24 hours, 1 of 4 phones (they are all identical models and software) stopped working with an execution ID up around 700 something. My hope is that lowering that number to 15 minutes will eliminate any chance of this happening.


Another approach you could try is a preform task action from within the task (in place of the goto action). You would need to set the collision to 'Abort existing task'  perhaps when a new iteration of the task is run it will reset the execution numbers. 




So I guess now the question is, why my phones don't stop the task service when using the %TRUN!~ method, and is there something that Pent could do prevent the execution id buildup.

I would assume Pent would need a long term log for this. There are instructions for this in the userguide under "How do I / can I"  You can send it directly to him just be sure to include a link to this post. 

Rich D

unread,
Jan 25, 2018, 5:26:31 AM1/25/18
to Tasker Google Groups Post
Forgot the run log.
Screenshot_20180125-052410.png

Rich D

unread,
Jan 26, 2018, 4:39:37 AM1/26/18
to Tasker Google Groups Post
After 56 hrs I have stopped the test. It would appear that all works as expected on my device. Hopefully Pent can have a look at why your device is having issues. 
Screenshot_20180126-043519.png
Reply all
Reply to author
Forward
0 new messages