Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflows hangs on apt install command #2456

Closed
wawrzek opened this issue Sep 12, 2024 · 4 comments
Closed

Workflows hangs on apt install command #2456

wawrzek opened this issue Sep 12, 2024 · 4 comments
Labels
kind/bug Something isn't working

Comments

@wawrzek
Copy link

wawrzek commented Sep 12, 2024

Bug report info

act version:            0.2.67
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 4
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
	/var/run/docker.sock
Config files:
	/home/niewod/.config/act/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.13
	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.67 -X main.commit=f75a2d8b38cc3b929ab652c0994d6d33f6584ed9 -X main.date=2024-09-10T18:17:24Z -X main.builtBy=goreleaser
		CGO_ENABLED:          0
		GOARCH:               amd64
		GOOS:                 linux
		GOAMD64:              v1
		vcs:                  git
		vcs.revision:         f75a2d8b38cc3b929ab652c0994d6d33f6584ed9
		vcs.time:             2024-09-10T18:17:07Z
		vcs.modified:         false
Docker Engine:
	Engine version:        26.1.2
	Engine runtime:        runc
	Cgroup version:        1
	Cgroup driver:         cgroupfs
	Storage driver:        overlay2
	Registry URI:          https://index.docker.io/v1/
	OS:                    CRUX
	OS type:               linux
	OS version:
	OS arch:               x86_64
	OS kernel:             6.5.7
	OS CPU:                4
	OS memory:             15972 MB
	Security options:
		name=seccomp,profile=builtin

Command used with act

act -W .github/workflows/pre-commit.yml

Describe issue

One of the steps is to install a few Ubuntu packages. The process hangs

[Run PreCommit/pre-commit checks]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/2] user= workdir=
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
| pkg-config is already the newest version (0.29.2-1ubuntu3).
| pkg-config set to manually installed.
| The following additional packages will be installed:
|   libprotobuf-dev libprotobuf-lite23 libprotobuf23 libprotoc23 libssl3
| Suggested packages:
|   libssl-doc protobuf-mode-el
| The following NEW packages will be installed:
|   libprotobuf-dev libprotobuf-lite23 libprotobuf23 libprotoc23
|   protobuf-compiler
| The following packages will be upgraded:
|   libssl-dev libssl3
| 2 upgraded, 5 newly installed, 0 to remove and 24 not upgraded.
| Need to get 7405 kB of archives.
| After this operation, 17.5 MB of additional disk space will be used.

Link to GitHub repository

No response

Workflow content

name: Run PreCommit

on:
  push:
    branches-ignore:
      - dev
      - master

jobs:
  pre-commit:
    name: pre-commit checks
    runs-on: ubuntu-latest
    steps:
      - run: |
          apt update
      - name: Checkout code
        uses: actions/checkout@v4
      - name: Install  dependencies
        run: >
          sudo apt install
          protobuf-compiler
          pkg-config
          libssl-dev
      - name: Install official Rust
        run: |
          curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
      - name: Install machete
        run: |
          cargo install cargo-machete
      - name: Install nightly tool chain (for fmt)
        run: |
          rustup toolchain install nightly
      - name: Add nightly fmt
        run: >
          rustup component add
          --toolchain nightly-x86_64-unknown-linux-gnu
          rustfmt
      - name: Install precommit
        run: |
          python -m pip install pre-commit
      - name: Install hooks
        run: |
          pre-commit install --install-hooks
      - name: Prebuild tests
        run: |
          cargo build --tests
      - name: Run Pre-Commit
        run: >
          pre-commit run
          --all-files
          --show-diff-on-failure
          -v

Relevant log output

act -v does not show anything special.

Additional information

No response

@wawrzek wawrzek added the kind/bug Something isn't working label Sep 12, 2024
@sebastien-perpignane
Copy link
Contributor

hey @wawrzek

I would try something like this:

sudo apt install -y
protobuf-compiler
pkg-config
libssl-dev

It looks like apt is running in interactive mode.

@wawrzek
Copy link
Author

wawrzek commented Sep 16, 2024

@sebastien-perpignane good point. I'm quite surprised that the '-y' is missing. I wonder how it worked on GitHub? However, I lost '-y' quite recently, rewriting workflows to fit in 80 lines, and I didn't lose them everywhere. In the most case it's still there.

Anyway, thank you very much.

@wawrzek wawrzek closed this as completed Sep 16, 2024
@sebastien-perpignane
Copy link
Contributor

@wawrzek full github image probably contains a preconfigured apt command to always run in non interactive mode.

@wawrzek
Copy link
Author

wawrzek commented Sep 16, 2024

Good point. Maybe worth to add it to the documentation. I created the issue with similar "problem": #2462

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants