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

python setup fails on self-hosted mac runner "permission denied" #792

Closed
2 of 5 tasks
easazade opened this issue Jan 16, 2024 · 5 comments
Closed
2 of 5 tasks

python setup fails on self-hosted mac runner "permission denied" #792

easazade opened this issue Jan 16, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@easazade
Copy link

Description:
python-setup fails when ran on a self-hosted mac. the runner is an m1 mac mini

Action version:
Specify the action version

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

action

- name: Python setup
  uses: actions/setup-python@v5
  with:
    python-version: "3.11.6"

error:

Run actions/setup-python@v5
  with:
    python-version: 3.11.6
    cache: pip
    architecture: x64
    check-latest: false
    token: ***
    update-environment: true
    allow-prereleases: false
  env:
    JAVA_HOME: /Users/appledev/Development/actions-runner/_work/_tool/Java_Adopt_jdk/1[2](https://github.com/evoleen/adhero_app/actions/runs/7540441452/job/20525017324#step:4:2).0.2-10.[3](https://github.com/evoleen/adhero_app/actions/runs/7540441452/job/20525017324#step:4:3)/x6[4](https://github.com/evoleen/adhero_app/actions/runs/7540441452/job/20525017324#step:4:4)/Contents/Home
    JAVA_HOME_12_X64: /Users/appledev/Development/actions-runner/_work/_tool/Java_Adopt_jdk/12.0.2-10.3/x64/Contents/Home
Installed versions
  Version 3.11.6 was not found in the local cache
  Version 3.11.6 is available for downloading
  Download from "https://github.com/actions/python-versions/releases/download/3.11.6-6388688740/python-3.11.6-darwin-x64.tar.gz"
  Extract downloaded archive
  /usr/bin/tar xz -C /Users/appledev/Development/actions-runner/_work/_temp/8d8d634f-c39[5](https://github.com/evoleen/adhero_app/actions/runs/7540441452/job/20525017324#step:4:5)-4080-b8b4-4d44[6](https://github.com/evoleen/adhero_app/actions/runs/7540441452/job/20525017324#step:4:6)30[7](https://github.com/evoleen/adhero_app/actions/runs/7540441452/job/20525017324#step:4:7)60[8](https://github.com/evoleen/adhero_app/actions/runs/7540441452/job/20525017324#step:4:8)5 -f /Users/appledev/Development/actions-runner/_work/_temp/[9](https://github.com/evoleen/adhero_app/actions/runs/7540441452/job/20525017324#step:4:9)3cd97af-2819-4c72-94d4-4919f53f[10](https://github.com/evoleen/adhero_app/actions/runs/7540441452/job/20525017324#step:4:10)d3
  Execute installation script
  Check if Python hostedtoolcache folder exist...
  Creating Python hostedtoolcache folder...
  Error: mkdir: /Users/runner: Permission denied
  Error: The process '/bin/bash' failed with exit code 1
@easazade easazade added bug Something isn't working needs triage labels Jan 16, 2024
@HarithaVattikuti
Copy link
Contributor

Hello @easazade
Thank you for creating this issue. We will investigate it and get back to you as soon as we have some feedback.

@priya-kinthali
Copy link
Contributor

Hello @easazade ,
Thank you for creating this issue and providing detailed information about the error you encountered.
Based on the error you've shared, it appears that the problem occurs when the self-hosted runner trying to create a directory at /Users/runner/ but doesn't have the adequate permissions to do so.
To overcome this, you need to ensure that the directory exists and the runner has the right permissions to access and modify it. In advanced-usage.md, you can find a comprehensive guide that can assist you in setting up the necessary permissions.
Completing the steps detailed in the document ensures the self-hosted runner has the necessary permissions to create directories and write to them, which should fix the permission denied error you're encountering.
Hope this helps!


@mateuszkwiecinski
Copy link

Looks like this could be fixed by #708 👀

Looking at the logs the user on self-hosted runner is /Users/appledev/ while the action attempts to access /Users/runner for some reason.
The advanced-usage.md linked above doesn't take into account cases when it's not allowed to modify users/user groups or touch files outside of runner home directory

@priya-kinthali
Copy link
Contributor

Hello👋, I'm going to close the issue for now because this is current behaviour of the action as described in comment .
In case of any issues please feel free to reach us out.
Thankyou!

@mateuszkwiecinski
Copy link

In case of any issues please feel free to reach us out.

@priya-kinthali Can you prioritise merging #708 which will fix the current, invalid behavior?

If you don't have sudo permissions you can't modify other user's files (using a self-hosted runner you don't fully own), so while the current behavior works as documented it doesn't seem to work as intended :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants