RunIn Scheduled a Job with no Next Run Time

Anyone ever seen a runIn result in an empty schedule:

The function it is running is very simple and has worked dozens of times before and after unscheduling and running again, worked the next time. The function is fairly straight forware:

runIn(1800,dryerAlert)

I just didn't think that it was possible to get a scheduled job with no time set. Does anyone have any idea what could have caused something like this? I've gone back through the logs and don't see anything.

Update: Could this possibly be due to the hub being down at the time of the event? I know that scheduled jobs will persist after a reboot, but what happens if the time for those scheduled jobs has passed when the hub reboots? I know they don't get run when the hub boots. But I would have thought that they would be cleaned up and thrown away. But it looks like that might not be the case after all. How can I check to see if I have this happening so I can clean it up in my app? Can I recall scheduled jobs? I've never tried to do that before.

Did you ever find out more about this? I had this happen recently as well, with the same symptom as above (PENDING job with no time set). The job had previously run many times without issue.

There was no hub reboot and nothing unusual in System Events around the time it stopped running. It was just running as expected (every 30 seconds, re-queueing itself), then stopped.

No, I didn't.

I just experienced this exact same behavior in an app that has been working fine. Rebooted the hub (which had been done automatically during the night about 7 hours earlier) and the problem went away. This definitely seems like a bug, so tagging @bravenel.

Without a lot more information, there is nothing to be said. This topic is 3 years old, and whatever @Ryan780 was talking about is long gone after many many changes to the hub platform.

@bravenel, I would say that "whatever he was talking about" is not long gone, since I just experienced the exact same problem: A runIn() statement is executed and the "Scheduled Jobs" section of the App Status screen shows the function only as "Pending" but no scheduled time (it was 2 seconds in the future in my case). This is from an app that has been functioning as expected for weeks. I rebooted the hub and the problem went away. The debug logs indicate the app was doing exactly what it's supposed to, but for whatever reason, the runIn() functionality did not complete as usual. Sounds like a bug (albeit a difficult-to-find bug that may have existed for years) to me.

Look, I mean we need to see detail, as in the code, the logs, etc. Descriptions aren't useful. runIn() is used extensively across the platform with no reported problems, but yours. So at first blush, you have to convince me that this isn't a problem that you've created, as opposed to a platform bug. Add logging to your code as well.

@bravenel, let me know if you need anything beyond this...

This code executed:

if (usePos.shadePos != null) {
    queuePrim(thisShade.toLong(), usePos.shadePos.toInteger(), delay)
    if (logEnab) log.debug "Queueing new shadePos of ${usePos.shadePos}"
    delay += 2
}

as shown by this log snippet:

[app:569] 2023-04-26 09:35:07.159 AM [debug] Queueing new shadePos of 0

The queuePrim method:

void queuePrim(Long devId, Integer pos, Integer delay) {
    runIn(delay, "doPrim", [overwrite: false, data: [devId: devId, pos: pos]])
    runIn(delay + 18, "doPrim", [overwrite: false, data: [devId: devId, pos: pos]])
}

The App Status screen showed doPrim listed twice as "Pending" with no other info, and it never executed. I did not take a screen shot of the status screen - you'll have to believe me on that one. Rebooted hub and all was back to normal.

How about adding log.debug that shows the value of delay in queuePrim?

I will do that in case this happens again, but I can promise you that it was 2 on the call this morning.