bug: LXC hostexecutor leaks #442

Closed
opened 2025-01-21 10:23:00 +00:00 by earl-warren · 2 comments
Contributor

Can you reproduce the bug on the Forgejo test instance?

Yes

Description

  • Create an LXC runner
  • Run a workflow using LXC
  • See the $HOME/.cache/act/*/hostexecutor is not removed upon completion

Runner Version

All

### Can you reproduce the bug on the Forgejo test instance? Yes ### Description - Create an LXC runner - Run a workflow using LXC - See the $HOME/.cache/act/*/hostexecutor is not removed upon completion ### Runner Version All
viceice reopened this issue 2025-07-28 17:28:22 +00:00
Author
Contributor
time="2025-10-03T08:24:25Z" level=error msg="Error while stop job container FORGEJO-ACTIONS-TASK-194599_WORKFLOW-b818b68f65df58a26df058d95f646db7a37ecb9928dae394fe6f92429abcdc6b_JOB-example-docker-compose: unlinkat /home/debian/.cache/act/e7ebb27720a4abd7/hostexecutor/examples/docker-build-push-action/Dockerfile: permission denied"
time="2025-10-03T08:24:36Z" level=info msg="Cleaning up network for job forgejo, and network name is: WORKFLOW-664d598f0fff03b343bcf0f75a38307e"
time="2025-10-03T08:25:51Z" level=info msg="Cleaning up services for job build and test"
time="2025-10-03T08:25:51Z" level=info msg="Cleaning up network for job build and test, and network name is: WORKFLOW-076ec84a291908fce59db9ba60cf233a"
time="2025-10-03T08:25:53Z" level=info msg="task 194615 repo is forgejo/runner https://code.forgejo.org https://code.forgejo.org"
time="2025-10-03T08:25:55Z" level=info msg="task 194616 repo is forgejo/runner https://code.forgejo.org https://code.forgejo.org"
time="2025-10-03T08:26:19Z" level=error msg="Error while stop job container FORGEJO-ACTIONS-TASK-194615_WORKFLOW-3d3393aed31ee2ff02f6682fbe2e7f9ca8c21ab1117eb2485209a0cf81dfb574_JOB-runner-exec-tests: unlinkat /home/debian/.cache/act/7c1f40baabd74d5a/hostexecutor/examples/docker-build-push-action/Dockerfile: permission denied"
time="2025-10-03T08:29:46Z" level=error msg="Error while stop job container FORGEJO-ACTIONS-TASK-194602_WORKFLOW-0b05dcfd929f32e68a7830bc0cfbeddd2aec61d06e56536a9a9250f7d3f81cef_JOB-example-lxc-systemd: unlinkat /home/debian/.cache/act/b2d1556eae1cfafb/hostexecutor/examples/docker-build-push-action/Dockerfile: permission denied"
time="2025-10-03T08:31:51Z" level=error msg="Error while stop job container FORGEJO-ACTIONS-TASK-194616_WORKFLOW-afe33dd8512a2ef16b89da4a4e04b4abd937d604dd00a5647aa9e1b06ac5ee13_JOB-runner-integration-tests: unlinkat /home/debian/.cache/act/7fa22e0e88777668/hostexecutor/examples/docker-build-push-action/Dockerfile: permission denied"
time="2025-10-03T08:36:52Z" level=error msg="Error while stop job container FORGEJO-ACTIONS-TASK-194606_WORKFLOW-02470b3025b358b7f22ec6ea32e6d39bcf80d51705895feff2e0cdcb9fbce708_JOB-integration-tests: unlinkat /home/debian/.cache/act/e95054374afd827b/hostexecutor/examples/docker-build-push-action/Dockerfile: permission denied"
time="2025-10-03T08:39:56Z" level=info msg="runner: runner shutdown initiated, waiting [runner].shutdown_timeout=3h0m0s for running jobs to complete before shutting down"
time="2025-10-03T08:39:56Z" level=info msg="[poller 4] shutdown"
time="2025-10-03T08:39:56Z" level=info msg="[poller 5] shutdown"
time="2025-10-03T08:39:56Z" level=info msg="[poller 1] shutdown"
time="2025-10-03T08:39:56Z" level=info msg="[poller 3] shutdown"
time="2025-10-03T08:39:56Z" level=info msg="[poller 7] shutdown"
time="2025-10-03T08:39:56Z" level=info msg="[poller 6] shutdown"
time="2025-10-03T08:39:56Z" level=info msg="[poller 0] shutdown"
time="2025-10-03T08:59:03Z" level=info msg="Cleaning up network for job forgejo, and network name is: WORKFLOW-012157855f0978bcf734d904ed25712f"
time="2025-10-03T08:59:03Z" level=info msg="[poller 2] shutdown"

The cleanup fails because the runner does not have permission, it runs as a regular user while the files may belong to root. This is not caught by the tests because they run on the same user and do not actually run a workflow.

``` time="2025-10-03T08:24:25Z" level=error msg="Error while stop job container FORGEJO-ACTIONS-TASK-194599_WORKFLOW-b818b68f65df58a26df058d95f646db7a37ecb9928dae394fe6f92429abcdc6b_JOB-example-docker-compose: unlinkat /home/debian/.cache/act/e7ebb27720a4abd7/hostexecutor/examples/docker-build-push-action/Dockerfile: permission denied" time="2025-10-03T08:24:36Z" level=info msg="Cleaning up network for job forgejo, and network name is: WORKFLOW-664d598f0fff03b343bcf0f75a38307e" time="2025-10-03T08:25:51Z" level=info msg="Cleaning up services for job build and test" time="2025-10-03T08:25:51Z" level=info msg="Cleaning up network for job build and test, and network name is: WORKFLOW-076ec84a291908fce59db9ba60cf233a" time="2025-10-03T08:25:53Z" level=info msg="task 194615 repo is forgejo/runner https://code.forgejo.org https://code.forgejo.org" time="2025-10-03T08:25:55Z" level=info msg="task 194616 repo is forgejo/runner https://code.forgejo.org https://code.forgejo.org" time="2025-10-03T08:26:19Z" level=error msg="Error while stop job container FORGEJO-ACTIONS-TASK-194615_WORKFLOW-3d3393aed31ee2ff02f6682fbe2e7f9ca8c21ab1117eb2485209a0cf81dfb574_JOB-runner-exec-tests: unlinkat /home/debian/.cache/act/7c1f40baabd74d5a/hostexecutor/examples/docker-build-push-action/Dockerfile: permission denied" time="2025-10-03T08:29:46Z" level=error msg="Error while stop job container FORGEJO-ACTIONS-TASK-194602_WORKFLOW-0b05dcfd929f32e68a7830bc0cfbeddd2aec61d06e56536a9a9250f7d3f81cef_JOB-example-lxc-systemd: unlinkat /home/debian/.cache/act/b2d1556eae1cfafb/hostexecutor/examples/docker-build-push-action/Dockerfile: permission denied" time="2025-10-03T08:31:51Z" level=error msg="Error while stop job container FORGEJO-ACTIONS-TASK-194616_WORKFLOW-afe33dd8512a2ef16b89da4a4e04b4abd937d604dd00a5647aa9e1b06ac5ee13_JOB-runner-integration-tests: unlinkat /home/debian/.cache/act/7fa22e0e88777668/hostexecutor/examples/docker-build-push-action/Dockerfile: permission denied" time="2025-10-03T08:36:52Z" level=error msg="Error while stop job container FORGEJO-ACTIONS-TASK-194606_WORKFLOW-02470b3025b358b7f22ec6ea32e6d39bcf80d51705895feff2e0cdcb9fbce708_JOB-integration-tests: unlinkat /home/debian/.cache/act/e95054374afd827b/hostexecutor/examples/docker-build-push-action/Dockerfile: permission denied" time="2025-10-03T08:39:56Z" level=info msg="runner: runner shutdown initiated, waiting [runner].shutdown_timeout=3h0m0s for running jobs to complete before shutting down" time="2025-10-03T08:39:56Z" level=info msg="[poller 4] shutdown" time="2025-10-03T08:39:56Z" level=info msg="[poller 5] shutdown" time="2025-10-03T08:39:56Z" level=info msg="[poller 1] shutdown" time="2025-10-03T08:39:56Z" level=info msg="[poller 3] shutdown" time="2025-10-03T08:39:56Z" level=info msg="[poller 7] shutdown" time="2025-10-03T08:39:56Z" level=info msg="[poller 6] shutdown" time="2025-10-03T08:39:56Z" level=info msg="[poller 0] shutdown" time="2025-10-03T08:59:03Z" level=info msg="Cleaning up network for job forgejo, and network name is: WORKFLOW-012157855f0978bcf734d904ed25712f" time="2025-10-03T08:59:03Z" level=info msg="[poller 2] shutdown" ``` The cleanup fails because the runner does not have permission, it runs as a regular user while the files may belong to root. This is not caught by the tests because they run on the same user and do not actually run a workflow.
Author
Contributor

It runs a workflow and it should fail. Only this is a special case: the directory is created by the user and since no files are created in it, the test is a false positive.

#1054/files

This reproduces the problem in a trivial way: just by creating sub-directories owned by root.

It runs a workflow and it should fail. Only this is a special case: the directory is created by the user and since no files are created in it, the test is a false positive. https://code.forgejo.org/forgejo/runner/pulls/1054/files This reproduces the problem in a trivial way: just by creating sub-directories owned by root.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo/runner#442
No description provided.