question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

self-hosted tools cache setup not working automatically on Linux & Mac with v2

See original GitHub issue

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"
      }
    ]
  }

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12

github_iconTop GitHub Comments

3reactions
konradpabjancommented, May 7, 2020

So getting this to work automatically on Mac and Linux is going to require some extra steps. I’m working on updating the README with 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.

  • The AGENT_TOOLSDIRECTORY env variable needs to be set to /opt/hostedtoolcache (on Linux at least, different on Mac). We compile Python in this directory with --enable-shared so 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 like error while loading shared libraries: libpython3.7m.so.1.0 when reaching the end of setup.sh
  • Because we’re in the /opt/hostedtoolcache directory, you need to be running as sudo to modify this. However, if you’re tried starting the runner with sudo, you’ll get an error that says Must not run interactively with sudo. To get around this, you have to configure passwordless sudo which is what our hosted runners do
  • Even with both set, there needs to either be some modifications done to the setup.sh file that is downloaded so that all that necessary commands like mkdir run with sudo or so that setup-python does all the necessary magic behind the scenes (what i’m trying to get working)
2reactions
konradpabjancommented, May 5, 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_TOOLSDIRECTORY with something such as export 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 ~/Python and everything would be copied over and setup in there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

self-hosted tools cache setup not working automatically on ...
Run actions/setup-python@v2 Version 3.8 was not found in the local cache Version 3.8 is available for downloading Download from ...
Read more >
Mattermost self-hosted changelog
Mattermost is an open source platform for secure collaboration across the entire software development lifecycle. This changelog summarizes updates for the ...
Read more >
Deploy a registry server - Docker Documentation
Before you can deploy a registry, you need to install Docker on the host. A registry is an instance of the registry image,...
Read more >
Install GitLab Runner
Documentation for GitLab Community Edition, GitLab Enterprise Edition, Omnibus GitLab, and GitLab Runner.
Read more >
GitKraken Client FAQs | Answers to Common Questions
Answers to FAQs about GitKraken Client regarding integrations, technical issues, and other support related questions.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found