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

[bug] Failed to CreateArtifact: Failed to make request after 5 attempts: Request timeout #569

Open
lukaszcl opened this issue May 21, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@lukaszcl
Copy link

lukaszcl commented May 21, 2024

What happened?

I'm seeing random failures in Github Actions when trying to upload artifacts:

2024-05-21T02:14:34.9725770Z With the provided path, there will be 9 files uploaded
2024-05-21T02:14:34.9727364Z Artifact name is valid!
2024-05-21T02:14:34.9728185Z Root directory input is valid!
2024-05-21T02:14:40.0221024Z Attempt 1 of 5 failed with error: Request timeout: /twirp/github.actions.results.api.v1.ArtifactService/CreateArtifact. Retrying request in 3000 ms...
2024-05-21T02:14:48.0300611Z Attempt 2 of 5 failed with error: Request timeout: /twirp/github.actions.results.api.v1.ArtifactService/CreateArtifact. Retrying request in 4541 ms...
2024-05-21T02:14:57.5783685Z Attempt 3 of 5 failed with error: Request timeout: /twirp/github.actions.results.api.v1.ArtifactService/CreateArtifact. Retrying request in 7858 ms...
2024-05-21T02:15:10.4508466Z Attempt 4 of 5 failed with error: Request timeout: /twirp/github.actions.results.api.v1.ArtifactService/CreateArtifact. Retrying request in 11672 ms...
2024-05-21T02:15:27.1556076Z ##[error]Failed to CreateArtifact: Failed to make request after 5 attempts: Request timeout: /twirp/github.actions.results.api.v1.ArtifactService/CreateArtifact

Happened multiple times in the last week. I'm using ubuntu-latest runner. Example: https://github.com/smartcontractkit/chainlink/actions/runs/9167647126/job/25205269179

What 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

@lukaszcl lukaszcl added the bug Something isn't working label May 21, 2024
@NxPKG
Copy link

NxPKG commented May 26, 2024

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:

  1. Increase Timeout and Retry Logic:

    • The default retry logic might not be sufficient due to intermittent network issues or load on GitHub's servers. You could try to increase the timeout and retry logic if configurable.
  2. Check Network and Server Load:

    • Ensure that there are no network issues on your end. Sometimes, intermittent network problems can cause such issues.
    • Check GitHub's status page to ensure there are no ongoing incidents or maintenance activities.
  3. Use actions/upload-artifact:

    • Ensure you are using the latest version of the actions/upload-artifact. Sometimes, upgrading to the latest version can resolve underlying issues.
  4. Split Artifacts:

    • If you are uploading a large number of files or large files, consider splitting them into smaller chunks or separate artifacts.
  5. Custom Action with Enhanced Retry Logic:

    • If the problem persists, you might want to create a custom action with enhanced retry logic, including exponential backoff or increased number of retries.

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.

Additional Tips:

  • Monitor GitHub Status: Always monitor the GitHub Status Page for any ongoing issues.
  • Contact GitHub Support: If this issue persists, consider reaching out to GitHub support for further assistance, as they might provide more insights or fix server-related issues on their side.

@carlcsaposs-canonical
Copy link

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: actions/download-artifact#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

@trihoang1
Copy link

I met the same issue on actions/upload-artifact@v4
image

@stephen-carter-at-sf
Copy link

stephen-carter-at-sf commented Aug 2, 2024

carlcsaposs-canonical added a commit to canonical/data-platform-workflows that referenced this issue Aug 19, 2024
carlcsaposs-canonical added a commit to canonical/data-platform-workflows that referenced this issue Aug 19, 2024
carlcsaposs-canonical added a commit to canonical/data-platform-workflows that referenced this issue Aug 19, 2024
carlcsaposs-canonical added a commit to canonical/data-platform-workflows that referenced this issue Aug 19, 2024
@zanieb
Copy link

zanieb commented Oct 2, 2024

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?

@jsoref
Copy link

jsoref commented Oct 30, 2024

For my reference, I hit this today: https://github.com/orgs/community/discussions/143089

remittor added a commit to remittor/zapret-openwrt that referenced this issue Nov 9, 2024
@marcodicro-dp
Copy link

Same happening to me at the moment:

image

@momentmaker
Copy link

yep same here. could someone please take a look?

@rwader-swi
Copy link

same in my case. Atleast please don't deprecate v3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

10 participants