Can token lifetime for actions be a configurable thing? #14840

Closed
opened 2025-11-02 11:24:08 -06:00 by GiteaMirror · 8 comments
Owner

Originally created by @TimB87 on GitHub (Aug 7, 2025).

Description

Hi!

We are building a CI/CD pipeline with rather long running actions, longer that 24h at least.

The invalidated token will produce a http 500 error when uploading the artifact with a final upload-artifact step on the workflow. From giteas server log:

2025/08/01 13:45:44 .../actions/artifacts.go:164:ArtifactsRoutes.ArtifactContexter.2.1() [E] Error runner api getting task: task with token "<token>": resource does not exist
2025/08/01 13:45:44 HTTPRequest [I] router: completed POST /api/actions_pipeline/_apis/pipelines/workflows/473/artifacts?api-version=6.0-preview for <runner_ip>:0, 500 Internal Server Error in 0.2ms @ actions/artifacts.go:127(actions.ArtifactsRoutes.ArtifactContexter)

Is there a reason against making this configurable somehow or is that nothing we should run on the pipeline for reasons I am not seeing yet?

For reference, this is one of the runs that has the problem: https://git.crux.nu/system/crux-rootfs/actions/runs/166

Gitea Version

1.24.4

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.49.0

Operating System

CRUX

How are you running Gitea?

Self compiled Gitea and started by a rc file (sysvinit system).

Database

PostgreSQL

Originally created by @TimB87 on GitHub (Aug 7, 2025). ### Description Hi! We are building a CI/CD pipeline with rather long running actions, [longer that 24h at least](https://github.com/go-gitea/gitea/blob/main/services/actions/auth.go#L56). The invalidated token will produce a http 500 error when uploading the artifact with a final upload-artifact step on the workflow. From giteas server log: ``` 2025/08/01 13:45:44 .../actions/artifacts.go:164:ArtifactsRoutes.ArtifactContexter.2.1() [E] Error runner api getting task: task with token "<token>": resource does not exist 2025/08/01 13:45:44 HTTPRequest [I] router: completed POST /api/actions_pipeline/_apis/pipelines/workflows/473/artifacts?api-version=6.0-preview for <runner_ip>:0, 500 Internal Server Error in 0.2ms @ actions/artifacts.go:127(actions.ArtifactsRoutes.ArtifactContexter) ``` Is there a reason against making this configurable somehow or is that nothing we should run on the pipeline for reasons I am not seeing yet? For reference, this is one of the runs that has the problem: https://git.crux.nu/system/crux-rootfs/actions/runs/166 ### Gitea Version 1.24.4 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version 2.49.0 ### Operating System CRUX ### How are you running Gitea? Self compiled Gitea and started by a rc file (sysvinit system). ### Database PostgreSQL
GiteaMirror added the topic/gitea-actionstype/bug labels 2025-11-02 11:24:08 -06:00
Author
Owner

@ChristopherHX commented on GitHub (Aug 7, 2025):

Sounds like this should match ENDLESS_TASK_TIMEOUT that you increased already from 3h including on the runner side.

https://docs.gitea.com/next/administration/config-cheat-sheet?_highlight=cheat#actions-actions

What do you think?

@ChristopherHX commented on GitHub (Aug 7, 2025): Sounds like this should match ENDLESS_TASK_TIMEOUT that you increased already from 3h including on the runner side. https://docs.gitea.com/next/administration/config-cheat-sheet?_highlight=cheat#actions-actions What do you think?
Author
Owner

@TimB87 commented on GitHub (Aug 7, 2025):

@ChristopherHX We adjusted the ENDLESS_TASK_TIMEOUT to 72h previously but it had no affect for us.
We also raised the timeout values for ZOMBIE_TASK_TIMEOUT and ABANDONED_JOB_TIMEOUT with no effect on this issue, fwiw

@TimB87 commented on GitHub (Aug 7, 2025): @ChristopherHX We adjusted the ENDLESS_TASK_TIMEOUT to 72h previously but it had no affect for us. We also raised the timeout values for ZOMBIE_TASK_TIMEOUT and ABANDONED_JOB_TIMEOUT with no effect on this issue, fwiw
Author
Owner

@ChristopherHX commented on GitHub (Aug 7, 2025):

We adjusted the ENDLESS_TASK_TIMEOUT to 72h previously but it had no affect for us.

My suggestion is to change this where you quoted to take into account ENDLESS_TASK_TIMEOUT

Such a change could be backport candidate for 1.24.5

@ChristopherHX commented on GitHub (Aug 7, 2025): > We adjusted the ENDLESS_TASK_TIMEOUT to 72h previously but it had no affect for us. My suggestion is to change this where you quoted to take into account ENDLESS_TASK_TIMEOUT Such a change could be backport candidate for 1.24.5
Author
Owner

@TimB87 commented on GitHub (Aug 8, 2025):

I'll give it a try, thanks!

@TimB87 commented on GitHub (Aug 8, 2025): I'll give it a try, thanks!
Author
Owner

@TimB87 commented on GitHub (Aug 12, 2025):

@ChristopherHX Can I ask if this is what you had in mind or if this is too simple?

360879ee72

@TimB87 commented on GitHub (Aug 12, 2025): @ChristopherHX Can I ask if this is what you had in mind or if this is too simple? https://github.com/TimB87/gitea/commit/360879ee7289f64d76983ed9b0bf1aa86b0f9aaa
Author
Owner

@ChristopherHX commented on GitHub (Aug 12, 2025):

@ChristopherHX Can I ask if this is what you had in mind or if this is too simple?

TimB87@360879e

Yes more or less exactly like your commit.

I might reduce the +24h maybe a bit to +1h ≈ +5min, because of the additional time.

@ChristopherHX commented on GitHub (Aug 12, 2025): > [@ChristopherHX](https://github.com/ChristopherHX) Can I ask if this is what you had in mind or if this is too simple? > > [TimB87@360879e](https://github.com/TimB87/gitea/commit/360879ee7289f64d76983ed9b0bf1aa86b0f9aaa) Yes more or less exactly like your commit. I might reduce the +24h maybe a bit to +1h ≈ +5min, because of the additional time.
Author
Owner

@TimB87 commented on GitHub (Aug 12, 2025):

Thanks!
This sounds reasonable, I'll change it to 1h+EndlessTaskTimeout after testing and confirming that works for us.

@TimB87 commented on GitHub (Aug 12, 2025): Thanks! This sounds reasonable, I'll change it to 1h+EndlessTaskTimeout after testing and confirming that works for us.
Author
Owner

@TimB87 commented on GitHub (Aug 13, 2025):

My test was successful! Thanks again for the guidance @ChristopherHX!

@TimB87 commented on GitHub (Aug 13, 2025): My test was successful! Thanks again for the guidance @ChristopherHX!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14840