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

Artifact upload fails with RuntimeError 500, Repo key cannot be empty #126

Closed
fuzzmz opened this issue Dec 4, 2019 · 0 comments · Fixed by #127
Closed

Artifact upload fails with RuntimeError 500, Repo key cannot be empty #126

fuzzmz opened this issue Dec 4, 2019 · 0 comments · Fixed by #127

Comments

@fuzzmz
Copy link
Contributor

fuzzmz commented Dec 4, 2019

When trying to upload an artifact we error out with

RuntimeError: {
  "errors" : [ {
    "status" : 500,
    "message" : "Repo key cannot be empty. Path: api/storage/MoonFish"
  } ]
}

Code to reproduce the issue:

from artifactory import ArtifactoryPath


def main():
    artifactory = ArtifactoryPath("http://my-artifactory/artifactory/", auth=('user', 'password'))
    upload_path = artifactory / 'upload-dest'
    upload_path.deploy_file('./sample-file')


if __name__ == '__main__':
    main()

Problem is caused by get_stat_json creating an invalid Artifactory Storage API request by duplicating the / between artifactory and api.

In the example above, when we reach get_stat_json and process the url, instead of getting
http://my-artifactory/artifactory/api/storage/upload-dest
we get http://my-artifactory/artifactory//api/storage/upload-dest (notice the // between artifactory and api).

allburov added a commit that referenced this issue Dec 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant