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

Ignore-not-found issue #143

Open
Skrgich opened this issue Jun 11, 2024 · 0 comments
Open

Ignore-not-found issue #143

Skrgich opened this issue Jun 11, 2024 · 0 comments

Comments

@Skrgich
Copy link

Skrgich commented Jun 11, 2024

I noticed that you fixed ignore-not-found issue with #138 but it still not working completely for me.

DESTROY MODE - delete *
NOT FOUND - *
DESTROY MODE - delete *
DESTROY MODE - delete *
Traceback (most recent call last):
   ...
  File "*.local/lib/python3.10/site-packages/artifactory_cleanup/artifactorycleanup.py", line 61, in cleanup
    policy.delete(artifact, destroy=self.destroy, ignore_not_found=self.ignore_not_found)
  File "*.local/lib/python3.10/site-packages/artifactory_cleanup/rules/base.py", line 321, in delete
    r.raise_for_status()
  File "*.local/lib/python3.10/site-packages/requests/models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error:  for url:  ***LINK***

And when i open the link it looks like this:

{
  "errors": [
    {
      "status": 404,
      "message": "File not found."
    }
  ]
}

But it fails because it's checking only for status code 404. I fixed it locally by just adding code 500 to the exception.
I'm not sure if something's wrong with my artifactory or is it bug for artifactory-cleanup, if it is let me know and i can open a PR.

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

No branches or pull requests

1 participant