oven-sh / setup-bun

Set up your GitHub Actions workflow with a specific version of Bun
MIT License
449 stars 37 forks source link

Setup Bun Action Fails Due to Request Timeout #82

Closed azishio closed 5 months ago

azishio commented 5 months ago

Workaround

(Edited by @Jarred-Sumner)

      - name: Setup Bun
        uses: oven-sh/setup-bun@1.2.2
        with:
          bun-download-url: "https://github.com/oven-sh/bun/releases/latest/download/bun-${{runner.os == 'macOS' && 'darwin' || runner.os}}-${{ runner.arch == 'X64' && 'x64' || 'arm64' }}.zip"

The bun-download-url input lets you override the download URL to use and skip the redirect / version resolution.


Description

I'm using oven-sh/setup-bun@v1 in my GitHub Actions workflow to deploy a Next.js site to GitHub Pages. This action used to work without issues, but today I encountered repeated request timeouts when trying to download Bun.

Console Output

Here is the relevant part of the console output:

Run oven-sh/setup-bun@v1
  with:
    bun-version: latest
    no-cache: false
Downloading a new version of Bun: https://bun.sh/download/latest/linux/x64?avx2=true&profile=false
Request timeout: /download/latest/linux/x64?avx2=true&profile=false
Waiting 18 seconds before trying again
Request timeout: /download/latest/linux/x64?avx2=true&profile=false
Waiting 20 seconds before trying again

Workflow File

Below is the workflow file I'm using:

name: Deploy Next.js site to Pages

on:
  push:
    branches: ["main"]
  workflow_dispatch:

permissions:
  contents: read
  pages: write
  id-token: write

concurrency:
  group: "pages"
  cancel-in-progress: false

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Setup Bun
        uses: oven-sh/setup-bun@v1
        with:
          bun-version: latest
      - name: Setup Pages
        uses: actions/configure-pages@v5
        with:
          static_site_generator: next
      - name: Restore cache
        uses: actions/cache@v4
        with:
          path: |
            .next/cache
          key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
          restore-keys: |
            ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
      - name: Install dependencies
        run: bun install
      - name: Build with Next.js
        run: bun run build
      - name: Upload artifact
        uses: actions/upload-pages-artifact@v3
        with:
          path: ./out

  deploy:
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    runs-on: ubuntu-latest
    needs: build
    steps:
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v4

(This text has been translated from Japanese by ChatGPT and DeepL)

nephix commented 5 months ago

Same here

Jarred-Sumner commented 5 months ago

Looking into this now.

hmmhmmhm commented 5 months ago
스크린샷 2024-06-02 오후 7 09 36

I'm getting the same error. I've posted the above issue on Bun's official discord. https://discord.com/channels/876711213126520882/1246770196992229428

Jarred-Sumner commented 5 months ago

It seems that Fly.io is having an incident in their Bucharest region, which is also where this redirecting app is currently hosted. Looking into migrating to a different region.

Workaround to try:

      - name: Setup Bun
        uses: oven-sh/setup-bun@1
        with:
          bun-download-url: "https://github.com/oven-sh/bun/releases/latest/download/bun-${{runner.os == 'macOS' && 'darwin' || runner.os}}-${{ runner.arch == 'X64' && 'x64' || 'arm64' }}.zip"

The bun-download-url input lets you override the download URL to use and skip the redirect / version resolution.

hmmhmmhm commented 5 months ago
스크린샷 2024-06-02 오후 7 38 04 스크린샷 2024-06-02 오후 7 39 03 스크린샷 2024-06-02 오후 7 39 45

@Jarred-Sumner The alternative you provided doesn't seem to be working yet.

Jarred-Sumner commented 5 months ago

Looks like bun-download-url is not included in actions.yml, I will push an update.

https://github.com/oven-sh/setup-bun/blob/8f24390df009a496891208e5e36b8a1de1f45135/src/index.ts#L65

azishio commented 5 months ago

Warnings occurred, but @Jarred-Sumner 's measures enabled him to deploy the system successfully.

Setup Bun

Warning: Unexpected input(s) 'bun-download-url', valid inputs are ['bun-version', 'registry-url', 'scope', 'no-cache']
Run oven-sh/setup-bun@v1
  with:
    bun-version: latest
    bun-download-url: https://github.com/oven-sh/bun/releases/latest/download/bun-Linux-x64.zip
    no-cache: false
Downloading a new version of Bun: https://github.com/oven-sh/bun/releases/latest/download/bun-Linux-x64.zip
/usr/bin/unzip -o -q /home/runner/work/_temp/4ec6c1ca-ad97-44f5-8f04-7df9db8903dc
/home/runner/.bun/bin/bun --revision
1.1.1[2](https://github.com/azishio/seismic-response-web/actions/runs/9337673936/job/25699852379#step:3:2)+43f0913c3

Post Setup Bun

Warning: Unexpected input(s) 'bun-download-url', valid inputs are ['bun-version', 'registry-url', 'scope', 'no-cache']
Post job cleanup.

https://github.com/azishio/seismic-response-web/actions/runs/9337673936

(By the way, the inclusion of my project's commits in this history was an unintended behaviour. Next time I'll look into how not to do that and run the commits.)

hmmhmmhm commented 5 months ago

Warnings occurred, but @Jarred-Sumner 's measures enabled him to deploy the system successfully.

https://github.com/azishio/seismic-response-web/actions/runs/9337673936

스크린샷 2024-06-02 오후 7 55 18

Thx bro! this is work!

- name: Setup Bun
  uses: oven-sh/setup-bun@v1
  with:
    bun-version: latest
    bun-download-url: "https://github.com/oven-sh/bun/releases/latest/download/bun-${{runner.os == 'macOS' && 'darwin' || runner.os}}-${{ runner.arch == 'X64' && 'x64' || 'arm64' }}.zip"
azishio commented 5 months ago

However, the warnings seem to say that the bun-download-url is not valid. Why did it work?

Jarred-Sumner commented 5 months ago

@azishio I have just released an update which adds the bun-download-url input to the action

azishio commented 5 months ago

Understood. Thank you @Jarred-Sumner for your quick work.

I would like to close the issue as I believe our problem has now been resolved.

iM-GeeKy commented 5 months ago

Is this resolved? I'm using

- uses: oven-sh/setup-bun@v1
  with:
    bun-version: latest

and it still appears to be hanging

Screenshot 2024-06-02 at 7 15 40 AM
azishio commented 5 months ago

Ah, the method provided by @Jarred-Sumner solved the problem, but it may fail if you don't override the URL.

I shouldn't have closed the Issue until a series of issues had been reported.

Apologies.

Reopen this Issue until those issues are reported.

alator21 commented 5 months ago

My last workflow just worked. I think flyio resolved their issues

azishio commented 5 months ago

Yes, I also removed the 'bun-download-url' and confirmed it works fine.

Screenshot_20240602-214558~2

Now that the issue has been resolved, I close this one this time.