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

Delete artifact api request sometimes fails - add retry? #6

Closed
pankajbokdia opened this issue Sep 18, 2020 · 6 comments
Closed

Delete artifact api request sometimes fails - add retry? #6

pankajbokdia opened this issue Sep 18, 2020 · 6 comments
Labels
enhancement New feature or request support support request

Comments

@pankajbokdia
Copy link

pankajbokdia commented Sep 18, 2020

I am getting this error when using this

Run christian-korneck/delete-run-artifacts-action@v1
with:
parent_runid: 261405865
parent_repo: pankajbokdia/repoName
env:
GITHUB_TOKEN: ***
[@octokit/rest] const Octokit = require("@octokit/rest") is deprecated. Use const { Octokit } = require("@octokit/rest") instead
[@octokit/rest] const Octokit = require("@octokit/rest") is deprecated. Use const { Octokit } = require("@octokit/rest") instead
artifacts before deletion: 1
processing artifact: build 18063905
status: 204
artifacts after deletion: 1
##[error]🛑 not all artifacts deleted (1 remaining)

Please help

@christian-korneck christian-korneck added bug Something isn't working and removed bug Something isn't working labels Sep 18, 2020
@christian-korneck
Copy link
Owner

christian-korneck commented Sep 18, 2020

hi @pankajbokdia , thanks for reaching out.
Unfortunately I can't reproduce your problem. I just created a test repo with a minimal github workflow that creates two artifacts and then triggers this action to delete them. The deletion just worked fine.

Here's the test repo (feel free to use it as a reference):
https://github.com/christian-korneck/test322

That's from the log of the workflow run:

Run christian-korneck/delete-run-artifacts-action@v1
[@octokit/rest] `const Octokit = require("@octokit/rest")` is deprecated. Use `const { Octokit } = require("@octokit/rest")` instead
artifacts before deletion: 2
processing artifact: test1 18080653
[@octokit/rest] `const Octokit = require("@octokit/rest")` is deprecated. Use `const { Octokit } = require("@octokit/rest")` instead
status: 204
processing artifact: test2 18080654
status: 204
artifacts after deletion: 0
🎉 all artifacts deleted

Is your repo available publicly somewhere? Or could you share the relevant parts of the workflow? Thanks.

@christian-korneck christian-korneck added the support support request label Sep 18, 2020
@joeleduardo
Copy link

joeleduardo commented Sep 23, 2020

i got the same error but looks is randomly if i re-run the action works!!

@christian-korneck
Copy link
Owner

Thanks @joeleduardo for the comment. Sounds a bit like a github reliability issue. However, I've never seen it and also couldn't reproduce it even with a high number of test runs. How often do you see this happen? (I could imagine that these are rare partial server side outages of certain github services?). Is there anything special about the way you handle artifacts in your workflow (i.e. very large artifacts, etc)?

(If someone would point me to a public repo with a failed run I could contact github support?)

@Asamsig
Copy link

Asamsig commented Sep 24, 2020

We also get this error intermittently, but artifacts are always deleted, to us it seems like a cache issue or similar, simply that Github reports artifacts that have actually been deleted.
We could be interested in adding a retry option, if you're open for that.

@christian-korneck
Copy link
Owner

ok, judging from the number of reports in this issue this seems to happen more often than I expected.

We could be interested in adding a retry option, if you're open for that.

sounds like a good idea. Feel free to send a PR, if you like.

@christian-korneck christian-korneck added the enhancement New feature or request label Sep 24, 2020
@christian-korneck christian-korneck changed the title Delete artifact not working Delete artifact api request sometimes fails - add retry? Sep 24, 2020
@christian-korneck christian-korneck changed the title Delete artifact api request sometimes fails - add retry? Delete artifact api request sometimes fails with http/204 - add retry? Sep 24, 2020
@christian-korneck
Copy link
Owner

christian-korneck commented Apr 8, 2021

I've now added this backoff retry behaviour:

  • when no artifacts are found, retry for up to ~ 4 minutes
  • when we end up with undeleted artifacts, retry for up to ~ 20 minutes

I hope this solves your problems @Asamsig @joeleduardo @pankajbokdia . If not, let me know. Thanks a lot for your feedback!

@christian-korneck christian-korneck changed the title Delete artifact api request sometimes fails with http/204 - add retry? Delete artifact api request sometimes fails - add retry? Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request support support request
Projects
None yet
Development

No branches or pull requests

4 participants