actions / setup-python

Set up your GitHub Actions workflow with a specific version of Python
MIT License
1.59k stars 505 forks source link

Failing with current ubuntu:latest container #854

Closed ay0o closed 1 month ago

ay0o commented 2 months ago

Description: Starting somewhere between yesterday and today, setup-python is failing with the current ubuntu:latest container.

Action version: v4, v5

Platform:

Runner type:

Tools version: All versions.

Repro steps:
Use the action with any job with container: ubuntu:latest

Expected behavior: Python is configured

Actual behavior:

 Version 3.12 was not found in the local cache
  Error: The version '3.12' with architecture 'x64' was not found for this operating system.
  The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json

Workaround: Instead of latest, use another tag such as 22.04.

HarithaVattikuti commented 2 months ago

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

ay0o commented 2 months ago

this is the SHA of the current latest: sha256:562456a05a0dbd62a671c1854868862a4687bf979a96d48ae8e766642cd911e8

bdlake commented 2 months ago

Experienced the same error on our self-hosted runners using ubuntu:latest base image. Just as @ay0o suggested, using ubuntu:22.04 for latest 22.04 image fixed the issue. Seems that latest 24.04 image caused it https://hub.docker.com/layers/library/ubuntu/latest/images/sha256-28a2b328825ac02db5c29d9356bfba80ba6c4b6ebfcac5a91a4656fa3453775a?context=explore

ay0o commented 1 month ago

the content of /etc/lsb-release has not changed and uses the same format as expected by the code of the action in the _getOsVersion() function:

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=24.04
DISTRIB_CODENAME=noble
DISTRIB_DESCRIPTION="Ubuntu 24.04 LTS"

Also, just in case something odd happened, os.platform() returns linux as expected:

> os.platform()
'linux'

EDIT:

ah well... never mind, the issue is as simple as Ubuntu 24.04 is missing here https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json

ay0o commented 1 month ago

So, in summary:

Ubuntu 24.04 was released a week ago and since then, marking the beginning of this issue because the tag latest replaced the previous version.

However, python-versions has not caught up with it and it's missing the release for 24.04.

ay0o commented 1 month ago

Ubuntu 24.04 is already available at https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json, hence solving this issue

aparnajyothi-y commented 1 month ago

Hello @ay0o, Thank you once again for creating this issue. We have investigated the issue, actions/python-versions added the support for python-version : 3.12.3 for ubuntu-24.04 and ubuntu-latest tag is placed to 22.04 instead of 24.04. Please find the screenshots for reference. Please let us know in case of any further clarifications needed.

image image
stweil commented 1 month ago

"Run actions/setup-python@v5" still fails for Python 3.8 in my GitHub actions with Ubuntu 24.04 (see example).