[GH-ISSUE #2132] $XDG_RUNTIME_DIR is set but the directory is not present #1017

Closed
opened 2026-03-01 21:48:14 +03:00 by kerem · 4 comments
Owner

Originally created by @kortschak on GitHub (Dec 17, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/2132

Bug report info

act version:            0.2.55
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 8
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
	/var/run/docker.sock
Config files:           
	/home/daniel/.actrc:
		-P ubuntu-latest=catthehacker/ubuntu:full-latest
		-P ubuntu-22.04=catthehacker/ubuntu:full-22.04
		-P ubuntu-20.04=catthehacker/ubuntu:full-20.04
		-P ubuntu-18.04=catthehacker/ubuntu:full-18.04
Build info:
	Go version:            go1.20.11
	Module path:           github.com/nektos/act
	Main version:          (devel)
	Main path:             github.com/nektos/act
	Main checksum:         
	Build settings:
		-buildmode:           exe
		-compiler:            gc
		-ldflags:             -s -w -X main.version=0.2.55 -X main.commit=95ff5bf299a18833b19f157386184539ad6f4e64 -X main.date=2023-12-01T02:17:59Z -X main.builtBy=goreleaser
		CGO_ENABLED:          0
		GOARCH:               amd64
		GOOS:                 linux
		GOAMD64:              v1
		vcs:                  git
		vcs.revision:         95ff5bf299a18833b19f157386184539ad6f4e64
		vcs.time:             2023-12-01T02:17:43Z
		vcs.modified:         false
Docker Engine:
	Engine version:        20.10.21
	Engine runtime:        runc
	Cgroup version:        1
	Cgroup driver:         cgroupfs
	Storage driver:        overlay2
	Registry URI:          https://index.docker.io/v1/
	OS:                    Ubuntu 18.04.6 LTS
	OS type:               linux
	OS version:            18.04
	OS arch:               x86_64
	OS kernel:             5.4.0-150-generic
	OS CPU:                8
	OS memory:             15825 MB
	Security options:
		name=apparmor
		name=seccomp,profile=default

Command used with act

act

Describe issue

The $XDG_RUNTIME_DIR env var is set, but the directory it points to is not present and cannot be made (the second part as is correct). When a GitHub actions is run, the var is also set, but the runtime dir is available, see here for the same workflow there.

The XDG spec says that an application should be prepared to handle cases where the variable is not set and provide an alternative. It does not say that a set var can point to a non-existent directory and handle that case.

If $XDG_RUNTIME_DIR is not set applications should fall back to a replacement directory with similar capabilities and print a warning message.

The work flow here is a minised reproducer. In the actual work flow the behaviour here breaks the build.

https://github.com/kortschak/counter_act

Workflow content

name: CI

on:
  push

jobs:
  build:
    strategy:
      matrix:
        platform:
        - ubuntu-latest

    runs-on: ${{ matrix.platform }}

    steps:
    - name: unit tests
      run: |
        XDG_RUNTIME_ROOT=$(dirname $XDG_RUNTIME_DIR)
        XDG_RUNTIME_ROOT_ROOT=$(dirname $XDG_RUNTIME_ROOT)
        echo "$XDG_RUNTIME_DIR:"
        ls $XDG_RUNTIME_DIR || true
        echo "$XDG_RUNTIME_ROOT:"
        ls $XDG_RUNTIME_ROOT || true
        echo "$XDG_RUNTIME_ROOT_ROOT:"
        ls $XDG_RUNTIME_ROOT_ROOT || true

Relevant log output

[CI/build] 🚀  Start image=catthehacker/ubuntu:full-latest
INFO[0000] Parallel tasks (0) below minimum, setting to 1 
[CI/build]   🐳  docker pull image=catthehacker/ubuntu:full-latest platform= username= forcePull=true
INFO[0003] Parallel tasks (0) below minimum, setting to 1 
[CI/build]   🐳  docker create image=catthehacker/ubuntu:full-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[CI/build]   🐳  docker run image=catthehacker/ubuntu:full-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[CI/build]   🐳  docker exec cmd=[chown -R 1001:127 /home/daniel/thinking/counter_act] user=0 workdir=
[CI/build] 🧪  Matrix: map[platform:ubuntu-latest]
[CI/build] ⭐ Run Main unit tests
[CI/build]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0] user= workdir=
| /run/user/1001:
| ls: cannot access '/run/user/1001': No such file or directory
| /run/user:
| ls: cannot access '/run/user': No such file or directory
| /run:
| act  docker.sock
[CI/build]   ✅  Success - Main unit tests
[CI/build] Cleaning up container for job build
[CI/build] 🏁  Job succeeded

Additional information

No response

Originally created by @kortschak on GitHub (Dec 17, 2023). Original GitHub issue: https://github.com/nektos/act/issues/2132 ### Bug report info ```plain text act version: 0.2.55 GOOS: linux GOARCH: amd64 NumCPU: 8 Docker host: DOCKER_HOST environment variable is not set Sockets found: /var/run/docker.sock Config files: /home/daniel/.actrc: -P ubuntu-latest=catthehacker/ubuntu:full-latest -P ubuntu-22.04=catthehacker/ubuntu:full-22.04 -P ubuntu-20.04=catthehacker/ubuntu:full-20.04 -P ubuntu-18.04=catthehacker/ubuntu:full-18.04 Build info: Go version: go1.20.11 Module path: github.com/nektos/act Main version: (devel) Main path: github.com/nektos/act Main checksum: Build settings: -buildmode: exe -compiler: gc -ldflags: -s -w -X main.version=0.2.55 -X main.commit=95ff5bf299a18833b19f157386184539ad6f4e64 -X main.date=2023-12-01T02:17:59Z -X main.builtBy=goreleaser CGO_ENABLED: 0 GOARCH: amd64 GOOS: linux GOAMD64: v1 vcs: git vcs.revision: 95ff5bf299a18833b19f157386184539ad6f4e64 vcs.time: 2023-12-01T02:17:43Z vcs.modified: false Docker Engine: Engine version: 20.10.21 Engine runtime: runc Cgroup version: 1 Cgroup driver: cgroupfs Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Ubuntu 18.04.6 LTS OS type: linux OS version: 18.04 OS arch: x86_64 OS kernel: 5.4.0-150-generic OS CPU: 8 OS memory: 15825 MB Security options: name=apparmor name=seccomp,profile=default ``` ### Command used with act ```sh act ``` ### Describe issue The `$XDG_RUNTIME_DIR` env var is set, but the directory it points to is not present and cannot be made (the second part as is correct). When a GitHub actions is run, the var is also set, but the runtime dir is available, see [here](https://github.com/kortschak/counter_act/actions/runs/7237450110/job/19717121883) for the same workflow there. The [XDG spec](https://specifications.freedesktop.org/basedir-spec/basedir-spec-0.8.html) says that an application should be prepared to handle cases where the variable is not set and provide an alternative. It does not say that a set var can point to a non-existent directory and handle that case. > If `$XDG_RUNTIME_DIR` is not set applications should fall back to a replacement directory with similar capabilities and print a warning message. The work flow here is a minised reproducer. In the actual work flow the behaviour here breaks the build. ### Link to GitHub repository https://github.com/kortschak/counter_act ### Workflow content ```yml name: CI on: push jobs: build: strategy: matrix: platform: - ubuntu-latest runs-on: ${{ matrix.platform }} steps: - name: unit tests run: | XDG_RUNTIME_ROOT=$(dirname $XDG_RUNTIME_DIR) XDG_RUNTIME_ROOT_ROOT=$(dirname $XDG_RUNTIME_ROOT) echo "$XDG_RUNTIME_DIR:" ls $XDG_RUNTIME_DIR || true echo "$XDG_RUNTIME_ROOT:" ls $XDG_RUNTIME_ROOT || true echo "$XDG_RUNTIME_ROOT_ROOT:" ls $XDG_RUNTIME_ROOT_ROOT || true ``` ### Relevant log output ```sh [CI/build] 🚀 Start image=catthehacker/ubuntu:full-latest INFO[0000] Parallel tasks (0) below minimum, setting to 1 [CI/build] 🐳 docker pull image=catthehacker/ubuntu:full-latest platform= username= forcePull=true INFO[0003] Parallel tasks (0) below minimum, setting to 1 [CI/build] 🐳 docker create image=catthehacker/ubuntu:full-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host" [CI/build] 🐳 docker run image=catthehacker/ubuntu:full-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host" [CI/build] 🐳 docker exec cmd=[chown -R 1001:127 /home/daniel/thinking/counter_act] user=0 workdir= [CI/build] 🧪 Matrix: map[platform:ubuntu-latest] [CI/build] ⭐ Run Main unit tests [CI/build] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0] user= workdir= | /run/user/1001: | ls: cannot access '/run/user/1001': No such file or directory | /run/user: | ls: cannot access '/run/user': No such file or directory | /run: | act docker.sock [CI/build] ✅ Success - Main unit tests [CI/build] Cleaning up container for job build [CI/build] 🏁 Job succeeded ``` ### Additional information _No response_
kerem 2026-03-01 21:48:14 +03:00
  • closed this issue
  • added the
    kind/bug
    label
Author
Owner

@ChristopherHX commented on GitHub (Dec 17, 2023):

Should I remove the XDG_RUNTIME_DIR from the image dump?

Or add it as empty folder?

It's not a bug of act, that image is part of https://github.com/ChristopherHX/runner-image-blobs. E.g. Uploading the VM to ghcr.io and mirror it to the well known tags

<!-- gh-comment-id:1859144473 --> @ChristopherHX commented on GitHub (Dec 17, 2023): Should I remove the XDG_RUNTIME_DIR from the image dump? Or add it as empty folder? It's not a bug of act, that image is part of <https://github.com/ChristopherHX/runner-image-blobs>. E.g. Uploading the VM to ghcr.io and mirror it to the well known tags
Author
Owner

@kortschak commented on GitHub (Dec 17, 2023):

@ChristopherHX Thanks. Yeah, either of those options is acceptable.

<!-- gh-comment-id:1859246273 --> @kortschak commented on GitHub (Dec 17, 2023): @ChristopherHX Thanks. Yeah, either of those options is acceptable.
Author
Owner

@ChristopherHX commented on GitHub (Dec 17, 2023):

@kortschak Can you confirm if this issue is fixed by updating the images? (should be updated by default, by running act)

e.g The XDG_RUNTIME_DIR folder should exist as of now.

<!-- gh-comment-id:1859284301 --> @ChristopherHX commented on GitHub (Dec 17, 2023): @kortschak Can you confirm if this issue is fixed by updating the images? (should be updated by default, by running act) e.g The XDG_RUNTIME_DIR folder should exist as of now.
Author
Owner

@kortschak commented on GitHub (Dec 18, 2023):

@ChristopherHX That fixes the behaviour in the reported workflow, and the real workflow shows that the ownership is also correct. Thank you for the rapid fix.

<!-- gh-comment-id:1859468701 --> @kortschak commented on GitHub (Dec 18, 2023): @ChristopherHX That fixes the behaviour in the reported workflow, and the real workflow shows that the ownership is also correct. Thank you for the rapid fix.
Sign in to join this conversation.
No milestone
No project
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
starred/act#1017
No description provided.