Open lukaszcl opened 6 months ago
Random failures in GitHub Actions when trying to upload artifacts can be frustrating, particularly when they result in timeouts after multiple attempts. Here are a few suggestions and steps you can take to mitigate this problem:
Increase Timeout and Retry Logic:
Check Network and Server Load:
Use actions/upload-artifact
:
actions/upload-artifact
. Sometimes, upgrading to the latest version can resolve underlying issues.Split Artifacts:
Custom Action with Enhanced Retry Logic:
Here is an example of how you can configure the actions/upload-artifact
with additional context or custom retry logic:
name: Upload Artifacts with Retry Logic
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build project
run: |
# Your build commands here
echo "Building project..."
- name: Upload artifacts with retry
run: |
for i in {1..5}; do
if [ $i -gt 1 ]; then
echo "Retry attempt $i"
sleep $((i * 3))
fi
if gh api -X POST -F artifact='@artifact.zip' /repos/:owner/:repo/actions/artifacts | jq -e '.id'; then
echo "Artifact uploaded successfully"
break
elif [ $i -eq 5 ]; then
echo "Failed to upload artifact after $i attempts"
exit 1
fi
done
- name: Upload artifacts using action
uses: actions/upload-artifact@v3
with:
name: my-artifact
path: path/to/artifacts/
In the custom retry logic step, replace the gh api
command with the actual command that uploads the artifact, and adjust the retry delay as needed.
Also seeing this, for example: https://github.com/canonical/postgresql-k8s-operator/actions/runs/9638014269/job/26578262353#step:22:16
Also seeing this on download-artifact: https://github.com/actions/download-artifact/issues/338
We're using the latest version of actions/upload-artifact
and we're using ubuntu-latest
runners (hosted by GitHub, we have no control over networking)
https://www.githubstatus.com/history shows no incidents when we encountered this issue
I met the same issue on actions/upload-artifact@v4
I'm seeing this issue right now over at: https://github.com/forcedotcom/sfdx-scanner/actions/runs/10216682015/job/28268718086#step:11:19
--- Rerunning my workflow worked. So this seemed to just be a blip of sorts. https://github.com/forcedotcom/sfdx-scanner/actions/runs/10216830278
I'm also seeing this frequently on v4, e.g. this run. It usually succeeds on retry. Is there any plan to have more robust retries in this action?
For my reference, I hit this today: https://github.com/orgs/community/discussions/143089
Same happening to me at the moment:
yep same here. could someone please take a look?
same in my case. Atleast please don't deprecate v3
What happened?
I'm seeing random failures in Github Actions when trying to upload artifacts:
Happened multiple times in the last week. I'm using
ubuntu-latest
runner. Example: https://github.com/smartcontractkit/chainlink/actions/runs/9167647126/job/25205269179What did you expect to happen?
Artifacts should be successfully uploaded.
How can we reproduce it?
This is an issue that happens randomly
Anything else we need to know?
No response
What version of the action are you using?
v4.3.3
What are your runner environments?
linux
Are you on GitHub Enterprise Server? If so, what version?
No response