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

actions/setup-python@v4 is unable to install python in the ubuntu example because of wrong user permissions on /opt/hostedtoolcache #2303

Closed
MarkArts opened this issue Aug 2, 2022 · 1 comment

Comments

@MarkArts
Copy link
Contributor

MarkArts commented Aug 2, 2022

When using the ubuntu example and running a job that uses actions/setup-python@v4 like this:

jobs:
  isort:
    runs-on: [self-hosted, ubuntu20.04-self]
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v4
        with:
          python-version: 3.8
      - uses: isort/isort-action@master

The following error is thrown (this is the output in the githbub action)

> Run actions/setup-python@v4
Version 3.8 was not found in the local cache
Version 3.8 is available for downloading
Download from "https://github.com/actions/python-versions/releases/download/3.8.13-2717995909/python-3.8.13-linux-20.04-x64.tar.gz"
Extract downloaded archive
/usr/bin/tar xz --warning=no-unknown-keyword -C /opt/actions-runner/_work/_temp/7e4817be-5a33-40ea-b076-5dc694464992 -f /opt/actions-runner/_work/_temp/a95cf3ec-296c-4b20-937f-850ee461640a
Execute installation script
Check if Python hostedtoolcache folder exist...
Creating Python hostedtoolcache folder...
Error: mkdir: cannot create directory ‘/opt/hostedtoolcache/Python’
Error: : Permission denied
Error: The process '/usr/bin/bash' failed with exit code 1

It seems like this happens because the example user_data.sh script uses the upercase variable $USER_NAME while the install_runners.sh script that sets the permissions on /opt/hostedtoolcache uses $user_name.

I created a PR that fixes this and can sucefully run the above job on our setup:
#2302

@github-actions
Copy link
Contributor

github-actions bot commented Sep 2, 2022

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed if no further activity occurs. Thank you for your contributions.

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

No branches or pull requests

1 participant