[GH-ISSUE #1254] Workflow fails with act and is successful with github actions #686

Closed
opened 2026-03-01 21:45:31 +03:00 by kerem · 3 comments
Owner

Originally created by @SteveEmmanuel on GitHub (Jul 13, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1254

Bug report info

act version:            0.2.29
GOOS:                   darwin
GOARCH:                 amd64
NumCPU:                 4
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
        /var/run/docker.sock
Config files:           
        /Users/oldtrafford/.actrc:
                -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest
                -P ubuntu-22.04=ghcr.io/catthehacker/ubuntu:act-22.04
                -P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:act-20.04
                -P ubuntu-18.04=ghcr.io/catthehacker/ubuntu:act-18.04
Build info:
        Go version:            go1.18.3
        Module path:           command-line-arguments
        Main version:          
        Main path:             
        Main checksum:         
        Build settings:
                -compiler:            gc
                -ldflags:             -X main.version=0.2.29
                CGO_ENABLED:          1
                CGO_CFLAGS:           
                CGO_CPPFLAGS:         
                CGO_CXXFLAGS:         
                CGO_LDFLAGS:          
                GOARCH:               amd64
                GOOS:                 darwin
                GOAMD64:              v1
Docker Engine:
        Engine version:        20.10.12
        Engine runtime:        runc
        Cgroup version:        2
        Cgroup driver:         cgroupfs
        Storage driver:        overlay2
        Registry URI:          https://index.docker.io/v1/
        OS:                    Docker Desktop
        OS type:               linux
        OS version:            
        OS arch:               x86_64
        OS kernel:             5.10.76-linuxkit
        OS CPU:                2
        OS memory:             3934 MB
        Security options:
                name=seccomp,profile=default
                name=cgroupns

Command used with act

act --secret-file .env

Describe issue

Different outputs when using act and when github actions are run for the same workflow.

No response

Workflow content

name: Django

on:
  push:
    branches: [ "master", "develop" ]
  pull_request:
    branches: [ "master", "develop" ]

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      max-parallel: 4
      matrix:
        python-version: [3.8, 3.9]

    steps:
    - name: Start PostgreSQL on Ubuntu
      run: |
        sudo systemctl start postgresql.service
        pg_isready

    - name: Create additional user
      run: |
        sudo -u postgres psql --command="CREATE USER testuser PASSWORD 'password'" --command="\du"

    - name: Alter user
      run: |
        sudo -u postgres psql --command="ALTER ROLE testuser CREATEDB"

    - name: Create additional database
      run: |
        sudo -u postgres createdb TestDatabase --owner=testuser 
        PGPASSWORD=password 

    - uses: actions/checkout@v3
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v3
      with:
        python-version: ${{ matrix.python-version }}
        cache: pip
    - name: Install Dependencies
      run: |
        python -m pip install --upgrade pip
        pip install -r requirements.txt
    - name: Run Tests
      env:
          DB_HOST: localhost
          DB_NAME: TestDatabase
          DB_USER: testuser
          DB_PASSWORD: password      
      run: |
        python manage.py test

Relevant log output

[Django CI/build-1] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
[Django CI/build-1]   🐳  docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform= username= forcePull=false
[Django CI/build-2] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
[Django CI/build-2]   🐳  docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform= username= forcePull=false
[Django CI/build-1]   🐳  docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Django CI/build-2]   🐳  docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Django CI/build-1]   🐳  docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Django CI/build-2]   🐳  docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Django CI/build-1]   🐳  docker exec cmd=[chown -R 0:0 /Users/oldtrafford/PycharmProjects/***] user=0 workdir=
[Django CI/build-2]   🐳  docker exec cmd=[chown -R 0:0 /Users/oldtrafford/PycharmProjects/***] user=0 workdir=
[Django CI/build-1]   ☁  git clone 'https://github.com/actions/setup-python' # ref=v3
[Django CI/build-2]   ☁  git clone 'https://github.com/actions/setup-python' # ref=v3
[Django CI/build-1] 🧪  Matrix: map[python-version:3.8]
[Django CI/build-1] ⭐ Run Main Start PostgreSQL on Ubuntu
[Django CI/build-1]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0] user= workdir=
| System has not been booted with systemd as init system (PID 1). Can't operate.
| Failed to connect to bus: Host is down
[Django CI/build-1]   ❌  Failure - Main Start PostgreSQL on Ubuntu
[Django CI/build-1] exitcode '1': failure
[Django CI/build-2] 🧪  Matrix: map[python-version:3.9]
[Django CI/build-2] ⭐ Run Main Start PostgreSQL on Ubuntu
[Django CI/build-2]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0] user= workdir=
| System has not been booted with systemd as init system (PID 1). Can't operate.
| Failed to connect to bus: Host is down
[Django CI/build-2]   ❌  Failure - Main Start PostgreSQL on Ubuntu
[Django CI/build-2] exitcode '1': failure
[Django CI/build-1] 🏁  Job failed
[Django CI/build-2] 🏁  Job failed
Error: Job 'build' failed

Additional information

No response

Originally created by @SteveEmmanuel on GitHub (Jul 13, 2022). Original GitHub issue: https://github.com/nektos/act/issues/1254 ### Bug report info ```plain text act version: 0.2.29 GOOS: darwin GOARCH: amd64 NumCPU: 4 Docker host: DOCKER_HOST environment variable is unset/empty. Sockets found: /var/run/docker.sock Config files: /Users/oldtrafford/.actrc: -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest -P ubuntu-22.04=ghcr.io/catthehacker/ubuntu:act-22.04 -P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:act-20.04 -P ubuntu-18.04=ghcr.io/catthehacker/ubuntu:act-18.04 Build info: Go version: go1.18.3 Module path: command-line-arguments Main version: Main path: Main checksum: Build settings: -compiler: gc -ldflags: -X main.version=0.2.29 CGO_ENABLED: 1 CGO_CFLAGS: CGO_CPPFLAGS: CGO_CXXFLAGS: CGO_LDFLAGS: GOARCH: amd64 GOOS: darwin GOAMD64: v1 Docker Engine: Engine version: 20.10.12 Engine runtime: runc Cgroup version: 2 Cgroup driver: cgroupfs Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Docker Desktop OS type: linux OS version: OS arch: x86_64 OS kernel: 5.10.76-linuxkit OS CPU: 2 OS memory: 3934 MB Security options: name=seccomp,profile=default name=cgroupns ``` ### Command used with act ```sh act --secret-file .env ``` ### Describe issue Different outputs when using act and when github actions are run for the same workflow. ### Link to GitHub repository _No response_ ### Workflow content ```yml name: Django on: push: branches: [ "master", "develop" ] pull_request: branches: [ "master", "develop" ] jobs: build: runs-on: ubuntu-latest strategy: max-parallel: 4 matrix: python-version: [3.8, 3.9] steps: - name: Start PostgreSQL on Ubuntu run: | sudo systemctl start postgresql.service pg_isready - name: Create additional user run: | sudo -u postgres psql --command="CREATE USER testuser PASSWORD 'password'" --command="\du" - name: Alter user run: | sudo -u postgres psql --command="ALTER ROLE testuser CREATEDB" - name: Create additional database run: | sudo -u postgres createdb TestDatabase --owner=testuser PGPASSWORD=password - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} cache: pip - name: Install Dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt - name: Run Tests env: DB_HOST: localhost DB_NAME: TestDatabase DB_USER: testuser DB_PASSWORD: password run: | python manage.py test ``` ### Relevant log output ```sh [Django CI/build-1] 🚀 Start image=ghcr.io/catthehacker/ubuntu:act-latest [Django CI/build-1] 🐳 docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform= username= forcePull=false [Django CI/build-2] 🚀 Start image=ghcr.io/catthehacker/ubuntu:act-latest [Django CI/build-2] 🐳 docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform= username= forcePull=false [Django CI/build-1] 🐳 docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Django CI/build-2] 🐳 docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Django CI/build-1] 🐳 docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Django CI/build-2] 🐳 docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Django CI/build-1] 🐳 docker exec cmd=[chown -R 0:0 /Users/oldtrafford/PycharmProjects/***] user=0 workdir= [Django CI/build-2] 🐳 docker exec cmd=[chown -R 0:0 /Users/oldtrafford/PycharmProjects/***] user=0 workdir= [Django CI/build-1] ☁ git clone 'https://github.com/actions/setup-python' # ref=v3 [Django CI/build-2] ☁ git clone 'https://github.com/actions/setup-python' # ref=v3 [Django CI/build-1] 🧪 Matrix: map[python-version:3.8] [Django CI/build-1] ⭐ Run Main Start PostgreSQL on Ubuntu [Django CI/build-1] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0] user= workdir= | System has not been booted with systemd as init system (PID 1). Can't operate. | Failed to connect to bus: Host is down [Django CI/build-1] ❌ Failure - Main Start PostgreSQL on Ubuntu [Django CI/build-1] exitcode '1': failure [Django CI/build-2] 🧪 Matrix: map[python-version:3.9] [Django CI/build-2] ⭐ Run Main Start PostgreSQL on Ubuntu [Django CI/build-2] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/0] user= workdir= | System has not been booted with systemd as init system (PID 1). Can't operate. | Failed to connect to bus: Host is down [Django CI/build-2] ❌ Failure - Main Start PostgreSQL on Ubuntu [Django CI/build-2] exitcode '1': failure [Django CI/build-1] 🏁 Job failed [Django CI/build-2] 🏁 Job failed Error: Job 'build' failed ``` ### Additional information _No response_
kerem 2026-03-01 21:45:31 +03:00
Author
Owner

@catthehacker commented on GitHub (Jul 13, 2022):

Since we use Docker containers, it's not possible to use systemd services.

<!-- gh-comment-id:1183725958 --> @catthehacker commented on GitHub (Jul 13, 2022): Since we use Docker containers, it's not possible to use systemd services.
Author
Owner

@SteveEmmanuel commented on GitHub (Jul 14, 2022):

Thank you for the clarification.

<!-- gh-comment-id:1184325372 --> @SteveEmmanuel commented on GitHub (Jul 14, 2022): Thank you for the clarification.
Author
Owner

@sted commented on GitHub (Dec 13, 2023):

Since we use Docker containers, it's not possible to use systemd services.

What do you suggest as an alternative way to run Postgres?

<!-- gh-comment-id:1853409696 --> @sted commented on GitHub (Dec 13, 2023): > Since we use Docker containers, it's not possible to use systemd services. What do you suggest as an alternative way to run Postgres?
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#686
No description provided.