devopshq / artifactory-cleanup

Extended cleanup tool for JFrog Artifactory
MIT License
111 stars 61 forks source link

Support for jfrog cloud #104

Open bharat-mukheja opened 1 year ago

bharat-mukheja commented 1 year ago

Hi,

Thanks a lot for this awesome tool! I tried running it for our team's jfrog cloud artifactory (ybdb.jfrog.io). But the tool is adding /storage in between the url and the repo name. e.g. if the repo name is yugabyte and the url for the repo is https://ybdb.jfrog.io/artifactory/yugabyte/ then the tool is trying to go the url https://ybdb.jfrog.io/artifactory/api/storage/yugabyte which doesn't exist. The error gets thrown is as below.

[bmukheja@devserver-bkumar-2 ~]$ artifactory-cleanup --destroy
********************************************************************************
Destroy MODE
Checking 'yugabyte' repository exists.
401 Client Error:  for url: https://ybdb.jfrog.io/artifactory/api/storage/yugabyte
The yugabyte repository does not exist!

Any help here?

allburov commented 1 year ago

It'd be good to reuse ArtifactorySaaSPath and ArtifactoryPath from the library https://github.com/devopshq/artifactory/blob/master/artifactory.py#L2455

No quick fixes for this one, I think.

Or if it's too hard - somehow add ability to add saas: true to config file and perform all request like Cloud version requires

Looking for help here!

stefanpantic-pdftools commented 1 year ago

Hey, I'm using this plugin and had the same error for my jFrog Cloud subscription. The issue is that your access token does not have permissions to access the resource. Fixing the token made it work again. The plugin supports the Cloud flavor of jFrog.

cmuriukin commented 1 year ago

An open and general approach to troubleshooting this issue, you can try the following:

Check that the repository named "yugabyte" exists. You can do this by logging into the Artifactory server and navigating to the "Repositories" page. Check that you have permission to access the repository named "yugabyte". You can do this by logging into the Artifactory server and navigating to the "Permissions" page. If the repository exists and you have permission to access it, then the problem is likely with the artifactory-cleanup tool. You can try the following to troubleshoot the artifactory-cleanup tool:

Make sure that the artifactory-cleanup tool is installed and configured correctly. You can find installation instructions for the artifactory-cleanup tool on the JFrog website. Make sure that the artifactory-cleanup tool is using the correct URL for the Artifactory server. You can find the URL for the Artifactory server by logging into the Artifactory server and navigating to the "Administration" page. You can contact JFrog support for assistance if you are still having trouble.