Skip to content

XDG_RUNTIME_DIR is set to non-existent directory on ubuntu-slim runner #13401

@andyn-ff

Description

@andyn-ff

Description

Using the new ubuntu-slim runner we found some issues using just, a command runner which for some cases writes a command script to a temporary file. In these cases we get:

error: I/O error in runtime dir `/run/user/1001/just`: Permission denied (os error 13)

At this point, just is trying to write a file to $XDG_RUNTIME_DIR and then execute it

Some testing reveals that /run/user/1001 is inaccessible - see repro steps below. On ubuntu-latest, $XDG_RUNTIME_DIR is set to /run/user/1001, and this is accessible with rwx permission.

We can work around this temporarily by setting XDG_RUNTIME_DIR to ${{ runner.temp }} but this behaviour doesn't seem deliberate and I'd expect it to work out-of-the-box

Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 22.04
  • Ubuntu 24.04
  • Ubuntu Slim
  • macOS 13
  • macOS 13 Arm64
  • macOS 14
  • macOS 14 Arm64
  • macOS 15
  • macOS 15 Arm64
  • macOS 26 Arm64
  • Windows Server 2019
  • Windows Server 2022
  • Windows Server 2025

Image version and build link

Current runner version: '2.329.0'

Is it regression?

No - this is a new image in public preview

Expected behavior

XDG_RUNTIME_DIR should be set similarly to ubuntu-latest. Output of repro steps command on ubuntu-latest runner:

XDG_RUNTIME_DIR is set to: /run/user/1001
Permissions for XDG_RUNTIME_DIR:
drwx------ 4 runner runner 140 Dec  9 13:29 /run/user/1001

Actual behavior

XDG_RUNTIME_DIR is inaccessible. Output of script:

XDG_RUNTIME_DIR is set to: /run/user/1001
XDG_RUNTIME_DIR does not exist or is not set.

Running ls -ld "$XDG_RUNTIME_DIR" returns an error reporting that /run/user/1001 does not exist

Repro steps

Example script to run in a run step on ubuntu-latest:

echo "XDG_RUNTIME_DIR is set to: $XDG_RUNTIME_DIR"
if [ -n "$XDG_RUNTIME_DIR" ] && [ -d "$XDG_RUNTIME_DIR" ]; then
  echo "Permissions for XDG_RUNTIME_DIR:"
  ls -ld "$XDG_RUNTIME_DIR"
else
  echo "XDG_RUNTIME_DIR does not exist or is not set."
fi

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions