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

Unable to execute actions/setup-python #251

Closed
rgarrigue opened this issue May 19, 2020 · 25 comments
Closed

Unable to execute actions/setup-python #251

rgarrigue opened this issue May 19, 2020 · 25 comments

Comments

@rgarrigue
Copy link

Hi there

Thanks for act. I've been using it successfully until now, but here's some issue running python related tests : it's unable to execute the setup-python action.

I tried with both my "old" act version from a couple of month ago and latest 0.2.8 from GitHub releases. With and without the matrix on python version. With actions/checkout@v1, v2 and master.

name: Tests
jobs:
  tests:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python: [3.7]
    steps:
      - uses: actions/checkout@v2
      - name: Setup Python
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python }}

And here's the verbose log

act -v
DEBU[0000] Loading environment from /home/me/work/ansible/ansible-role-apns-proxy/.env 
DEBU[0000] Loading secrets from                         
DEBU[0000] Loading workflows from '/home/me/work/ansible/ansible-role-apns-proxy/.github/workflows' 
DEBU[0000] Reading workflow '/home/me/work/ansible/ansible-role-apns-proxy/.github/workflows/tests.yml' 
DEBU[0000] Planning event: push                         
DEBU[0000] Loading slug from git directory '/home/me/work/ansible/ansible-role-apns-proxy/.git' 
DEBU[0000] Found revision: 10b2eb0f8ae364f1c3086b27315b76aebdf6722a 
DEBU[0000] Loading revision from git directory '/home/me/work/ansible/ansible-role-apns-proxy/.git' 
DEBU[0000] Found revision: 10b2eb0f8ae364f1c3086b27315b76aebdf6722a 
DEBU[0000] HEAD points to '10b2eb0f8ae364f1c3086b27315b76aebdf6722a' 
DEBU[0000] HEAD matches refs/tags/test                  
DEBU[0000] using github ref: refs/tags/test             
[Tests/tests] 🧪  Matrix: map[python:3.7]
[Tests/tests] 🚀  Start image=node:12.6-buster-slim
DEBU[0000] Loading slug from git directory '/home/me/work/ansible/ansible-role-apns-proxy/.git' 
DEBU[0000] Found revision: 10b2eb0f8ae364f1c3086b27315b76aebdf6722a 
DEBU[0000] Loading revision from git directory '/home/me/work/ansible/ansible-role-apns-proxy/.git' 
DEBU[0000] Found revision: 10b2eb0f8ae364f1c3086b27315b76aebdf6722a 
DEBU[0000] HEAD points to '10b2eb0f8ae364f1c3086b27315b76aebdf6722a' 
DEBU[0000] HEAD matches refs/tags/test                  
DEBU[0000] using github ref: refs/tags/test             
[Tests/tests]   🐳  docker pull node:12.6-buster-slim
DEBU[0000] Image exists? true                           
[Tests/tests] Removed container: b1b835d656c4caa59f87c9ace1c2764c917fb223c34283c3ec1fdd75c6609b31
[Tests/tests]   🐳  docker create image=node:12.6-buster-slim entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Tests/tests] Created container name=act-Tests-tests id=5e1ee21708b4923783ef87aad72db2f09e899f30e64e185bde4a6f694517e15d from image node:12.6-buster-slim
[Tests/tests] ENV ==> [RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_TEMP=/tmp]
[Tests/tests]   🐳  docker run image=node:12.6-buster-slim entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Tests/tests] Starting container: 5e1ee21708b4923783ef87aad72db2f09e899f30e64e185bde4a6f694517e15d
[Tests/tests] Started container: 5e1ee21708b4923783ef87aad72db2f09e899f30e64e185bde4a6f694517e15d
[Tests/tests]   🐳  docker cp src=/home/me/work/ansible/ansible-role-apns-proxy/. dst=/github/workspace
[Tests/tests] Exec command '[mkdir -p /github/workspace]'
DEBU[0000] Writing tarball /tmp/act508945956 from /home/me/work/ansible/ansible-role-apns-proxy/. 
DEBU[0000] Stripping prefix:/home/me/work/ansible/ansible-role-apns-proxy/ src:/home/me/work/ansible/ansible-role-apns-proxy/. 
[Tests/tests] Unable to copy link converge.yml --> ../default/converge.yml
[Tests/tests] Unable to copy link requirements.yml --> ../default/requirements.yml
[Tests/tests] Unable to copy link tests --> ../default/tests
[Tests/tests] Extracting content from '/tmp/act508945956' to '/github/workspace'
DEBU[0000] Writing entry to tarball workflow/event.json len:2 
DEBU[0000] Writing entry to tarball home/.act len:0     
[Tests/tests] Extracting content to '/github/'
DEBU[0000] Loading slug from git directory '/home/me/work/ansible/ansible-role-apns-proxy/.git' 
DEBU[0000] Found revision: 10b2eb0f8ae364f1c3086b27315b76aebdf6722a 
DEBU[0000] Loading revision from git directory '/home/me/work/ansible/ansible-role-apns-proxy/.git' 
DEBU[0000] Found revision: 10b2eb0f8ae364f1c3086b27315b76aebdf6722a 
DEBU[0000] HEAD points to '10b2eb0f8ae364f1c3086b27315b76aebdf6722a' 
DEBU[0000] HEAD matches refs/tags/test                  
DEBU[0000] using github ref: refs/tags/test             
DEBU[0000] setupEnv => map[GITHUB_ACTION:0 GITHUB_ACTIONS:true GITHUB_ACTOR:nektos/act GITHUB_EVENT_NAME:push GITHUB_EVENT_PATH:/github/workflow/event.json GITHUB_REF:refs/tags/test GITHUB_REPOSITORY:TinxHQ/ansible-role-apns-proxy GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SHA:10b2eb0f8ae364f1c3086b27315b76aebdf6722a GITHUB_TOKEN: GITHUB_WORKFLOW:Tests GITHUB_WORKSPACE:/github/workspace HOME:/github/home] 
DEBU[0000] Loading slug from git directory '/home/me/work/ansible/ansible-role-apns-proxy/.git' 
DEBU[0000] Found revision: 10b2eb0f8ae364f1c3086b27315b76aebdf6722a 
DEBU[0000] Loading revision from git directory '/home/me/work/ansible/ansible-role-apns-proxy/.git' 
DEBU[0000] Found revision: 10b2eb0f8ae364f1c3086b27315b76aebdf6722a 
DEBU[0000] HEAD points to '10b2eb0f8ae364f1c3086b27315b76aebdf6722a' 
DEBU[0000] HEAD matches refs/tags/test                  
DEBU[0000] using github ref: refs/tags/test             
DEBU[0000] context env => map[GITHUB_ACTION:0 GITHUB_ACTIONS:true GITHUB_ACTOR:nektos/act GITHUB_EVENT_NAME:push GITHUB_EVENT_PATH:/github/workflow/event.json GITHUB_REF:refs/tags/test GITHUB_REPOSITORY:TinxHQ/ansible-role-apns-proxy GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SHA:10b2eb0f8ae364f1c3086b27315b76aebdf6722a GITHUB_TOKEN: GITHUB_WORKFLOW:Tests GITHUB_WORKSPACE:/github/workspace HOME:/github/home] 
[Tests/tests] ⭐  Run actions/checkout@v2
DEBU[0000] Loading slug from git directory '/home/me/work/ansible/ansible-role-apns-proxy/.git' 
DEBU[0000] Found revision: 10b2eb0f8ae364f1c3086b27315b76aebdf6722a 
DEBU[0000] Loading revision from git directory '/home/me/work/ansible/ansible-role-apns-proxy/.git' 
DEBU[0000] Found revision: 10b2eb0f8ae364f1c3086b27315b76aebdf6722a 
DEBU[0000] HEAD points to '10b2eb0f8ae364f1c3086b27315b76aebdf6722a' 
DEBU[0000] HEAD matches refs/tags/test                  
DEBU[0000] using github ref: refs/tags/test             
[Tests/tests] Skipping actions/checkout
[Tests/tests]   ✅  Success - actions/checkout@v2
DEBU[0000] Loading slug from git directory '/home/me/work/ansible/ansible-role-apns-proxy/.git' 
DEBU[0000] Found revision: 10b2eb0f8ae364f1c3086b27315b76aebdf6722a 
DEBU[0000] Loading revision from git directory '/home/me/work/ansible/ansible-role-apns-proxy/.git' 
DEBU[0000] Found revision: 10b2eb0f8ae364f1c3086b27315b76aebdf6722a 
DEBU[0000] HEAD points to '10b2eb0f8ae364f1c3086b27315b76aebdf6722a' 
DEBU[0000] HEAD matches refs/tags/test                  
DEBU[0000] using github ref: refs/tags/test             
DEBU[0000] setupEnv => map[GITHUB_ACTION:1 GITHUB_ACTIONS:true GITHUB_ACTOR:nektos/act GITHUB_EVENT_NAME:push GITHUB_EVENT_PATH:/github/workflow/event.json GITHUB_REF:refs/tags/test GITHUB_REPOSITORY:TinxHQ/ansible-role-apns-proxy GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SHA:10b2eb0f8ae364f1c3086b27315b76aebdf6722a GITHUB_TOKEN: GITHUB_WORKFLOW:Tests GITHUB_WORKSPACE:/github/workspace HOME:/github/home INPUT_PYTHON-VERSION:3.7] 
DEBU[0000] Loading slug from git directory '/home/me/work/ansible/ansible-role-apns-proxy/.git' 
DEBU[0000] Found revision: 10b2eb0f8ae364f1c3086b27315b76aebdf6722a 
DEBU[0000] Loading revision from git directory '/home/me/work/ansible/ansible-role-apns-proxy/.git' 
DEBU[0000] Found revision: 10b2eb0f8ae364f1c3086b27315b76aebdf6722a 
DEBU[0000] HEAD points to '10b2eb0f8ae364f1c3086b27315b76aebdf6722a' 
DEBU[0000] HEAD matches refs/tags/test                  
DEBU[0000] using github ref: refs/tags/test             
DEBU[0000] context env => map[GITHUB_ACTION:1 GITHUB_ACTIONS:true GITHUB_ACTOR:nektos/act GITHUB_EVENT_NAME:push GITHUB_EVENT_PATH:/github/workflow/event.json GITHUB_REF:refs/tags/test GITHUB_REPOSITORY:TinxHQ/ansible-role-apns-proxy GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SHA:10b2eb0f8ae364f1c3086b27315b76aebdf6722a GITHUB_TOKEN: GITHUB_WORKFLOW:Tests GITHUB_WORKSPACE:/github/workspace HOME:/github/home INPUT_PYTHON-VERSION:3.7] 
[Tests/tests] ⭐  Run Setup Python
[Tests/tests]   ☁  git clone 'https://github.com/actions/setup-python' # ref=v2
[Tests/tests]   cloning https://github.com/actions/setup-python to /home/me/.cache/act/actions-setup-python@v2
[Tests/tests] Cloned https://github.com/actions/setup-python to /home/me/.cache/act/actions-setup-python@v2
[Tests/tests] Checked out v2
DEBU[0001] Read action &{Setup Python GitHub Set up a specific version of Python and add the command-line tools to the PATH. map[architecture:{The target architecture (x86, x64) of the Python interpreter. false } python-version:{Version range or exact version of a Python version to use, using SemVer's version range syntax. false 3.x} token:{Used to pull python distributions from actions/python-versions. Since there's a default, this is typically not supplied by the user. false ${{ github.token }}}] map[python-version:{The installed python version. Useful when given a version range as input.}] {node12 map[] dist/index.js  [] []} {yellow code}} from '/home/me/.cache/act/actions-setup-python@v2/action.yml' 
DEBU[0001] About to run action &{Setup Python GitHub Set up a specific version of Python and add the command-line tools to the PATH. map[architecture:{The target architecture (x86, x64) of the Python interpreter. false } python-version:{Version range or exact version of a Python version to use, using SemVer's version range syntax. false 3.x} token:{Used to pull python distributions from actions/python-versions. Since there's a default, this is typically not supplied by the user. false ${{ github.token }}}] map[python-version:{The installed python version. Useful when given a version range as input.}] {node12 map[] dist/index.js  [] []} {yellow code}} 
DEBU[0001] type=3 actionDir=/home/me/.cache/act/actions-setup-python@v2 Workdir=/home/me/work/ansible/ansible-role-apns-proxy ActionCacheDir=/home/me/.cache/act actionName=actions-setup-python@v2 containerActionDir=/actions 
[Tests/tests]   🐳  docker cp src=/home/me/.cache/act/actions-setup-python@v2 dst=/actions/
[Tests/tests] Exec command '[mkdir -p /actions/]'
DEBU[0001] Writing tarball /tmp/act255484723 from /home/me/.cache/act/actions-setup-python@v2 
DEBU[0001] Stripping prefix:/home/me/.cache/act/ src:/home/me/.cache/act/actions-setup-python@v2 
[Tests/tests] Extracting content from '/tmp/act255484723' to '/actions/'
[Tests/tests] Exec command '[node /actions/actions-setup-python@v2/dist/index.js]'
[Tests/tests]   💬  ::debug::Semantic version spec of 3.7 is 3.7
[Tests/tests]   💬  ::debug::isExplicit: 
[Tests/tests]   💬  ::debug::explicit? false
[Tests/tests]   💬  ::debug::evaluating 0 versions
[Tests/tests]   💬  ::debug::match not found
| Version 3.7 was not found in the local cache
[Tests/tests]   ❗  ::error::Bad credentials
[Tests/tests]   ❌  Failure - Setup Python
DEBU[0002] exit with `FAILURE`: 1                       
DEBU[0002] exit with `FAILURE`: 1                       
DEBU[0002] exit with `FAILURE`: 1                       
DEBU[0002] exit with `FAILURE`: 1                       
DEBU[0002] exit with `FAILURE`: 1                       
DEBU[0002] exit with `FAILURE`: 1                       
DEBU[0002] exit with `FAILURE`: 1                       
DEBU[0002] exit with `FAILURE`: 1                       
Error: exit with `FAILURE`: 1
@svdgraaf
Copy link

I've hit the same issue, I've found that if you set a GITHUB_TOKEN env var, it doesn't give the bad credentials error, and proceeds, only to fail a bit later:

$ GITHUB_TOKEN=foobar act
...
[tests.yml/tests]   ❗  ::error::Version 3.8 with arch x64 not found%0AThe list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/master/versions-manifest.json
[tests.yml/tests]   ❌  Failure - Setup Python

@svdgraaf
Copy link

svdgraaf commented May 20, 2020

I'm not sure, but I think it fails because I'm running it on osx, but the installation is running through the docker container on linux, and it's not understanding which version it should install. I think? :)

The manifest does contain the right version it should use: https://raw.githubusercontent.com/actions/python-versions/master/versions-manifest.json

[tests.yml/tests]   💬  ::debug::Semantic version spec of 3.8.3 is 3.8.3
[tests.yml/tests]   💬  ::debug::isExplicit: 3.8.3
[tests.yml/tests]   💬  ::debug::explicit? true
[tests.yml/tests]   💬  ::debug::checking cache: /opt/hostedtoolcache/Python/3.8.3/x64
[tests.yml/tests]   💬  ::debug::not found
| Version 3.8.3 was not found in the local cache
[tests.yml/tests]   💬  ::debug::check 3.8.3 satisfies 3.8.3
[tests.yml/tests]   💬  ::debug::x64===x64 && darwin===linux
[tests.yml/tests]   💬  ::debug::x64===x64 && darwin===linux
[tests.yml/tests]   💬  ::debug::x64===x64 && linux===linux
[tests.yml/tests]   💬  ::debug::x64===x64 && linux===linux
[tests.yml/tests]   💬  ::debug::x64===x64 && win32===linux
[tests.yml/tests]   💬  ::debug::x86===x64 && win32===linux
[tests.yml/tests]   💬  ::debug::check 3.8.2 satisfies 3.8.3
[tests.yml/tests]   💬  ::debug::check 3.8.1 satisfies 3.8.3
[tests.yml/tests]   💬  ::debug::check 3.8.0 satisfies 3.8.3
[tests.yml/tests]   💬  ::debug::check 3.7.7 satisfies 3.8.3
[tests.yml/tests]   💬  ::debug::check 3.7.6 satisfies 3.8.3
[tests.yml/tests]   💬  ::debug::check 3.7.5 satisfies 3.8.3
[tests.yml/tests]   💬  ::debug::check 3.6.10 satisfies 3.8.3
[tests.yml/tests]   💬  ::debug::check 3.6.9 satisfies 3.8.3
[tests.yml/tests]   💬  ::debug::check 3.6.8 satisfies 3.8.3
[tests.yml/tests]   💬  ::debug::check 3.6.7 satisfies 3.8.3
[tests.yml/tests]   💬  ::debug::check 3.5.9 satisfies 3.8.3
[tests.yml/tests]   💬  ::debug::check 3.5.4 satisfies 3.8.3
[tests.yml/tests]   💬  ::debug::check 2.7.18 satisfies 3.8.3
[tests.yml/tests]   💬  ::debug::check 2.7.17 satisfies 3.8.3
[tests.yml/tests]   ❗  ::error::Version 3.8.3 with arch x64 not found%0AThe list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/master/versions-manifest.json
[tests.yml/tests]   ❌  Failure - Setup Python
DEBU[0003] exit with `FAILURE`: 1```

@rgarrigue
Copy link
Author

For the records I'm running it under Ubuntu 19.10

@whettie
Copy link

whettie commented May 21, 2020

So good.

@RaulBSantos
Copy link

Same here, and I'm using ElementaryOS under Ubuntu 18.04.4.

Some of you guys tried with another image? Just wondering if this may solve, cause I couldn't try with the alternative image, my disk space it's insufficient :(

@rgarrigue
Copy link
Author

rgarrigue commented May 25, 2020

@RaulBSantos it does work running

act -P ubuntu-latest=nektos/act-environments-ubuntu:18.04

...
[Tests/tests] ⭐  Run Setup Python
[Tests/tests]   ☁  git clone 'https://github.com/actions/setup-python' # ref=v2
[Tests/tests]   🐳  docker cp src=/home/remy/.cache/act/actions-setup-python@v2 dst=/actions/
[Tests/tests]   💬  ::debug::Semantic version spec of 3.7 is 3.7
[Tests/tests]   💬  ::debug::isExplicit: 
[Tests/tests]   💬  ::debug::explicit? false
[Tests/tests]   💬  ::debug::isExplicit: 2.7.17
[Tests/tests]   💬  ::debug::explicit? true
[Tests/tests]   💬  ::debug::isExplicit: 3.5.9
[Tests/tests]   💬  ::debug::explicit? true
[Tests/tests]   💬  ::debug::isExplicit: 3.6.10
[Tests/tests]   💬  ::debug::explicit? true
[Tests/tests]   💬  ::debug::isExplicit: 3.7.6
[Tests/tests]   💬  ::debug::explicit? true
[Tests/tests]   💬  ::debug::isExplicit: 3.8.1
[Tests/tests]   💬  ::debug::explicit? true
[Tests/tests]   💬  ::debug::evaluating 5 versions
[Tests/tests]   💬  ::debug::matched: 3.7.6
[Tests/tests]   💬  ::debug::checking cache: /opt/hostedtoolcache/Python/3.7.6/x64
[Tests/tests]   💬  ::debug::Found tool in cache Python 3.7.6 x64
[Tests/tests]   ⚙  ::set-env:: pythonLocation=/opt/hostedtoolcache/Python/3.7.6/x64
[Tests/tests]   ⚙  ::add-path:: /opt/hostedtoolcache/Python/3.7.6/x64
[Tests/tests]   ⚙  ::add-path:: /opt/hostedtoolcache/Python/3.7.6/x64/bin
[Tests/tests]   ⚙  ::set-output:: python-version=3.7.6
| Successfully setup CPython (3.7.6)
[Tests/tests]   ❓  ##[add-matcher]/actions/actions-setup-python@v2/.github/python.json
[Tests/tests]   ✅  Success - Setup Python
...

Since that's fine enought for me I'll add the -P option to my .actrc.

For other user willing to push the investigation, the setup-python author suggested following this guideline https://github.com/actions/setup-python#using-setup-python-with-a-self-hosted-runner. I gave it a quick shot without success.

@april
Copy link

april commented Jun 12, 2020

Yep, I'm having the exact same problem here as well. On macOS, always gives me the the Version ... with arch x64 not found error, even if I specify something as specific as 3.8.3.

Setting the .actrc as specified above did fix things, however.

@grische
Copy link

grische commented Jun 18, 2020

I created a simple test file which re-creates the problem

name: pull_requests
on: [pull_request]

jobs:
  test_pr:
    runs-on: ubuntu-18.04
    steps:
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: "3.7"

It is fixed by adding the -P parameter like the following:

$ act -P ubuntu-18.04=nektos/act-environments-ubuntu:18.04 pull_request
[pull_requests/test_pr] 🚀  Start image=nektos/act-environments-ubuntu:18.04
[pull_requests/test_pr]   🐳  docker run image=nektos/act-environments-ubuntu:18.04 entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[pull_requests/test_pr] ⭐   Run Set up Python
[pull_requests/test_pr]   ☁  git clone 'https://github.com/actions/setup-python' # ref=v2
[pull_requests/test_pr]   🐳  docker cp src=/home/user/.cache/act/actions-setup-python@v2 dst=/actions/
[pull_requests/test_pr]   💬  ::debug::Semantic version spec of 3.7 is 3.7
[pull_requests/test_pr]   💬  ::debug::isExplicit:
[pull_requests/test_pr]   💬  ::debug::explicit? false
[pull_requests/test_pr]   💬  ::debug::isExplicit: 2.7.17
[pull_requests/test_pr]   💬  ::debug::explicit? true
[pull_requests/test_pr]   💬  ::debug::isExplicit: 3.5.9
[pull_requests/test_pr]   💬  ::debug::explicit? true
[pull_requests/test_pr]   💬  ::debug::isExplicit: 3.6.10
[pull_requests/test_pr]   💬  ::debug::explicit? true
[pull_requests/test_pr]   💬  ::debug::isExplicit: 3.7.6
[pull_requests/test_pr]   💬  ::debug::explicit? true
[pull_requests/test_pr]   💬  ::debug::isExplicit: 3.8.1
[pull_requests/test_pr]   💬  ::debug::explicit? true
[pull_requests/test_pr]   💬  ::debug::evaluating 5 versions
[pull_requests/test_pr]   💬  ::debug::matched: 3.7.6
[pull_requests/test_pr]   💬  ::debug::checking cache: /opt/hostedtoolcache/Python/3.7.6/x64
[pull_requests/test_pr]   💬  ::debug::Found tool in cache Python 3.7.6 x64
[pull_requests/test_pr]   ⚙  ::set-env:: pythonLocation=/opt/hostedtoolcache/Python/3.7.6/x64
[pull_requests/test_pr]   ⚙  ::add-path:: /opt/hostedtoolcache/Python/3.7.6/x64
[pull_requests/test_pr]   ⚙  ::add-path:: /opt/hostedtoolcache/Python/3.7.6/x64/bin
[pull_requests/test_pr]   ⚙  ::set-output:: python-version=3.7.6
| Successfully setup CPython (3.7.6)
[pull_requests/test_pr]   ❓   ##[add-matcher]/actions/actions-setup-python@v2/.github/python.json
[pull_requests/test_pr]   ✅   Success - Set up Python

Here are the respective lines from the setup-python action:
https://github.com/actions/setup-python/blob/807b74f98ca701f414ddaa8a4187e7cffa93cbbd/dist/index.js#L999-L1023

Here is my lsb-release file:

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"
$ uname -a
Linux DESKTOP-WINDOWS10 4.19.104-microsoft-standard #1 SMP Wed Feb 19 06:37:35 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

EDIT: Removed my previous invalid comment

@imbillow
Copy link

the problem still exists

@dskvr
Copy link

dskvr commented Jul 16, 2020

In order for this to work, one would write a docker file using nektos/act-environments-ubuntu:18.04 as a base image (FROM nektos/act-environments-ubuntu:18.04) that would need to include all caveats listed here.

Sounds like @rgarrigue tried something like this without success. Bummer.

@raleighlittles
Copy link

Still having this problem as well, running Ubuntu 20.04.1 LTS, with 5.4.0-42-generic as my kernel (if that helps or matters at all).

@dustydecapod
Copy link

Still a frelling issue

@maxphillipsdev
Copy link

I just ran into this issue as well :(
Screen Shot 2020-09-21 at 7 33 04 PM

@rickstaa
Copy link

I solved this by using the method explained by @grische.

@noliran
Copy link

noliran commented Oct 9, 2020

Found the problem -
@actions/tool-cache:lib/manifest.js uses _readLinuxVersionFile() to determine the version of the ubuntu distribution using the line DISTRIB_RELEASE=18.04 in /etc/lsb-release .
This file doesn't exist in node:12.6-buster-slim, the default image act currently uses.
I'm currently using this as workaround:

      - run: |
          # Hack to get setup-python to work on act
          if [ ! -f "/etc/lsb-release" ] ; then
            echo "DISTRIB_RELEASE=18.04" > /etc/lsb-release
          fi

Not really sure what's the right fix here - It doesn't make sense that @actions/setup-python treats Ubuntu's release version as platform_version and hands out Python versions based on it. That doesn't make sense..

@charlielito
Copy link

Same problem with Ubuntu20.04, @noliran solution solved it

@rickstaa
Copy link

rickstaa commented Nov 1, 2020

@noliran his solution worked for me. I use it in the following way:

# Pull request ci config file
# Note: For local testing with https://github.com/nektos/act use the
# `sudo act -P ubuntu-18.04=nektos/act-environments-ubuntu:18.04` command.
name: MLC pull CI

on:
  # Trigger the workflow on a pull request,
  # but only for the master branch
  pull_request:
    branches:
      - master

jobs:
  build:
    name: runner / build
    runs-on: ubuntu-18.04
    steps:
      - uses: actions/checkout@v2
      - name: local-fix
        run: |
          # Hack to get setup-python to work on act
          # (see https://github.com/nektos/act/issues/251)
          if [ ! -f "/etc/lsb-release" ] ; then
            echo "DISTRIB_RELEASE=18.04" > /etc/lsb-release
          fi
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: "3.8"

@rickstaa
Copy link

rickstaa commented Nov 1, 2020

Related to this pull request actions/toolkit#594.

@github-actions
Copy link
Contributor

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

@github-actions github-actions bot added the stale label Jan 16, 2021
@raleighlittles
Copy link

The PR fixing this issue still hasn't been merged.

@github-actions github-actions bot removed the stale label Jan 19, 2021
@bashbang
Copy link

This has still been a problem for me on my OSX. I incorporated the "hack" that @noliran mentioned above and deleted the /Users/{myusername}/.cache/act/* and now works as expected.

      - run: |
          # Hack to get setup-python to work on act
          if [ ! -f "/etc/lsb-release" ] ; then
            echo "DISTRIB_RELEASE=18.04" > /etc/lsb-release
          fi

@github-actions
Copy link
Contributor

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

@github-actions github-actions bot added the stale label Mar 19, 2021
@dgw
Copy link

dgw commented Mar 27, 2021

Still waiting on actions/toolkit#594

@github-actions github-actions bot removed the stale label Mar 28, 2021
@catthehacker
Copy link
Member

Hi all, if you will use medium or large image (https://github.com/nektos/act#runners) there shouldn't be any problem as those include lsb-release which will successfully provide OS version to setup-python.
As this is external issue, I will close this.

@GatlenCulp
Copy link

It's 2024 and this is still an issue

GatlenScreen_001029  2024-07-22_14 42  (Code)@2x

GatlenScreen_001035  2024-07-22_14 44  (Code)@2x

GatlenScreen_001031  2024-07-22_14 42  (Code)@2x

GatlenScreen_001033  2024-07-22_14 43  (Code)@2x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests