Repository navigation
self-hosted tools cache setup not working automatically on Linux & Mac with v2 #89
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't workingv2relates to the v2 version of setup-pythonrelates to the v2 version of setup-python
Description
Hi, I am getting Version 2.x with arch x64 not found error message from my self-hosted runner on ubuntu 18.04. However, I can see that version 2.7.18 is in the versions-manifest.json file.
Run actions/setup-python@v2
Version 2.x was not found in the local cache
Version 2.x is available for downloading
Download from "https://github.com/actions/python-versions/releases/download/2.7.18-20200429.22/python-2.7.18-ubuntu-1804-x64.tar.gz"
Extract downloaded archive
/bin/tar xz --warning=no-unknown-keyword -C ./7ab082fa-bc6a-4a50-9c0e-bb389ac0bcfd -f /home/runner/actions-runner/_work/_temp/7ab082fa-bc6a-4a50-9c0e-bb389ac0bcfd
Execute installation script
##[error]Version 2.x with arch x64 not found
The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/master/versions-manifest.json
manifest.json
{
"version": "2.7.17",
"stable": true,
"release_url": "https://github.com/actions/python-versions/releases/tag/2.7.17-20200429.31",
"files": [
{
"filename": "python-2.7.17-macos-1014-x64.tar.gz",
"arch": "x64",
"platform": "darwin",
"platform_version": "10.14",
"download_url": "https://github.com/actions/python-versions/releases/download/2.7.17-20200429.31/python-2.7.17-macos-1014-x64.tar.gz"
},
{
"filename": "python-2.7.17-macos-1014-x64.tar.gz",
"arch": "x64",
"platform": "darwin",
"platform_version": "10.15",
"download_url": "https://github.com/actions/python-versions/releases/download/2.7.17-20200429.31/python-2.7.17-macos-1014-x64.tar.gz"
},
{
"filename": "python-2.7.17-ubuntu-1604-x64.tar.gz",
"arch": "x64",
"platform": "linux",
"platform_version": "16.04",
"download_url": "https://github.com/actions/python-versions/releases/download/2.7.17-20200429.31/python-2.7.17-ubuntu-1604-x64.tar.gz"
},
{
"filename": "python-2.7.17-ubuntu-1804-x64.tar.gz",
"arch": "x64",
"platform": "linux",
"platform_version": "18.04",
"download_url": "https://github.com/actions/python-versions/releases/download/2.7.17-20200429.31/python-2.7.17-ubuntu-1804-x64.tar.gz"
},
{
"filename": "python-2.7.17-windows-2016-x64.zip",
"arch": "x64",
"platform": "win32",
"download_url": "https://github.com/actions/python-versions/releases/download/2.7.17-20200429.31/python-2.7.17-windows-2016-x64.zip"
},
{
"filename": "python-2.7.17-windows-2016-x86.zip",
"arch": "x86",
"platform": "win32",
"download_url": "https://github.com/actions/python-versions/releases/download/2.7.17-20200429.31/python-2.7.17-windows-2016-x86.zip"
}
]
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingv2relates to the v2 version of setup-pythonrelates to the v2 version of setup-python
Activity
shoukoo commentedon May 4, 2020
I am also getting the error message when installing
python 3.xkonradpabjan commentedon May 4, 2020
This looks like the local tools cache setup isn't working for the first time when running on linux?
The download appears to be fine, however, the setup script must be running into some issues. Investigating... (most likely an env variable isn't set or something)
Edit: If you set an env variable called
AGENT_TOOLSDIRECTORYwith something such asexport AGENT_TOOLSDIRECTORY=~it will almost successfully set everything up. Still figuring out why it doesn't work..If the value is set to
~, it would create a directory~/Pythonand everything would be copied over and setup in there.[-]Version 2.x with arch x64 not found[/-][+]self-hosted tools cache setup not working on Linux with v2[/+]bharath-kotha commentedon May 5, 2020
I'm also getting a similar error but it says that bash has exited with exit code 1 while installing.
galleon commentedon May 6, 2020
Same issue on macos as well.
Is that connected to the fact of running Runner with elevated rights ?
freeatnet commentedon May 6, 2020
@konradpabjan Happy Satellite day!
I'm seeing a similar issue with a self-hosted runner I set up yesterday on Ubuntu 18.04. Here is what happens when I try to set up Python 3.8 with the latest actions/python-versions release:
Are the steps to debugging this documented somewhere? I don't see any output from
setup.sh, can I fork and modify python-versions to debug it?konradpabjan commentedon May 6, 2020
So getting this to work automatically on Mac and Linux is going to require some extra steps. I'm working on updating the
READMEwith a easy(ish) guide on how to do this after I figure out the last step to this puzzle.There are a couple of things going on here.
AGENT_TOOLSDIRECTORYenv variable needs to be set to/opt/hostedtoolcache(on Linux at least, different on Mac). We compile Python in this directory with--enable-sharedso it is non-portable and it has to always be located in the same place (see here). If the path is different you'll get an error likeerror while loading shared libraries: libpython3.7m.so.1.0when reaching the end ofsetup.sh/opt/hostedtoolcachedirectory, you need to be running assudoto modify this. However, if you're tried starting the runner with sudo, you'll get an error that saysMust not run interactively with sudo. To get around this, you have to configure passwordless sudo which is what our hosted runners dosetup.shfile that is downloaded so that all that necessary commands likemkdirrun withsudoor so thatsetup-pythondoes all the necessary magic behind the scenes (what i'm trying to get working)konradpabjan commentedon May 6, 2020
@freeatnet Thanks for the wishes! There were some pretty cool stuff announced at satellite that we can't wait for everyone to get their hands on😀
You can go ahead and fork this! We have some guidelines on how you can debug and test locally here
The output of
setup.shis silenced, that is configured byexechereYou can also run the
setup.shfile locally. So if you have a self-hosted runner configured and you run a workflow withsetup-python@v2, there is a_workdirectory. If you navigate down you should see something like_work/my-repo/my-repo/some-crazy-hash-that-is-unique-per-run/. Inside here you'll find thesetup.shfile that gets downloaded along with the.tgzfile for a specific version of Python.freeatnet commentedon May 7, 2020
@konradpabjan You're spot on with the shared library issue, that's actually where I stopped last time. However, I see that the runner sets
RUNNER_TOOL_CACHE=/home/runner/actions-runner/_work/_tool, which is now picked up by the setup script. Is that the right path or shouldRUNNER_TOOL_CACHEbe/opt/hostedtoolcache?Edit: Well, this is a terrible, terrible, no-good hack, but this works:
BrightRan commentedon May 8, 2020
Related problem on macOS runner: https://git.xywcc.community/t5/GitHub-Actions/Issue-running-setup-python-on-macos-self-hosted-runner/td-p/56902
[-]self-hosted tools cache setup not working on Linux with v2[/-][+]self-hosted tools cache setup not working automatically on Linux & Mac with v2[/+]konradpabjan commentedon May 8, 2020
Figured it out, PR to update the
READMEwith some new setup info. #90It's not going to be fully automatic and some manual setups are required, but it works!
konradpabjan commentedon May 11, 2020
The
READMEhas been updated with instructions on how to configure self-hosted runners! Should work now for Mac and Linux. Windows has gotten some more instructions too.Mogost commentedon May 13, 2020
I followed all the recommendations from the
READMEfile, but still get the error. I don’t know where I could make a mistake. Everywhere as far as I can see the correct permissions and recommended variables. In the logs, I do not see anything critical.