nektos / act

Run your GitHub Actions locally 🚀
https://nektosact.com
MIT License
54.81k stars 1.37k forks source link

sudo: unable to resolve host $HOST_HOSTNAME: Name or service not known when using `sudo apt-get` in a workflow. #2121

Open JohnDowson opened 10 months ago

JohnDowson commented 10 months ago

Bug report info

act version:            0.2.54
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 12
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
        /var/run/docker.sock
Config files:           
        /home/johnd/.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.21.5
        Module path:           github.com/nektos/act
        Main version:          (devel)
        Main path:             github.com/nektos/act
        Main checksum:         
        Build settings:
                -buildmode:           pie
                -compiler:            gc
                -trimpath:            true
                DefaultGODEBUG:       panicnil=1
                CGO_ENABLED:          1
                GOARCH:               amd64
                GOOS:                 linux
                GOAMD64:              v1
                vcs:                  git
                vcs.revision:         8daeaeff8f613aea9650c7ffdd10853489150a9e
                vcs.time:             2023-11-17T18:31:59Z
                vcs.modified:         true
Docker Engine:
        Engine version:        24.0.7
        Engine runtime:        runc
        Cgroup version:        2
        Cgroup driver:         systemd
        Storage driver:        overlay2
        Registry URI:          https://index.docker.io/v1/
        OS:                    Arch Linux
        OS type:               linux
        OS version:            
        OS arch:               x86_64
        OS kernel:             6.6.5-arch1-1
        OS CPU:                12
        OS memory:             15938 MB
        Security options:
                name=seccomp,profile=builtin
                name=cgroupns

Command used with act

act -j release

Describe issue

My in-progress workflow to fail at a later point.

Link to GitHub repository

No response

Workflow content

on:
  push:
    branches:
      - master

jobs:
  release:
    name: release ${{ matrix.package }} ${{ matrix.target }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        include:
          # - target: x86_64-pc-windows-gnu
            # archive: zip
          #   package: [pcmg rack-designer]
          - target: x86_64-unknown-linux-musl
            # archive: tar.gz tar.xz tar.zst
            package: [pcmg rack-designer]
          # - target: x86_64-apple-darwin
            # archive: zip
          #   package: [pcmg rack-designer]
    steps:
      - uses: actions/checkout@master
      - name: Install dependencies
        run: sudo apt-get install -y libasound2 libasound2-dev libatk1.0-0 libgtk-3-dev
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: nightly
          target: ${{ matrix.target }}
          override: true
      - uses: actions-rs/cargo@v1
        with:
          command: build
          args: --release --package ${{ matrix.package }}
      - uses: softprops/action-gh-release@v1
        with:
          files: |
            target/release/${{ matrix.package }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Relevant log output

[release.yml/release Array x86_64-unknown-linux-musl] [DEBUG] Wrote command 

sudo apt-get install -y libasound2 libasound2-dev libatk1.0-0 libgtk-3-dev

 to 'workflow/1'
[release.yml/release Array x86_64-unknown-linux-musl] [DEBUG] Writing entry to tarball workflow/1 len:76
[release.yml/release Array x86_64-unknown-linux-musl] [DEBUG] Extracting content to '/var/run/act'
[release.yml/release Array x86_64-unknown-linux-musl]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1] user= workdir=
[release.yml/release Array x86_64-unknown-linux-musl] [DEBUG] Exec command '[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1]'
[release.yml/release Array x86_64-unknown-linux-musl] [DEBUG] Working directory '/home/johnd/pets/pcmg'
| sudo: unable to resolve host jdpc-arch: Name or service not known
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
| E: Unable to locate package libasound2
| E: Unable to locate package libasound2-dev
| E: Unable to locate package libatk1.0-0
| E: Couldn't find any package by glob 'libatk1.0-0'
| E: Couldn't find any package by regex 'libatk1.0-0'
| E: Unable to locate package libgtk-3-dev

Additional information

No response

razvanphp commented 10 months ago

I actually get this from setup-php output, not sure if related:

| ==> Setup PHP
| sudo: unable to resolve host linuxkit-566aea8210a3: Name or service not known
| sudo: unable to resolve host linuxkit-566aea8210a3: Name or service not known
| sudo: unable to resolve host linuxkit-566aea8210a3: Name or service not known
| sudo: unable to resolve host linuxkit-566aea8210a3: Name or service not known
| sudo: unable to resolve host linuxkit-566aea8210a3: Name or service not known
| sudo: unable to resolve host linuxkit-566aea8210a3: Name or service not known
| sudo: unable to resolve host linuxkit-566aea8210a3: Name or service not known
| sudo: unable to resolve host linuxkit-566aea8210a3: Name or service not known
| sudo: unable to resolve host linuxkit-566aea8210a3: Name or service not known
| ✓ PHP Switched to PHP 8.1.27
BohdanKarVS commented 6 months ago

+1

BohdanKarVS commented 6 months ago

@JohnDowson @razvanphp have you resolved the issue?

github-actions[bot] commented 3 days ago

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