Skip to content

Responded 500 while finalizing the artifact upload #27077

Closed
@YueLengM

Description

@YueLengM

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions