semaphoreui / semaphore

Modern UI for Ansible, Terraform, OpenTofu, Bash, Pulumi.
https://semaphoreui.com
MIT License
10.33k stars 1.04k forks source link

Semaphore schedule not working #2214

Open steveiliop56 opened 2 months ago

steveiliop56 commented 2 months ago

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

gaeldb commented 2 months ago

Probably linked with #2204 ?

steveiliop56 commented 2 months ago

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.

Divide1990 commented 2 weeks ago

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:

steveiliop56 commented 2 weeks ago

Yeah seems logical will try it out and report back.