Closed rgarrigue closed 3 years ago
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
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```
For the records I'm running it under Ubuntu 19.10
So good.
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 :(
@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.
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.
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
the problem still exists
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.
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).
Still a frelling issue
I just ran into this issue as well :(
I solved this by using the method explained by @grische.
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..
Same problem with Ubuntu20.04, @noliran solution solved it
@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"
Related to this pull request https://github.com/actions/toolkit/pull/594.
Issue is stale and will be closed in 14 days unless there is new activity
The PR fixing this issue still hasn't been merged.
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
Issue is stale and will be closed in 14 days unless there is new activity
Still waiting on actions/toolkit#594
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.
It's 2024 and this is still an issue
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.
And here's the verbose log