dify icon indicating copy to clipboard operation
dify copied to clipboard

CI autofix workflow fails with 504 when downloading python-build-standalone

Open lyzno1 opened this issue 2 months ago • 1 comments

Problem

The autofix.yml workflow fails intermittently with 504 errors when uv sync tries to download python-build-standalone from GitHub releases. Ref: error

error: Failed to download cpython-3.11.14+20251209-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz
Caused by: Request failed after 3 retries

Root Cause

setup-uv with python-version parameter downloads Python from python-build-standalone releases, which can be unreliable.

Solution

Use actions/setup-python before setup-uv to provide Python from GitHub's official cache, avoiding the need for uv to download Python.

lyzno1 avatar Dec 13 '25 07:12 lyzno1

The root cause is confirmed: when setup-uv is used with the python-version parameter, it tries to download Python from python-build-standalone releases, which can be unreliable and cause 504 errors in CI workflows if the download fails or times out. This is exactly what happens in the current autofix.yml workflow, since it does not pre-install Python and relies on setup-uv to fetch it each time (source).

To fix this, add an actions/setup-python step before setup-uv. This ensures Python is installed from GitHub's cache, so setup-uv will use the existing interpreter and skip the unreliable download (source). Here’s how you can update your autofix.yml:

steps:
  - uses: actions/checkout@v4

  - uses: actions/setup-python@v5
    with:
      python-version: "3.11"

  - uses: astral-sh/setup-uv@v6
    with:
      python-version: "3.11"

  # ...rest of your steps

This change will make the workflow more reliable by avoiding direct downloads from python-build-standalone. There are no compatibility issues with using both actions together, but it does add a redundant step since setup-uv can handle Python setup itself—however, this redundancy is worthwhile for CI reliability in this case (source).

After making this change, monitor your CI runs to confirm the 504 errors no longer occur. If you want to optimize further, you can periodically check if setup-uv’s upstream reliability improves and consider removing the extra setup-python step in the future.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

dosubot[bot] avatar Dec 13 '25 07:12 dosubot[bot]