act icon indicating copy to clipboard operation
act copied to clipboard

Use /usr/bin/tail explicitly: no such file or directory

Open ritmas opened this issue 2 years ago • 0 comments

Bug report info

act version:            0.2.33
GOOS:                   darwin
GOARCH:                 amd64
NumCPU:                 8
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
	/var/run/docker.sock
	/Users/rimantas/.docker/run/docker.sock
Config files:           
	/Users/rimantas/.actrc:
		-P ubuntu-latest=node:16-buster-slim
		-P -P ubuntu-22.04=node:16-bullseye-slim
		ubuntu-20.04=node:16-buster-slim
		-P ubuntu-18.04=node:16-buster-slim
Build info:
	Go version:            go1.19.3
	Module path:           command-line-arguments
	Main version:          
	Main path:             
	Main checksum:         
	Build settings:
		-compiler:            gc
		-ldflags:             -X main.version=0.2.33
		CGO_ENABLED:          1
		CGO_CFLAGS:           
		CGO_CPPFLAGS:         
		CGO_CXXFLAGS:         
		CGO_LDFLAGS:          
		GOARCH:               amd64
		GOOS:                 darwin
		GOAMD64:              v1
Docker Engine:
	Engine version:        20.10.21
	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.15.49-linuxkit
	OS CPU:                4
	OS memory:             7859 MB
	Security options:
		name=seccomp,profile=default
		name=cgroupns

Command used with act

act -W .github/workflows/verify-prometheus.yml -v

Describe issue

It seems that for the workflow jobs runner explicitly uses /usr/bin/tail command which can be located in different paths on certain images. For instance:

/prometheus $ which tail
/bin/tail

/prometheus $ stat /usr/bin/tail
stat: can't stat '/usr/bin/tail': No such file or directory
$ which tail
/usr/bin/tail

$ stat /usr/bin/tail
  File: /usr/bin/tail
  Size: 76864     	Blocks: 152        IO Block: 4096   regular file
Device: 8bh/139d	Inode: 3411938     Links: 1
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2020-09-24 08:36:09.000000000 +0000
Modify: 2020-09-24 08:36:09.000000000 +0000
Change: 2022-11-21 18:18:41.323089844 +0000
 Birth: 2022-11-21 18:18:41.322089844 +0000

That being said, workflow fails due to error:

[Verify Prometheus/verify]   🐳  docker run image=prom/prometheus:v2.37.1 platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
Error: failed to start container: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "/usr/bin/tail": stat /usr/bin/tail: no such file or directory: unknown

It should just pickup it up regardless where it is located, e.g. from PATH env or just using tail.

Link to GitHub repository

No response

Workflow content

name: Verify Prometheus
on:
  workflow_dispatch:
  push:
    paths:
      - "alerting-rules/rules/**"
jobs:
  verify:
    runs-on: ["self-hosted", "testing-dind"]
    container:
