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

get build runs failed with an exception #366

Closed
donhui opened this issue Aug 26, 2022 · 0 comments · Fixed by #367
Closed

get build runs failed with an exception #366

donhui opened this issue Aug 26, 2022 · 0 comments · Fixed by #367
Labels

Comments

@donhui
Copy link
Contributor

donhui commented Aug 26, 2022

when I get build runs, it failed with an exception, the error log as follows

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dohq_artifactory/exception.py", line 22, in raise_for_status
    response.raise_for_status()
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests-2.27.1-py3.7.egg/requests/models.py", line 960, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error:  for url: https://jfrog.xxx.cn/artifactory/api/build/maven-demo/1-build-snapshot

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/donghui/Desktop/repos/pylib-scripts/test_art.py", line 18, in <module>
    all_runs = build1.runs
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/artifactory.py", line 2433, in runs
    return self.build_manager.get_build_runs(self.name)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/artifactory.py", line 2559, in get_build_runs
    resp = self._get_info(build_name)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/artifactory.py", line 2588, in _get_info
    return self._get_build_api_response(url)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/artifactory.py", line 2593, in _get_build_api_response
    resp = self._accessor.get_response(obj).json()
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/artifactory.py", line 1097, in get_response
    timeout=pathobj.timeout,
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/artifactory.py", line 819, in rest_get_stream
    raise_for_status(response)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dohq_artifactory/exception.py", line 41, in raise_for_status
    raise ArtifactoryException(error_info_dict["message"]) from exception
dohq_artifactory.exception.ArtifactoryException: No build was found for build name: maven-demo, build number: 1-build-snapshot 

It can be seen from the above log that build name is maven-demo and build number is 1-build-snapshot ,
but actually build name is maven-demo/1-build-snapshot.
The reason for the error is that build name contains /.
To solve this problem, I think the build name need to be encoded to maven-demo%2F1-build-snapshot.

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

Successfully merging a pull request may close this issue.

2 participants