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

HTTP error 404 on deletion stops processing #74

Open
ehuelsmann opened this issue Dec 28, 2024 · 4 comments
Open

HTTP error 404 on deletion stops processing #74

ehuelsmann opened this issue Dec 28, 2024 · 4 comments

Comments

@ehuelsmann
Copy link

Hi,

Thanks a lot for this Action! I've started using the action to clean up old packages in our org (ledgersmb); for the last - and most used and until now most often manually cleaned - package, I'm getting a 404 on the DELETE call. (See https://github.com/ledgersmb/ledgersmb-docker/actions/runs/12526197538/job/34938501087). Although it's obviously unexpected that the package doesn't exist, but I'd say this should be a WARNing, not an error, because the end result is the intended result: It doesn't exist.

Regards,
Erik.

@rohanmars
Copy link
Contributor

Hi @ehuelsmann

That's great to hear.

Definately agree. I saw the same thing in one of my own repos a few weeks ago. I think it's a github API error/bug/timing issue. It doesn't make sense for the package API to return a package to which a delete then returns a 404. I've coded around it by catching 404 and printing out a warning (as you've also suggested). All other errors will trigger errors still. I've only done the work currently in my own fork. I'll merge/release sometime soon.

ee7b64f#diff-df3f033f405e2152d400f4bc608d95c38e2c37eac9e4ec3c3d951320abe56bab

@rohanmars
Copy link
Contributor

In my case I actually saw a 500 error followed by a 404 in the logs. The retry layer retried the github API call from the 500, but the delete call went through even though it returned a 500. Your log doesn't have the same flow. More strange the package API actually returned that package but deleting it caused a 404, it could be a timing issue if the image was just built and then deleted. The fix I have will at least swallow those errors.

@ehuelsmann
Copy link
Author

In my case, two workflows used the action, triggered some time apart (a minute?); both failed, which seems to contradict your reasoning. Maybe I should register a support issue with GitHub if the package keeps being reported even after a cleanup of your action has been successfully run on our repository. For now, I'll see what happens after several runs with your "continue on 404" change.

@rohanmars
Copy link
Contributor

How are the images pushed into that repository/package? From the same repo or from a different repo pipeline? It may be a permission problem. The default GitHub token may not have permission to delete that package, even though it can see it and get the manifest.

It might be a useful test to use a PAT token with the cleanup action if it was pushed into the package using a PAT from a different repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants