schedule action task not work #12431

Closed
opened 2025-11-02 10:09:38 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @yp05327 on GitHub (Feb 4, 2024).

Description

reported from qq group.

in 1.21.5, schedule action task does not work when the cron is:
0WWJ7EM4U4A 6)5RH$Z( ZM

There is the actions task list:
}J}E3 @VI`51$)P$PT)4SG1

At first, we set the task to run every minitues, and it worked as the action task #75.
(K_$OG(K{ RVT3(QCNX_9K7

Then we changed it to "0 0 * * *", and we can see the action task #76 for this change about 20 hours before.
IJ$ZIXFS((2AUY27D)X2_EQ

But the schedule action task didn't run in about 20 hours.
We check the timezone, it is correct.
@M3) )TNOF$WQ _H6B2LE)X_tmb
55UXQ$)`B)Q)XC0N{N84E20

Gitea Version

1.21.5

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

other user's instance

Database

None

Originally created by @yp05327 on GitHub (Feb 4, 2024). ### Description reported from qq group. in 1.21.5, schedule action task does not work when the `cron` is: ![0WWJ7EM4U4A 6)5RH$Z( ZM](https://github.com/go-gitea/gitea/assets/18380374/a99e96a0-aebe-48cc-9e4b-8deab932f354) There is the actions task list: ![}J}E3 @VI`51$)P$PT)4SG1](https://github.com/go-gitea/gitea/assets/18380374/bc4a80fa-51da-4ae6-9ab6-b3e1463f0394) At first, we set the task to run every minitues, and it worked as the action task #75. ![(K_$OG(K{ RVT3(QCNX_9K7](https://github.com/go-gitea/gitea/assets/18380374/66ec6195-8494-443c-81f4-f6bd41312eab) Then we changed it to "0 0 * * *", and we can see the action task #76 for this change about 20 hours before. ![IJ$ZIXFS((2AUY27D)X2_EQ](https://github.com/go-gitea/gitea/assets/18380374/9166cc32-d8ee-4c67-801b-c8e2997af1eb) But the schedule action task didn't run in about 20 hours. We check the timezone, it is correct. ![@M3) )TNOF$WQ _H6B2LE)X_tmb](https://github.com/go-gitea/gitea/assets/18380374/ed6b60a0-cfcf-429d-a72d-a9c40d69a403) ![55UXQ$)`B)Q)XC0N{N84E20](https://github.com/go-gitea/gitea/assets/18380374/1183e6db-2c59-48ea-96f1-6d90dc4a3569) ### Gitea Version 1.21.5 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? other user's instance ### Database None
GiteaMirror added the type/bug label 2025-11-02 10:09:38 -06:00
Author
Owner

@yp05327 commented on GitHub (Feb 7, 2024):

There's a bug in actions notifier, but don't know whether it is related to this issue.

@yp05327 commented on GitHub (Feb 7, 2024): There's a bug in actions notifier, but don't know whether it is related to this issue.
Author
Owner

@yp05327 commented on GitHub (Feb 7, 2024):

The details of this bug:
I think it comes from #27662.
After this PR, handleSchedules will always delete existing scheduled tasks, and if schedules(which names detectedWorkflows in handleSchedules) is empty, it will return nil.
This may causes a bug, when user forked the repo for creating a PR, detectSchedule is false, so schedules is empty.
Then in handleSchedules, we will delete all existing scheduled tasks in the original repo, and then return.
image
Not sure whether other cases when detectSchedule is false, will also cause unexcepted deletion of existing scheduled tasks.

@yp05327 commented on GitHub (Feb 7, 2024): The details of this bug: I think it comes from #27662. After this PR, `handleSchedules` will always delete existing scheduled tasks, and if `schedules(which names detectedWorkflows in handleSchedules)` is empty, it will return nil. This may causes a bug, when user forked the repo for creating a PR, `detectSchedule` is false, so `schedules` is empty. Then in `handleSchedules`, we will delete all existing scheduled tasks in the original repo, and then return. ![image](https://github.com/go-gitea/gitea/assets/18380374/285c2db5-6d1c-4529-933c-23e1c545bfe3) Not sure whether other cases when `detectSchedule` is false, will also cause unexcepted deletion of existing scheduled tasks.
Author
Owner

@jameshurst commented on GitHub (Feb 8, 2024):

I've been noticing this on 1.21.5 as well. It seems like scheduled actions stop working after a pull request gets merged.

@jameshurst commented on GitHub (Feb 8, 2024): I've been noticing this on 1.21.5 as well. It seems like scheduled actions stop working after a pull request gets merged.
Author
Owner

@github-actions[bot] commented on GitHub (Feb 28, 2024):

Automatically locked because of our CONTRIBUTING guidelines

@github-actions[bot] commented on GitHub (Feb 28, 2024): Automatically locked because of our [CONTRIBUTING guidelines](https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md#issue-locking)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12431