setup-python icon indicating copy to clipboard operation
setup-python copied to clipboard

Setup permission error operation not permitted: 'cert.pem'

Open cemlyn007 opened this issue 2 years ago • 3 comments

Good morning! Sorry for posting but my head has gone numb from keyboard smashing xD

Description: I setup the runner following the setup-python guide and have given my normal account read and write permissions recursively through the /Users/runner/hostedtoolcache. I am running the run.sh script in a terminal, I'll worry about starting it as a service later!

  Create hostedtoolcach symlinks (Required for the backward compatibility)
  Create Python 3.11.6 folder
  Create additional symlinks (Required for the UsePythonVersion Azure Pipelines task and the setup-python GitHub Action)
  Upgrading pip...
  Looking in links: /var/folders/yr/c7fx1m5n45g0114s34b3j6p80000gn/T/tmpy5s3x_sm
  Requirement already satisfied: setuptools in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (65.5.0)
  Requirement already satisfied: pip in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (23.3)
  Collecting pip
  Using cached pip-23.3.1-py3-none-any.whl.metadata (3.5 kB)
  Using cached pip-23.3.1-py3-none-any.whl (2.1 MB)
  Installing collected packages: pip
  Successfully installed pip-23.3
  Install OpenSSL certificates
  Requirement already satisfied: certifi in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (2023.7.22)
  -- pip install --upgrade certifi
   -- removing any existing file or link
   -- creating symlink to certifi certificate bundle
   -- setting permissions
  Error: Traceback (most recent call last):
    File "<stdin>", line 44, in <module>
    File "<stdin>", line 40, in main
  PermissionError: [Errno 1] Operation not permitted: 'cert.pem'
  Error: The process '/bin/bash' failed with exit code 1

I imagine the line comes from here (not I can't make an issue in python-version so I came here sorry)

Action version: actions/setup-python@v4

Platform:

  • [ ] Ubuntu
  • [x ] macOS
  • [ ] Windows

Runner type:

  • [ ] Hosted
  • [ x] Self-hosted

Tools version: 3.10, 3.11 and 3.12 and probably the rest :3

** My setup ** Followed the normal setup of a GitHub runner for M1, no environment variables have been played with, I just made sure to give my normal user "cemlyn" (that is runs the ./run.sh from actions-runner) read write recursive permissions to /Users/runner/hostedtoolcache

cemlyn007 avatar Oct 21 '23 12:10 cemlyn007

Is it possible for: sh -e "${PYTHON_APPLICATION_PATH}/Install Certificates.command" to only be run if for example cert.pem doesn't have STAT_0o775 already set via os.chmod?

cemlyn007 avatar Oct 21 '23 12:10 cemlyn007

Hello @cemlyn007. Thank you for your report. We'll take a look at this issue.

dmitry-shibanov avatar Oct 23 '23 07:10 dmitry-shibanov

Thanks @dmitry-shibanov!

cemlyn007 avatar Oct 23 '23 16:10 cemlyn007