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

Setup Python 3.6 fails #480

Closed
2 of 5 tasks
wico-silva opened this issue Aug 12, 2022 · 2 comments
Closed
2 of 5 tasks

Setup Python 3.6 fails #480

wico-silva opened this issue Aug 12, 2022 · 2 comments
Labels
bug Something isn't working needs triage

Comments

@wico-silva
Copy link

Description:
Setup Python 3.6 fails. More recent versions work as expected. Other self-hosted runners on the same system using Python 3.6 work perfectly fine.

Action version:
Tried v2, v3, and v4.

Platform:

  • Ubuntu 18.04
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:
Python 3.6 (tested 3.6.9 and 3.6.15)

Repro steps:

      - name: Set up Python 3.6
        uses: actions/setup-python@v4
        with:
          python-version: '3.6'

Expected behavior:
Python 3.6 is setup.

Actual behavior:

Errors are raised:

Version 3.6 was not found in the local cache
Version 3.6 is available for downloading
Download from "https://github.com/actions/python-versions/releases/download/3.6.15-116025/python-3.6.15-linux-18.04-x64.tar.gz"
Extract downloaded archive
/bin/tar xz --warning=no-unknown-keyword -C /home/wico-ci/actions-runner/_work/_temp/a1ef9ec2-c97a-4f38-9085-f1201f1cc9b8 -f /home/wico-ci/actions-runner/_work/_temp/5659f7a1-5f41-49b7-8b7b-172e1ecc4b81
Execute installation script
Check if Python hostedtoolcache folder exist...
Create Python 3.6.15 folder
Copy Python binaries to hostedtoolcache folder
Create additional symlinks (Required for the UsePythonVersion Azure Pipelines task and the setup-python GitHub Action)
Upgrading PIP...
Looking in links: /tmp/tmpacczqm3y
Requirement already satisfied: setuptools in /home/wico-ci/actions-runner/_work/_tool/Python/3.6.15/x64/lib/python3.6/site-packages (40.6.2)
Requirement already satisfied: pip in /home/wico-ci/actions-runner/_work/_tool/Python/3.6.15/x64/lib/python3.6/site-packages (18.1)
Error: Exception:
Traceback (most recent call last):
  File "/home/wico-ci/actions-runner/_work/_tool/Python/3.6.15/x64/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 143, in main
    status = self.run(options, args)
  File "/home/wico-ci/actions-runner/_work/_tool/Python/3.6.15/x64/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 259, in run
    with self._build_session(options) as session:
  File "/home/wico-ci/actions-runner/_work/_tool/Python/3.6.15/x64/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 76, in _build_session
    if options.cache_dir else None
  File "/home/wico-ci/actions-runner/_work/_tool/Python/3.6.15/x64/lib/python3.6/posixpath.py", line 80, in join
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not int
Error: Traceback (most recent call last):
  File "/home/wico-ci/actions-runner/_work/_tool/Python/3.6.15/x64/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/wico-ci/actions-runner/_work/_tool/Python/3.6.15/x64/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/wico-ci/actions-runner/_work/_tool/Python/3.6.15/x64/lib/python3.6/site-packages/pip/__main__.py", line 19, in <module>
    sys.exit(_main())
  File "/home/wico-ci/actions-runner/_work/_tool/Python/3.6.15/x64/lib/python3.6/site-packages/pip/_internal/__init__.py", line 78, in main
    return command.main(cmd_args)
  File "/home/wico-ci/actions-runner/_work/_tool/Python/3.6.15/x64/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 184, in main
    timeout=min(5, options.timeout)
  File "/home/wico-ci/actions-runner/_work/_tool/Python/3.6.15/x64/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 76, in _build_session
    if options.cache_dir else None
  File "/home/wico-ci/actions-runner/_work/_tool/Python/3.6.15/x64/lib/python3.6/posixpath.py", line 80, in join
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not int
Error: The process '/bin/bash' failed with exit code 1

Python 3.7 and above are working though 😕.
To make things worse I have setup a few other self-hosted runners on the same system, all using Python 3.6, and all of them are working perfectly 😖 .

@wico-silva wico-silva added bug Something isn't working needs triage labels Aug 12, 2022
@wico-silva
Copy link
Author

I just saw that there's a closed issue that is identical (the tool cache path seems to be different): #355

Sadly it was closed because the author dropped support for 3.6 not because there is a solution.
I cannot drop Python 3.6 and moreover it works fine on other runners.

@wico-silva
Copy link
Author

I was able to fix the issue.
It seems the problem was caused by pip being unable to upgrade using the cache. I solved this by manually upgrading the system pip with --no-cache-dir:

python -m pip install --upgrade --no-cache-dir pip

Having said that, I don't know why this solves the problem or why the other runners never had any issue.

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

No branches or pull requests

1 participant