actions / runner

The Runner for GitHub Actions :rocket:
https://github.com/features/actions
MIT License
4.64k stars 892 forks source link

Runner doesn't start, picks wrong dir for _diag, complains about read-only #3355

Closed colemickens closed 1 week ago

colemickens commented 1 week ago

Describe the bug

Jun 21 17:24:43 rock5b lq1wa87vbdsbhalgc8sq0gyf8x4rsvr3-pre[321472]: + /nix/store/z3ydfna8119mlsw00s7ly2bxy8p4q691-github-runner-2.317.0/bin/Runner.Listener configure --unattended --disableupdate --work /var/lib/github-actions-runners/rock5b-default/work --url https://github.com/colemickens/nixcfg --labels rock5b-default --pat github_pat_11redactUIm --name rock5b-default --replace
Jun 21 17:24:44 rock5b lq1wa87vbdsbhalgc8sq0gyf8x4rsvr3-pre[321493]: Unhandled exception. System.IO.IOException: Read-only file system : '/nix/store/z3ydfna8119mlsw00s7ly2bxy8p4q691-github-runner-2.317.0/lib/_diag'

so, more readably:

Runner.Listener configure --unattended --disableupdate --work /var/lib/github-actions-runners/rock5b-default/work --url https://github.com/colemickens/nixcfg --labels rock5b-default --pat github_pat_11redactUIm --name rock5b-default --replace

followed by it picking '/nix/store/z3ydfna8119mlsw00s7ly2bxy8p4q691-github-runner-2.317.0/lib/_diag' as the _diag dir.

The runner can't even configure itself now. I swear this was working a while ago. Why is it not placing _diag in the work dir???

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Run '....'
  3. See error

Expected behavior A clear and concise description of what you expected to happen.

Runner Version and Platform

Version of your runner?

OS of the machine running the runner? OSX/Windows/Linux/...

What's not working?

Please include error messages and screenshots.

Job Log Output

If applicable, include the relevant part of the job / step log output here. All sensitive information should already be masked out, but please double-check before pasting here.

Runner and Worker's Diagnostic Logs

If applicable, add relevant diagnostic log information. Logs are located in the runner's _diag folder. The runner logs are prefixed with Runner_ and the worker logs are prefixed with Worker_. Each job run correlates to a worker log. All sensitive information should already be masked out, but please double-check before pasting here.

colemickens commented 1 week ago

It's confusing. I had this runner deployed identically (read nixos module) on an x86_64-linux machine (which unfortunately is offline right now).

I've looked at the changelog for the most recent release, and I can't see anything that would indicate why this behavior has changed, so I'm quite stumped. Any advice would be really greatly appreciated.

colemickens commented 1 week ago

Well, looking at code, GetDiagnosticFolderPath, I have no idea how this possibly EVER worked, nor why anyone would think it's a good idea to store diagnostics inside the application directory.

EDIT: well, it's probably this for Linux, and somehow, no less baffling: https://github.com/actions/runner/blob/ecb732eaf45ab06a08a4334a241b0baef3561a57/src/Runner.Common/HostContext.cs#L122

colemickens commented 1 week ago

And why does WriteError not write to stdout. Like, surely Windows even has a more appropriate logging mechanism than this. It must. Since I can't really reasonably expect this to you know, just log to stdout/stderr and just work with journalctl on linux or anything.

colemickens commented 1 week ago

and god, god forbid the Runner be actually documented, instead of every single bit of documentation just saying "run this wrapper script".

colemickens commented 1 week ago

I fixed this by setting RUNNER_ROOT no thanks to non-existent documentation. :+1: