Responded 500 while finalizing the artifact upload #11655

Closed
opened 2025-11-02 09:43:36 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @YueLengM on GitHub (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

Originally created by @YueLengM on GitHub (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) ``` <details><summary>Uploaded files in S3</summary> <p> 5 chunk files that was uploaded to S3 corresponding to 5 attempts in the upload action: (All working zip file) ![image](https://github.com/go-gitea/gitea/assets/11801894/4eb34510-11dc-43ed-86b7-76e922c91bf7) </p> </details> <details><summary>action</summary> <p> ``` yaml 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 ``` </p> </details> [act_runner log](https://github.com/go-gitea/gitea/files/12607725/act_runner-kf3-20230914181835.log) [gitea log](https://github.com/go-gitea/gitea/files/12607726/gitea-vj6N-20230914182318.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
GiteaMirror added the type/bug label 2025-11-02 09:43:36 -06:00
Author
Owner

@YueLengM commented on GitHub (Sep 14, 2023):

Tested on local storage also got 500.

minio local
< 8 MB ✔️ ✔️
> 8 MB
@YueLengM commented on GitHub (Sep 14, 2023): Tested on local storage also got 500. | | minio | local | |:--------:|:-----:|:-----:| | < 8 MB | ✔️ | ✔️ | | > 8 MB | ❌ | ❌ |
Author
Owner

@YueLengM commented on GitHub (Sep 15, 2023):

fixed in #24874

@YueLengM commented on GitHub (Sep 15, 2023): fixed in #24874
Author
Owner

@CReimer commented on GitHub (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
@CReimer commented on GitHub (Oct 13, 2023): I'm having the same problem still on Gitea 1.20.5 This can easily be tested with this sample action ```yml 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 ```
Author
Owner

@YueLengM commented on GitHub (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.

@YueLengM commented on GitHub (Oct 13, 2023): > I'm having the same problem still on Gitea 1.20.5 > > This can easily be tested with this sample action > > ```yaml > 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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11655