#      image: bitnami/prometheus:2.37.0
      image: prom/prometheus:v2.37.1
    steps:
      - name: Checkout repository
        uses: actions/checkout@v1

      - name: Verify alerting rules
        run: |
            promtool check rules alerting-rules/rules/*/*.yml

Relevant log output

DEBU[0000] Loading environment from /Users/rimantas/www/alerting-rules/.env 
DEBU[0000] Loading secrets from /Users/rimantas/www/alerting-rules/.secrets 
DEBU[0000] Loading workflow '/Users/rimantas/www/alerting-rules/.github/workflows/verify-prometheus.yml' 
DEBU[0000] Reading workflow '/Users/rimantas/www/alerting-rules/.github/workflows/verify-prometheus.yml' 
DEBU[0000] Preparing plan with all jobs                 
DEBU[0000] Using default workflow event: push           
DEBU[0000] Planning jobs for event: push                
DEBU[0000] Loading slug from git directory '/Users/rimantas/www/alerting-rules/.git' 
DEBU[0000] Loading revision from git directory '/Users/rimantas/www/alerting-rules/.git' 
DEBU[0000] Found revision: 228c6d0a31dca71680bcdf78fa960939ee0ad72b 
DEBU[0000] HEAD points to '228c6d0a31dca71680bcdf78fa960939ee0ad72b' 
DEBU[0000] using github ref: refs/heads/fix/update-promtool 
DEBU[0000] Found revision: 228c6d0a31dca71680bcdf78fa960939ee0ad72b 
[Verify Prometheus/verify] [DEBUG] evaluating expression 'success()'
[Verify Prometheus/verify] [DEBUG] expression 'success()' evaluated to 'true'
[Verify Prometheus/verify] 🚀  Start image=prom/prometheus:v2.37.1
[Verify Prometheus/verify]   🐳  docker pull image=prom/prometheus:v2.37.1 platform= username= forcePull=false
[Verify Prometheus/verify] [DEBUG]   🐳  docker pull prom/prometheus:v2.37.1
[Verify Prometheus/verify] [DEBUG] Image exists? true
[Verify Prometheus/verify] [DEBUG] Removed container: c79fb30c3f1c888b1ac2e067ff54f28f2282869c30222f222fd89eb8d2ec7e47
[Verify Prometheus/verify] [DEBUG]   🐳  docker volume rm act-Verify-Prometheus-verify
[Verify Prometheus/verify] [DEBUG]   🐳  docker volume rm act-Verify-Prometheus-verify-env
[Verify Prometheus/verify]   🐳  docker create image=prom/prometheus:v2.37.1 platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Verify Prometheus/verify] [DEBUG] Common container.Config ==> &{Hostname: Domainname: User: AttachStdin:false AttachStdout:false AttachStderr:false ExposedPorts:map[] Tty:true OpenStdin:false StdinOnce:false Env:[RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_ARCH=X64 RUNNER_TEMP=/tmp] Cmd:[] Healthcheck:<nil> ArgsEscaped:false Image:prom/prometheus:v2.37.1 Volumes:map[] WorkingDir:/Users/rimantas/www/alerting-rules Entrypoint:[] NetworkDisabled:false MacAddress: OnBuild:[] Labels:map[] StopSignal: StopTimeout:<nil> Shell:[]}
[Verify Prometheus/verify] [DEBUG] Common container.HostConfig ==> &{Binds:[/var/run/docker.sock:/var/run/docker.sock] ContainerIDFile: LogConfig:{Type: Config:map[]} NetworkMode:host PortBindings:map[] RestartPolicy:{Name: MaximumRetryCount:0} AutoRemove:false VolumeDriver: VolumesFrom:[] CapAdd:[] CapDrop:[] CgroupnsMode: DNS:[] DNSOptions:[] DNSSearch:[] ExtraHosts:[] GroupAdd:[] IpcMode: Cgroup: Links:[] OomScoreAdj:0 PidMode: Privileged:false PublishAllPorts:false ReadonlyRootfs:false SecurityOpt:[] StorageOpt:map[] Tmpfs:map[] UTSMode: UsernsMode: ShmSize:0 Sysctls:map[] Runtime: ConsoleSize:[0 0] Isolation: Resources:{CPUShares:0 Memory:0 NanoCPUs:0 CgroupParent: BlkioWeight:0 BlkioWeightDevice:[] BlkioDeviceReadBps:[] BlkioDeviceWriteBps:[] BlkioDeviceReadIOps:[] BlkioDeviceWriteIOps:[] CPUPeriod:0 CPUQuota:0 CPURealtimePeriod:0 CPURealtimeRuntime:0 CpusetCpus: CpusetMems: Devices:[] DeviceCgroupRules:[] DeviceRequests:[] KernelMemory:0 KernelMemoryTCP:0 MemoryReservation:0 MemorySwap:0 MemorySwappiness:<nil> OomKillDisable:<nil> PidsLimit:<nil> Ulimits:[] CPUCount:0 CPUPercent:0 IOMaximumIOps:0 IOMaximumBandwidth:0} Mounts:[{Type:volume Source:act-toolcache Target:/toolcache ReadOnly:false Consistency: BindOptions:<nil> VolumeOptions:<nil> TmpfsOptions:<nil>} {Type:volume Source:act-Verify-Prometheus-verify-env Target:/var/run/act ReadOnly:false Consistency: BindOptions:<nil> VolumeOptions:<nil> TmpfsOptions:<nil>} {Type:volume Source:act-Verify-Prometheus-verify Target:/Users/rimantas/www/alerting-rules ReadOnly:false Consistency: BindOptions:<nil> VolumeOptions:<nil> TmpfsOptions:<nil>}] MaskedPaths:[] ReadonlyPaths:[] Init:<nil>}
[Verify Prometheus/verify] [DEBUG] Created container name=act-Verify-Prometheus-verify id=32112f4824b9f5061c86c2a6fc2a16aa35bb3697d016566659c4ff8f414053ce from image prom/prometheus:v2.37.1 (platform: )
[Verify Prometheus/verify] [DEBUG] ENV ==> [RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_ARCH=X64 RUNNER_TEMP=/tmp]
[Verify Prometheus/verify]   🐳  docker run image=prom/prometheus:v2.37.1 platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Verify Prometheus/verify] [DEBUG] Starting container: 32112f4824b9f5061c86c2a6fc2a16aa35bb3697d016566659c4ff8f414053ce
Error: failed to start container: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "/usr/bin/tail": stat /usr/bin/tail: no such file or directory: unknown

Additional information

No response

ritmas avatar Nov 22 '22 09:11 ritmas