[GH-ISSUE #1731] Failed to run DDEV with ACT (root privilege issue) #849

Closed
opened 2026-03-01 21:46:52 +03:00 by kerem · 2 comments
Owner

Originally created by @julienloizelet on GitHub (Apr 14, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/1731

Bug report info

act version:            0.2.44
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 8
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
	/var/run/docker.sock
Config files:           
	/home/julien/.actrc:
		-P ubuntu-latest=catthehacker/ubuntu:act-latest
		-P ubuntu-22.04=catthehacker/ubuntu:act-22.04
		-P ubuntu-20.04=catthehacker/ubuntu:act-20.04
		-P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
	Go version:            go1.20.2
	Module path:           command-line-arguments
	Main version:          
	Main path:             
	Main checksum:         
	Build settings:
		-buildmode:           exe
		-compiler:            gc
		-ldflags:             -X main.version=0.2.44
		CGO_ENABLED:          1
		CGO_CFLAGS:           
		CGO_CPPFLAGS:         
		CGO_CXXFLAGS:         
		CGO_LDFLAGS:          
		GOARCH:               amd64
		GOOS:                 linux
		GOAMD64:              v1
Docker Engine:
	Engine version:        23.0.3
	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-146-generic
	OS CPU:                8
	OS memory:             31824 MB
	Security options:
		name=apparmor
		name=seccomp,profile=builtin

Command used with act

act  -j act-tests -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:runner-20.04 
and
act  -j act-tests

Describe issue

I have some GitHub actions that use DDEV.

I tried to make it work locally with ACT and it failed.

DDEV is mainly based on Docker, and it seems that something goes wrong with user or permission settings.

I created a simple workflow with 2 steps:

  • step 1: test docker installation
  • step 2: test DDEV installation

When I run act -j act-tests (see the below example workflow), the first step ends with a success but the second failed with this error:

ddev is not designed to be run with root privileges, please run as normal user and without sudo
(This error is triggered by the final command of the workflow ddev config global ...)

I found this issue https://github.com/nektos/act/issues/1184, so I tried to use some other Ubuntu version by running :

act -j act-tests -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:runner-20.04.
But then it seems that Docker is not able to run correctly as the first step failed with some error like :
Got permission denied while trying to connect to the Docker daemon socket at unix

And the second step (ddev config global ...) failed with error : Could not connect to a docker provider. Please start or install a docker provider.

Any idea on how to debug this ?

Thanks

No response

Workflow content

name: ACT tests
on:
  workflow_dispatch:

permissions:
  contents: read


jobs:
  act-tests:
    name: ACT tests
    runs-on: ubuntu-latest

    steps:

      - name: Run Docker
        run: |
          docker run hello-world
        continue-on-error: true

      - name: Install DDEV
      # @see https://ddev.readthedocs.io/en/stable/#installationupgrade-script-linux-and-macos-armarm64-and-amd64-architectures
        run: |
          curl -fsSL https://apt.fury.io/drud/gpg.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/ddev.gpg > /dev/null
          echo "deb [signed-by=/etc/apt/trusted.gpg.d/ddev.gpg] https://apt.fury.io/drud/ * *" | sudo tee /etc/apt/sources.list.d/ddev.list
          sudo apt-get -q update
          sudo apt-get -q -y install libnss3-tools ddev
          mkcert -install
          ddev config global --instrumentation-opt-in=false --omit-containers=dba,ddev-ssh-agent

Relevant log output

| Created a new local CA 💥
| The local CA is now installed in the system trust store! ⚡
| 
| WARN[0000] not reading global config file because running with root privileges 
| Not populating custom commands or hostadditions because running with root privileges
| ddev is not designed to be run with root privileges, please run as normal user and without sudo





| Created a new local CA 💥
| The local CA is now installed in the system trust store! ⚡️
| 
| Could not connect to a docker provider. Please start or install a docker provider.
| For install help go to: https://ddev.readthedocs.io/en/latest/users/install/

Additional information

No response

Originally created by @julienloizelet on GitHub (Apr 14, 2023). Original GitHub issue: https://github.com/nektos/act/issues/1731 ### Bug report info ```plain text act version: 0.2.44 GOOS: linux GOARCH: amd64 NumCPU: 8 Docker host: DOCKER_HOST environment variable is unset/empty. Sockets found: /var/run/docker.sock Config files: /home/julien/.actrc: -P ubuntu-latest=catthehacker/ubuntu:act-latest -P ubuntu-22.04=catthehacker/ubuntu:act-22.04 -P ubuntu-20.04=catthehacker/ubuntu:act-20.04 -P ubuntu-18.04=catthehacker/ubuntu:act-18.04 Build info: Go version: go1.20.2 Module path: command-line-arguments Main version: Main path: Main checksum: Build settings: -buildmode: exe -compiler: gc -ldflags: -X main.version=0.2.44 CGO_ENABLED: 1 CGO_CFLAGS: CGO_CPPFLAGS: CGO_CXXFLAGS: CGO_LDFLAGS: GOARCH: amd64 GOOS: linux GOAMD64: v1 Docker Engine: Engine version: 23.0.3 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-146-generic OS CPU: 8 OS memory: 31824 MB Security options: name=apparmor name=seccomp,profile=builtin ``` ### Command used with act ```sh act -j act-tests -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:runner-20.04 and act -j act-tests ``` ### Describe issue I have some GitHub actions that use [DDEV](https://ddev.readthedocs.io/en/stable/). I tried to make it work locally with ACT and it failed. DDEV is mainly based on Docker, and it seems that something goes wrong with user or permission settings. I created a simple workflow with 2 steps: - step 1: test docker installation - step 2: test DDEV installation When I run `act -j act-tests` (see the below example workflow), the first step ends with a success but the second failed with this error: `ddev is not designed to be run with root privileges, please run as normal user and without sudo` (This error is triggered by the final command of the workflow `ddev config global ...`) I found this issue https://github.com/nektos/act/issues/1184, so I tried to use some other Ubuntu version by running : `act -j act-tests -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:runner-20.04`. But then it seems that Docker is not able to run correctly as the first step failed with some error like : `Got permission denied while trying to connect to the Docker daemon socket at unix` And the second step (`ddev config global ...`) failed with error : `Could not connect to a docker provider. Please start or install a docker provider.` Any idea on how to debug this ? Thanks ### Link to GitHub repository _No response_ ### Workflow content ```yml name: ACT tests on: workflow_dispatch: permissions: contents: read jobs: act-tests: name: ACT tests runs-on: ubuntu-latest steps: - name: Run Docker run: | docker run hello-world continue-on-error: true - name: Install DDEV # @see https://ddev.readthedocs.io/en/stable/#installationupgrade-script-linux-and-macos-armarm64-and-amd64-architectures run: | curl -fsSL https://apt.fury.io/drud/gpg.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/ddev.gpg > /dev/null echo "deb [signed-by=/etc/apt/trusted.gpg.d/ddev.gpg] https://apt.fury.io/drud/ * *" | sudo tee /etc/apt/sources.list.d/ddev.list sudo apt-get -q update sudo apt-get -q -y install libnss3-tools ddev mkcert -install ddev config global --instrumentation-opt-in=false --omit-containers=dba,ddev-ssh-agent ``` ### Relevant log output ```sh | Created a new local CA 💥 | The local CA is now installed in the system trust store! ⚡ | | WARN[0000] not reading global config file because running with root privileges | Not populating custom commands or hostadditions because running with root privileges | ddev is not designed to be run with root privileges, please run as normal user and without sudo | Created a new local CA 💥 | The local CA is now installed in the system trust store! ⚡️ | | Could not connect to a docker provider. Please start or install a docker provider. | For install help go to: https://ddev.readthedocs.io/en/latest/users/install/ ``` ### Additional information _No response_
kerem 2026-03-01 21:46:52 +03:00
Author
Owner

@github-actions[bot] commented on GitHub (Oct 12, 2023):

Issue is stale and will be closed in 14 days unless there is new activity

<!-- gh-comment-id:1758718982 --> @github-actions[bot] commented on GitHub (Oct 12, 2023): Issue is stale and will be closed in 14 days unless there is new activity
Author
Owner

@adrianodias8 commented on GitHub (Sep 12, 2024):

not sure if you manged but for future reference or anyone that ends up here
check this out -> https://github.com/nektos/act/issues/1798#issuecomment-2030908166

act --container-options "--group-add $(stat -c %g /var/run/docker.sock)" ...
<!-- gh-comment-id:2346447468 --> @adrianodias8 commented on GitHub (Sep 12, 2024): not sure if you manged but for future reference or anyone that ends up here check this out -> https://github.com/nektos/act/issues/1798#issuecomment-2030908166 ``` act --container-options "--group-add $(stat -c %g /var/run/docker.sock)" ... ```
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#849
No description provided.