[GH-ISSUE #827] Issue: go: command not found #503

Closed
opened 2026-03-01 21:43:59 +03:00 by kerem · 1 comment
Owner

Originally created by @mxxnhxTW on GitHub (Sep 27, 2021).
Original GitHub issue: https://github.com/nektos/act/issues/827

The problem seems not reported yet in github issues. If this is known issue, plz refer that issue. Thanks.

System information

  • Operating System: Ubuntu 20.04
  • Architecture: x64 (64-bit)
  • Apple M1: no
  • Docker version: 20.10.8
  • Docker image used in act: hcmoon/tarp_go_base (simple custom image where most of required modules are installed for faster test running)
  • act version: v0.2.24, v0.2.22

Expected behaviour

When running workflow file that contains go test command inside, go command should be executed without calling it by full path like /usr/local/go/bin/go.

Actual behaviour

The go command is not executed with error below

go: command not found

This problem is not observed on act version v0.2.21 that I had used before.

The PATH environment variables are set differently on act version > v0.2.21 when it is executed.
Some of environment variables on act version higher than v0.2.21:

GOLANG_VERSION=1.15.1
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
GOPATH=/go

on act version v0.2.21:

GOLANG_VERSION=1.15.1
PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
GOPATH=/go

But, PATH env is set correctly inside created docker container, checked after act failed.

docker exec -it act-Test-test /bin/bash
$ env
...
GOLANG_VERSION=1.15.1
PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
GOPATH=/go
...

Workflow and/or repository

workflow
name: example workflow

on: push

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
      - name: check go version
        run: |
          go version
          env

Steps to reproduce

act -P ubuntu-latest=hcmoon/tarp_go_base

act output

Output is result of workflow on private repository

Log
DEBU[0000] Loading environment from /home/hcmoon/tarp-server/.env 
DEBU[0000] Loading secrets from /home/hcmoon/tarp-server/.secrets 
DEBU[0000] Loading workflows from '/home/hcmoon/tarp-server/.github/workflows'                                                                                                                                                                DEBU[0000] Loading workflows recursively                                                                                                                                                                                                                                                                                                                                                      DEBU[0000] Found workflow 'ci.yml' in '/home/hcmoon/tarp-server/.github/workflows/ci.yml'                                                                                                                                                      DEBU[0000] Reading workflow '/home/hcmoon/tarp-server/.github/workflows/ci.yml'                                                                                                                                                               DEBU[0000] Correcting if statements '/home/hcmoon/tarp-server/.github/workflows/ci.yml'                                                                                                                                                       
DEBU[0000] Planning job: test                           
DEBU[0000] Loading slug from git directory '/home/hcmoon/tarp-server/.git' 
DEBU[0000] Found revision: 538bb99369abc7ff1d8b9651e1613a8f0d762474 
DEBU[0000] Loading revision from git directory '/home/hcmoon/tarp-server/.git' 
DEBU[0000] Found revision: 538bb99369abc7ff1d8b9651e1613a8f0d762474 
DEBU[0000] HEAD points to '538bb99369abc7ff1d8b9651e1613a8f0d762474' 
DEBU[0000] using github ref: refs/heads/master 
DEBU[0000] context env => map[ACT:true]                                                                                
DEBU[0000] context needs => map[]                                                                                      
[Test/test] 🚀  Start image=hcmoon/tarp_go_base                                                                        
DEBU[0000] Loading slug from git directory '/home/hcmoon/tarp-server/.git' 
DEBU[0000] Found revision: 538bb99369abc7ff1d8b9651e1613a8f0d762474 
DEBU[0000] Loading revision from git directory '/home/hcmoon/tarp-server/.git' 
DEBU[0000] Found revision: 538bb99369abc7ff1d8b9651e1613a8f0d762474 
DEBU[0000] HEAD points to '538bb99369abc7ff1d8b9651e1613a8f0d762474'
DEBU[0000] using github ref: refs/heads/feat/master 
[Test/test]   🐳  docker pull hcmoon/tarp_go_base                                                                      
DEBU[0000] Image exists? true                                                                                                                                                                                                                 
[Test/test] Removed container: ab742bcd20505541e2db9d5be73df8f9e8bb516c550b83242b44fe28d68b9b70                        
[Test/test]   🐳  docker volume rm act-Test-test                                                                                                                                                                                              
[Test/test]   🐳  docker create image=hcmoon/tarp_go_base platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]                                                                                                                      
[Test/test] Created container name=act-Test-test id=f5e6832c0711e7d62650f0824764d0c808f04311601e6e9bb9b1078810e6ccd0 from image hcmoon/tarp_go_base (platform: )                                                                              
[Test/test] ENV ==> [RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_TEMP=/tmp]                                                                                                                                                 
[Test/test]   🐳  docker run image=hcmoon/tarp_go_base platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Test/test] Starting container: f5e6832c0711e7d62650f0824764d0c808f04311601e6e9bb9b1078810e6ccd0                                                                                                                                              
[Test/test] Started container: f5e6832c0711e7d62650f0824764d0c808f04311601e6e9bb9b1078810e6ccd0                                                                                                                                               
[Test/test]   🐳  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root                                                                                                                                                                   
[Test/test] Exec command '[mkdir -m 0777 -p /var/run/act]'                                                                                                                                                                                    
DEBU[0000] Writing entry to tarball workflow/event.json len:2                            
DEBU[0000] Writing entry to tarball workflow/envs.txt len:0                                                            
DEBU[0000] Writing entry to tarball workflow/paths.txt len:0                                                           
[Test/test] Extracting content to '/var/run/act/'
DEBU[0000] Loading slug from git directory '/home/hcmoon/tarp-server/.git'                                             
DEBU[0000] Found revision: 538bb99369abc7ff1d8b9651e1613a8f0d762474                                                    
DEBU[0000] Loading revision from git directory '/home/hcmoon/tarp-server/.git'                                         
DEBU[0000] Found revision: 538bb99369abc7ff1d8b9651e1613a8f0d762474 
DEBU[0000] HEAD points to '538bb99369abc7ff1d8b9651e1613a8f0d762474'                                                
DEBU[0000] using github ref: refs/heads/feat/TARPS-829/testing-robot-control-api                       
DEBU[0000] Loading slug from git directory '/home/hcmoon/tarp-server/.git' 
DEBU[0000] Found revision: 538bb99369abc7ff1d8b9651e1613a8f0d762474                                                    
DEBU[0000] Loading revision from git directory '/home/hcmoon/tarp-server/.git'                                         
DEBU[0000] Found revision: 538bb99369abc7ff1d8b9651e1613a8f0d762474                                                    
DEBU[0000] HEAD points to '538bb99369abc7ff1d8b9651e1613a8f0d762474'                                                   
DEBU[0000] using github ref: refs/heads/feat/TARPS-829/testing-robot-control-api                                                                                                                                                              
DEBU[0000] context env => map[ACT:true]                                                                                
DEBU[0000] context needs => map[]                                                                                      
DEBU[0000] context env => map[ACT:true CI:true GITHUB_ACTION:0 GITHUB_ACTIONS:true GITHUB_ACTION_REF: GITHUB_ACTION_REPOSITORY: GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://api.github.com GITHUB_BASE_REF: GITHUB_ENV:/var/run/act/workflow/envs.txt GITHUB_EVENT_NAME:push GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:test GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF:refs/heads/feat/TARPS-829/testing-robot-control-api GITHUB_REPOSITORY:twinnylab/tarp-server GITHUB_REPOSITORY_OWNER:twinnylab GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:538bb99369abc7ff1d8b9651e1613a8f0d762474 GITHUB_TOKEN: GITHUB_WORKFLOW:Test GITHUB_WORKSPACE:/home/hcmoon/tarp-server ImageOS:ubuntu20 PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID:]           
[Test/test] setupEnv => map[ACT:true CI:true GITHUB_ACTION:0 GITHUB_ACTIONS:true GITHUB_ACTION_REF: GITHUB_ACTION_REPOSITORY: GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://api.github.com GITHUB_BASE_REF: GITHUB_ENV:/var/run/act/workflow/envs.txt GITHUB_EVENT_NAME:push GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:test GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF:refs/heads/feat/TARPS-829/testing-robot-control-api GITHUB_REPOSITORY:twinnylab/tarp-server GITHUB_REPOSITORY_OWNER:twinnylab GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:538bb99369abc7ff1d8b9651e1613a8f0d762474 GITHUB_TOKEN: GITHUB_WORKFLOW:Test GITHUB_WORKSPACE:/home/hcmoon/tarp-server ImageOS:ubuntu20 PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID:]             
[Test/test] ⭐  Run check go version                    
DEBU[0000] Wrote command '                                                                                             
go version                                                                                                             
                                                                                                                       
' to 'workflow/0'                                                                                                      
DEBU[0000] Writing entry to tarball workflow/0 len:11                                                                  
[Test/test] Extracting content to '/home/hcmoon/tarp-server'                     
[Test/test]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /home/hcmoon/tarp-server/workflow/0] user=   
[Test/test] Exec command '[bash --noprofile --norc -e -o pipefail /home/hcmoon/tarp-server/workflow/0]'                
| /home/hcmoon/tarp-server/workflow/0: line 1: go: command not found                                                   
DEBU[0000] exit with `FAILURE`: 127                                                                                    
[Test/test]   ❌  Failure - check go version                                                                           
DEBU[0000] exit with `FAILURE`: 127                                                                                    
Error: exit with `FAILURE`: 127
Originally created by @mxxnhxTW on GitHub (Sep 27, 2021). Original GitHub issue: https://github.com/nektos/act/issues/827 <!-- - Make sure you are able to reproduce it on the [latest version](https://github.com/nektos/act/releases) - Search the existing issues. - Refer to [README](https://github.com/nektos/act/blob/master/README.md). --> The problem seems not reported yet in github issues. If this is known issue, plz refer that issue. Thanks. ## System information <!-- - Operating System: < Windows | Linux | macOS | etc... > - Architecture: < x64 (64-bit) | x86 (32-bit) | arm64 (64-bit) | arm (32-bit) | etc... > - Apple M1: < yes | no > - Docker version: < output of `docker system info -f "{{.ServerVersion}}"` > - Docker image used in `act`: < can be omitted if it's included in log > - `act` version: < output of `act --version`, if you've built `act` yourself, please provide commit hash > --> - Operating System: Ubuntu 20.04 - Architecture: x64 (64-bit) - Apple M1: no - Docker version: 20.10.8 - Docker image used in `act`: hcmoon/tarp_go_base (simple custom image where most of required modules are installed for faster test running) - `act` version: v0.2.24, v0.2.22 ## Expected behaviour <!-- - Describe how whole process should go and finish --> When running workflow file that contains go test command inside, `go` command should be executed without calling it by full path like `/usr/local/go/bin/go`. ## Actual behaviour <!-- - Describe the issue --> The `go` command is not executed with error below ``` go: command not found ``` This problem is not observed on act version v0.2.21 that I had used before. The `PATH` environment variables are set differently on act version > v0.2.21 when it is executed. Some of environment variables on act version higher than v0.2.21: ``` GOLANG_VERSION=1.15.1 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin GOPATH=/go ``` on act version v0.2.21: ``` GOLANG_VERSION=1.15.1 PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin GOPATH=/go ``` But, `PATH` env is set correctly inside created docker container, checked after act failed. ``` docker exec -it act-Test-test /bin/bash $ env ... GOLANG_VERSION=1.15.1 PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin GOPATH=/go ... ``` ## Workflow and/or repository <!-- - Provide workflow with which we can reproduce the issue OR - Provide link to your GitHub repository that contains the workflow --> <details> <summary>workflow</summary> ```none name: example workflow on: push jobs: test: runs-on: ubuntu-latest steps: - name: check go version run: | go version env ``` </details> ## Steps to reproduce <!-- - Make sure to include full command with parameters you used to run `act`, example: 1. Clone example repo (https://github.com/cplee/github-actions-demo) 2. Enter cloned repo directory 3. Run `act -s SUPER_SECRET=im-a-value` --> ``` act -P ubuntu-latest=hcmoon/tarp_go_base ``` ## `act` output _Output is result of workflow on private repository_ <!-- - Use `act` with `-v`/`--verbose` and paste output from your terminal in code block below --> <details> <summary>Log</summary> ``` DEBU[0000] Loading environment from /home/hcmoon/tarp-server/.env DEBU[0000] Loading secrets from /home/hcmoon/tarp-server/.secrets DEBU[0000] Loading workflows from '/home/hcmoon/tarp-server/.github/workflows' DEBU[0000] Loading workflows recursively DEBU[0000] Found workflow 'ci.yml' in '/home/hcmoon/tarp-server/.github/workflows/ci.yml' DEBU[0000] Reading workflow '/home/hcmoon/tarp-server/.github/workflows/ci.yml' DEBU[0000] Correcting if statements '/home/hcmoon/tarp-server/.github/workflows/ci.yml' DEBU[0000] Planning job: test DEBU[0000] Loading slug from git directory '/home/hcmoon/tarp-server/.git' DEBU[0000] Found revision: 538bb99369abc7ff1d8b9651e1613a8f0d762474 DEBU[0000] Loading revision from git directory '/home/hcmoon/tarp-server/.git' DEBU[0000] Found revision: 538bb99369abc7ff1d8b9651e1613a8f0d762474 DEBU[0000] HEAD points to '538bb99369abc7ff1d8b9651e1613a8f0d762474' DEBU[0000] using github ref: refs/heads/master DEBU[0000] context env => map[ACT:true] DEBU[0000] context needs => map[] [Test/test] 🚀 Start image=hcmoon/tarp_go_base DEBU[0000] Loading slug from git directory '/home/hcmoon/tarp-server/.git' DEBU[0000] Found revision: 538bb99369abc7ff1d8b9651e1613a8f0d762474 DEBU[0000] Loading revision from git directory '/home/hcmoon/tarp-server/.git' DEBU[0000] Found revision: 538bb99369abc7ff1d8b9651e1613a8f0d762474 DEBU[0000] HEAD points to '538bb99369abc7ff1d8b9651e1613a8f0d762474' DEBU[0000] using github ref: refs/heads/feat/master [Test/test] 🐳 docker pull hcmoon/tarp_go_base DEBU[0000] Image exists? true [Test/test] Removed container: ab742bcd20505541e2db9d5be73df8f9e8bb516c550b83242b44fe28d68b9b70 [Test/test] 🐳 docker volume rm act-Test-test [Test/test] 🐳 docker create image=hcmoon/tarp_go_base platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Test/test] Created container name=act-Test-test id=f5e6832c0711e7d62650f0824764d0c808f04311601e6e9bb9b1078810e6ccd0 from image hcmoon/tarp_go_base (platform: ) [Test/test] ENV ==> [RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_TEMP=/tmp] [Test/test] 🐳 docker run image=hcmoon/tarp_go_base platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Test/test] Starting container: f5e6832c0711e7d62650f0824764d0c808f04311601e6e9bb9b1078810e6ccd0 [Test/test] Started container: f5e6832c0711e7d62650f0824764d0c808f04311601e6e9bb9b1078810e6ccd0 [Test/test] 🐳 docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root [Test/test] Exec command '[mkdir -m 0777 -p /var/run/act]' DEBU[0000] Writing entry to tarball workflow/event.json len:2 DEBU[0000] Writing entry to tarball workflow/envs.txt len:0 DEBU[0000] Writing entry to tarball workflow/paths.txt len:0 [Test/test] Extracting content to '/var/run/act/' DEBU[0000] Loading slug from git directory '/home/hcmoon/tarp-server/.git' DEBU[0000] Found revision: 538bb99369abc7ff1d8b9651e1613a8f0d762474 DEBU[0000] Loading revision from git directory '/home/hcmoon/tarp-server/.git' DEBU[0000] Found revision: 538bb99369abc7ff1d8b9651e1613a8f0d762474 DEBU[0000] HEAD points to '538bb99369abc7ff1d8b9651e1613a8f0d762474' DEBU[0000] using github ref: refs/heads/feat/TARPS-829/testing-robot-control-api DEBU[0000] Loading slug from git directory '/home/hcmoon/tarp-server/.git' DEBU[0000] Found revision: 538bb99369abc7ff1d8b9651e1613a8f0d762474 DEBU[0000] Loading revision from git directory '/home/hcmoon/tarp-server/.git' DEBU[0000] Found revision: 538bb99369abc7ff1d8b9651e1613a8f0d762474 DEBU[0000] HEAD points to '538bb99369abc7ff1d8b9651e1613a8f0d762474' DEBU[0000] using github ref: refs/heads/feat/TARPS-829/testing-robot-control-api DEBU[0000] context env => map[ACT:true] DEBU[0000] context needs => map[] DEBU[0000] context env => map[ACT:true CI:true GITHUB_ACTION:0 GITHUB_ACTIONS:true GITHUB_ACTION_REF: GITHUB_ACTION_REPOSITORY: GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://api.github.com GITHUB_BASE_REF: GITHUB_ENV:/var/run/act/workflow/envs.txt GITHUB_EVENT_NAME:push GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:test GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF:refs/heads/feat/TARPS-829/testing-robot-control-api GITHUB_REPOSITORY:twinnylab/tarp-server GITHUB_REPOSITORY_OWNER:twinnylab GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:538bb99369abc7ff1d8b9651e1613a8f0d762474 GITHUB_TOKEN: GITHUB_WORKFLOW:Test GITHUB_WORKSPACE:/home/hcmoon/tarp-server ImageOS:ubuntu20 PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID:] [Test/test] setupEnv => map[ACT:true CI:true GITHUB_ACTION:0 GITHUB_ACTIONS:true GITHUB_ACTION_REF: GITHUB_ACTION_REPOSITORY: GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://api.github.com GITHUB_BASE_REF: GITHUB_ENV:/var/run/act/workflow/envs.txt GITHUB_EVENT_NAME:push GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:test GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF:refs/heads/feat/TARPS-829/testing-robot-control-api GITHUB_REPOSITORY:twinnylab/tarp-server GITHUB_REPOSITORY_OWNER:twinnylab GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:538bb99369abc7ff1d8b9651e1613a8f0d762474 GITHUB_TOKEN: GITHUB_WORKFLOW:Test GITHUB_WORKSPACE:/home/hcmoon/tarp-server ImageOS:ubuntu20 PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID:] [Test/test] ⭐ Run check go version DEBU[0000] Wrote command ' go version ' to 'workflow/0' DEBU[0000] Writing entry to tarball workflow/0 len:11 [Test/test] Extracting content to '/home/hcmoon/tarp-server' [Test/test] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /home/hcmoon/tarp-server/workflow/0] user= [Test/test] Exec command '[bash --noprofile --norc -e -o pipefail /home/hcmoon/tarp-server/workflow/0]' | /home/hcmoon/tarp-server/workflow/0: line 1: go: command not found DEBU[0000] exit with `FAILURE`: 127 [Test/test] ❌ Failure - check go version DEBU[0000] exit with `FAILURE`: 127 Error: exit with `FAILURE`: 127 ``` </details>
Author
Owner

@mxxnhxTW commented on GitHub (Sep 28, 2021):

@catthehacker Thanks for instant fix up! Checked it's working on master branch. Thank you again for providing really helpful sotfware!!!!

<!-- gh-comment-id:928556741 --> @mxxnhxTW commented on GitHub (Sep 28, 2021): @catthehacker Thanks for instant fix up! Checked it's working on master branch. Thank you again for providing really helpful sotfware!!!!
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#503
No description provided.