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

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

Originally created by @JohnDowson on GitHub (Dec 11, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/2121

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.

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

Originally created by @JohnDowson on GitHub (Dec 11, 2023). Original GitHub issue: https://github.com/nektos/act/issues/2121 ### Bug report info ```plain text 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 ```sh act -j release ``` ### Describe issue My in-progress workflow to fail at a later point. ### Link to GitHub repository _No response_ ### Workflow content ```yml 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 ```sh [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_
kerem 2026-03-01 21:48:11 +03:00
Author
Owner

@razvanphp commented on GitHub (Dec 27, 2023):

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
<!-- gh-comment-id:1870067254 --> @razvanphp commented on GitHub (Dec 27, 2023): 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 ```
Author
Owner

@BohdanKarVS commented on GitHub (Apr 25, 2024):

+1

<!-- gh-comment-id:2077486152 --> @BohdanKarVS commented on GitHub (Apr 25, 2024): +1
Author
Owner

@BohdanKarVS commented on GitHub (Apr 25, 2024):

@JohnDowson @razvanphp have you resolved the issue?

<!-- gh-comment-id:2077499101 --> @BohdanKarVS commented on GitHub (Apr 25, 2024): @JohnDowson @razvanphp have you resolved the issue?
Author
Owner

@github-actions[bot] commented on GitHub (Oct 23, 2024):

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

<!-- gh-comment-id:2430542967 --> @github-actions[bot] commented on GitHub (Oct 23, 2024): Issue is stale and will be closed in 14 days unless there is new activity
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#1011
No description provided.