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

Responded 500 while finalizing the artifact upload #27077

Closed
YueLengM opened this issue Sep 14, 2023 · 4 comments
Closed

Responded 500 while finalizing the artifact upload #27077

YueLengM opened this issue Sep 14, 2023 · 4 comments
Labels

Comments

@YueLengM
Copy link

YueLengM commented Sep 14, 2023

Description

Files are uploaded to S3 but can't finish the upload.

Gitea log where 500 was responded:

2023/09/14 17:59:04 ...actions/artifacts.go:358:comfirmUploadArtifact() [E] Error merging chunks: merged file size is not equal to chunk length
2023/09/14 17:59:04 ...eb/routing/logger.go:102:func1() [I] router: completed PATCH /api/actions_pipeline/_apis/pipelines/workflows/68/artifacts?api-version=6.0-preview&artifactName=latest_commit.zip for <server ip>:0, 500 Internal Server Error in 3664.7ms @ <autogenerated>:1(actions.artifactRoutes.comfirmUploadArtifact-fm)
Uploaded files in S3

5 chunk files that was uploaded to S3 corresponding to 5 attempts in the upload action: (All working zip file)

image

action

name: archive diff

on:
  push:
    branches: [main]

jobs:
  archive:
    runs-on: ubuntu-latest

    steps:
      - name: Setup LFS
        run: |
          curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
          apt-get install git-lfs
          git lfs install
          git lfs env

      - uses: actions/checkout@v3
        with:
          fetch-depth: 2
      
      - name: Fix LFS header issue
        run: |
          UrlBase=$GITHUB_SERVER_URL; \
          UrlLfsBase=$UrlBase/${{ gitea.repository }}.git/info/lfs/objects; \
          Auth=`/usr/bin/git config --get --local http.$UrlBase/.extraheader`; \
          /usr/bin/git config --local http.${UrlLfsBase}/batch.extraheader "$Auth"; \
          /usr/bin/git config --local http.${UrlLfsBase}/.extraheader ''

          git config --local lfs.transfer.maxretries 1

      - name: Get changed files
        id: diff
        run: |
          git diff --name-only --diff-filter=ACMR HEAD~ > .diff-file
          echo count=$(wc -l < .diff-file) >> $GITHUB_OUTPUT

      - name: List all modified files
        if: ${{ steps.diff.outputs.count > 0}}
        run: |
          cat .diff-file

      - name: Archive diff
        if: ${{ steps.diff.outputs.count > 0}}
        shell: bash
        run: |
          IFS=$'\n'
          git archive -o latest_commit.zip HEAD $(cat .diff-file)
          unset IFS

      - name: Upload artifact
        if: ${{ steps.diff.outputs.count > 0}}
        uses: actions/upload-artifact@v3
        with:
          name: latest_commit.zip
          path: latest_commit.zip
          retention-days: 10

act_runner log

gitea log

Gitea Version

1.20.4

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.40.1 in gitea
2.30.2 in runner

Operating System

Debian

How are you running Gitea?

Docker

Database

MySQL/MariaDB

@YueLengM
Copy link
Author

Tested on local storage also got 500.

minio local
< 8 MB ✔️ ✔️
> 8 MB

@YueLengM
Copy link
Author

fixed in #24874

@CReimer
Copy link

CReimer commented Oct 13, 2023

I'm having the same problem still on Gitea 1.20.5

This can easily be tested with this sample action

name: Artifact Test
run-name: ${{ gitea.actor }} testing artifacts
on: [push]

jobs:
  Artifact-Test:
    runs-on: alpine-latest
    steps:
      - name: Set up
        run: apk add nodejs-current xz
      - name: Compress
        run: |
          head -c 72457330 </dev/urandom >/tmp/test.txt
      - uses: actions/upload-artifact@v3
        with:
          name: test.txt
          path: /tmp/test.txt

@YueLengM
Copy link
Author

YueLengM commented Oct 13, 2023

I'm having the same problem still on Gitea 1.20.5

This can easily be tested with this sample action

name: Artifact Test
run-name: ${{ gitea.actor }} testing artifacts
on: [push]

jobs:
  Artifact-Test:
    runs-on: alpine-latest
    steps:
      - name: Set up
        run: apk add nodejs-current xz
      - name: Compress
        run: |
          head -c 72457330 </dev/urandom >/tmp/test.txt
      - uses: actions/upload-artifact@v3
        with:
          name: test.txt
          path: /tmp/test.txt

The fix didn't backport to 1.20. Needs waiting for 1.21.0 or uses 1.21rc1 version for now.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants