actions / runner-images

GitHub Actions runner images
MIT License
9.4k stars 2.91k forks source link

Python enviroment can not be build after image version upgrade #9382

Closed zhangzhengxin closed 4 months ago

zhangzhengxin commented 4 months ago

Description

the pipeline builds a python 3.9.6 env using pyenv with the following code

pip --disable-pip-version-check install pyenv-win==3.1.1 --target "$env:USERPROFILE\.pyenv"
[System.Environment]::SetEnvironmentVariable('PYENV',$env:USERPROFILE + "\.pyenv\pyenv-win\","User")
[System.Environment]::SetEnvironmentVariable('PYENV_HOME',$env:USERPROFILE + "\.pyenv\pyenv-win\","User")
[System.Environment]::SetEnvironmentVariable('path', $env:USERPROFILE + "\.pyenv\pyenv-win\bin;" + $env:USERPROFILE + "\.pyenv\pyenv-win\shims;" + [System.Environment]::GetEnvironmentVariable('path', "User"),"User")
$env:PYENV = $env:USERPROFILE + "\.pyenv\pyenv-win\"
$env:PATH = $env:USERPROFILE + "\.pyenv\pyenv-win\bin;" + $env:USERPROFILE + "\.pyenv\pyenv-win\shims;" + $env:PATH

pyenv rehash
pyenv install 3.9.6

The expected output is below, it was working until 02/12/2024

Collecting pyenv-win==2.64.11
  Downloading pyenv_win-2.64.11-py3-none-any.whl (44 kB)
     ---------------------------------------- 44.0/44.0 kB 2.3 MB/s eta 0:00:00
Installing collected packages: pyenv-win
Successfully installed pyenv-win-2.64.11
No version installed. Please install one with 'pyenv install <version>'.
:: [Info] ::  Mirror: https://www.python.org/ftp/python
:: [Downloading] ::  3.9.6 ...
:: [Downloading] ::  From https://www.python.org/ftp/python/3.9.6/python-3.9.6-amd64-webinstall.exe
:: [Downloading] ::  To   C:\Users\VssAdministrator\.pyenv\pyenv-win\install_cache\python-3.9.6-amd64-webinstall.exe
:: [Installing] ::  3.9.6 ...
:: [Info] :: completed! 3.9.6

However, Starting from Feb 13,2024, the image version upgraded from 20240204.1.0 to 20240211.1.0, the pipeline breaks with the following error.

Collecting pyenv-win==2.64.11
  Downloading pyenv_win-2.64.11-py3-none-any.whl (44 kB)
     ---------------------------------------- 44.0/44.0 kB 1.1 MB/s eta 0:00:00
Installing collected packages: pyenv-win
Successfully installed pyenv-win-2.64.11
No version installed. Please install one with 'pyenv install <version>'.
:: [Info] ::  Mirror: https://www.python.org/ftp/python
:: [Downloading] ::  3.9.6 ...
:: [Downloading] ::  From https://www.python.org/ftp/python/3.9.6/python-3.9.6-amd64-webinstall.exe
:: [Downloading] ::  To   C:\Users\VssAdministrator\.pyenv\pyenv-win\install_cache\python-3.9.6-amd64-webinstall.exe
:: [Installing] ::  3.9.6 ...
:: [Error] :: error using web installer.
:: [Error] :: couldn't install 3.9.6
pyenv specific python requisite didn't meet. Project is using different version of python.
Install python '3.9.6' by typing: 'pyenv install 3.9.6'
##[error]Invoke-Command: D:\a\_temp\af355b48-9406-4b26-a70a-89aa67a99d8d.ps1:10

Platforms affected

Runner images affected

Image version and build link

Image version: 20240211.1.0

Is it regression?

20240204.1.0

Expected behavior

Python environment built successfully and carry on with the pipeline

Actual behavior

Pipeline broke and exit

Repro steps

source code are exactly the same, only change is the image version change from 20240204.1 to 20240211.1.

zhangzhengxin commented 4 months ago

Please close this issue, something must have been changed or fixed, we can not reproduce the same error.

zhangzhengxin commented 4 months ago

@mikhailkoliada the error happened when running pyenv install to to create the env. The reason I raised the issue here is because the only thing changed was the image version, the same pyenv worked in previous image version.

However, I can not reproduce the error anymore, the reason is unclear.