semaphore icon indicating copy to clipboard operation
semaphore copied to clipboard

Semaphore schedule not working

Open steveiliop56 opened this issue 1 year ago • 2 comments

Issue

Hello, I noticed that when I use the schedule feature to run a task the task never actually runs.

Impact

Service (scheduled tasks, alerts)

Installation method

Docker

Database

Postgres

Browser

Chrome

Semaphore Version

2.19.10

Ansible Version

No response

Logs & errors

No error logs from the semaphore container.

Manual installation - system information

No response

Configuration

Here is a screenshot of my task and schedule. Screenshot_20240721_215242_Chrome Screenshot_20240721_215258_Chrome (Sorry unfortunately I am on mobile now)

Additional information

No response

steveiliop56 avatar Jul 21 '24 18:07 steveiliop56

Probably linked with #2204 ?

gaeldb avatar Jul 22 '24 08:07 gaeldb

Not exactly, my schedule exists it just never runs, although I noticed something weird, for some reason my playbooks run at like 12:45 while I set it run on 9:45 and I set the 9:45 5 minutes before and semaphore said next run in 5 minutes but in never actually run.

steveiliop56 avatar Jul 22 '24 08:07 steveiliop56

I think i found the problem but not sure how to fix it. It seems it is using the RTC time to actually check when to execute schedules instead of the local time. Even tho the GUI says within x amount of time. I believe the GUI is based on the local time but the actually cron task is based on the RTC time. I have tested this on my installation and it seems to check out. When i set a task for lets say 01:00 it executes when RTC time is 01:00.

Edit: It appears adding TZ=yourtimezone in docker compose fixes this issue.

Example: environment: - TZ=Europe/Paris

Divide1990 avatar Sep 03 '24 00:09 Divide1990

Yeah seems logical will try it out and report back.

steveiliop56 avatar Sep 03 '24 08:09 steveiliop56

@steveiliop56, @Divide1990, @gaeldb,

Heh, I've been wrestling with the same or similar issues. If I set up a schedule, which should then run, it never runs. I've got two different installations, both use OS packages (.deb and .rpm) and both exhibit the same problem. I've played around with the times in which cron should execute the tasks, but nothing I do seems to help.

In the outline above, local timezone vs. RTC vs. UTC, etc. shouldn't matter if I create a scheduled task two days from now. Still, it doesn't work. I've verified that the task runs just fine by manually triggering it. On one of my instances I've also set up an alert mechanism that pings an external Gotify server as the last task in the playbook. So, it should trigger a "success" message whenever the schedule task runs, but it never does. It does work when I run in manually, though, so I know that's also working.

As of writing, I'm running Semaphore v2.10.35 on both my instances.

Did anyone of you ever figure this one out?

mlanner avatar Nov 18 '24 17:11 mlanner

Unfortunately no, it never worked for me.

steveiliop56 avatar Nov 18 '24 17:11 steveiliop56