-
Notifications
You must be signed in to change notification settings - Fork 36
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
hub: return error 404 for non-existent logs #214
Merged
rohanpm
merged 2 commits into
release-engineering:master
from
lzaoral:404-for-missing-logs
Aug 24, 2023
Merged
hub: return error 404 for non-existent logs #214
rohanpm
merged 2 commits into
release-engineering:master
from
lzaoral:404-for-missing-logs
Aug 24, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Remember to take this out of Draft state if you want it reviewed. |
Yes, I know. I still need to thoroughly test this change myself. |
lzaoral
force-pushed
the
404-for-missing-logs
branch
from
August 11, 2023 13:22
dfb639d
to
e31a12a
Compare
lzaoral
added a commit
to lzaoral/openscanhub
that referenced
this pull request
Aug 11, 2023
Fixes the following Traceback for tasks without any results: ``` $ osh/client/osh-cli download-results 1 Downloading dotnet3.1-3.1.424-1.fc35.tar.xz Traceback (most recent call last): File "/Users/lzaoral/redhat/OpenScanHub/osh/client/osh-cli", line 79, in <module> main() File "/Users/lzaoral/redhat/OpenScanHub/osh/client/osh-cli", line 72, in main parser.run() File "/Users/lzaoral/redhat/OpenScanHub/kobo/kobo/cli.py", line 296, in run cmd.run(*cmd_args, **cmd_kwargs) File "/Users/lzaoral/redhat/OpenScanHub/osh/client/commands/cmd_download_results.py", line 51, in run fetch_results(self.hub, results_dir, task_id) File "/Users/lzaoral/redhat/OpenScanHub/osh/client/commands/shortcuts.py", line 138, in fetch_results urlretrieve(url, local_path) File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 241, in urlretrieve with contextlib.closing(urlopen(url, data)) as fp: ^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 216, in urlopen return opener.open(url, data, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 525, in open response = meth(req, response) ^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 634, in http_response response = self.parent.error( ^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 563, in error return self._call_chain(*args) ^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 496, in _call_chain result = func(*args) ^^^^^^^^^^^ File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 643, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 404: Not Found ``` Related: release-engineering/kobo#214 Related: https://gitlab.cee.redhat.com/covscan/covscan/-/issues/273
@rohanpm The PR is now ready to be reviewed. Thanks in advance! |
rohanpm
requested changes
Aug 23, 2023
... because it is only used by this function and we can't use file_path on its own to reconstruct the name of the requested log.
Otherwise, the response would yield an empty file and 200 status code. Resolves: release-engineering#49
lzaoral
force-pushed
the
404-for-missing-logs
branch
from
August 23, 2023 07:59
e31a12a
to
a715c03
Compare
rohanpm
approved these changes
Aug 24, 2023
lzaoral
added a commit
to lzaoral/openscanhub
that referenced
this pull request
Sep 7, 2023
Fixes the following Traceback for tasks without any results: ``` $ osh/client/osh-cli download-results 1 Downloading dotnet3.1-3.1.424-1.fc35.tar.xz Traceback (most recent call last): File "/Users/lzaoral/redhat/OpenScanHub/osh/client/osh-cli", line 79, in <module> main() File "/Users/lzaoral/redhat/OpenScanHub/osh/client/osh-cli", line 72, in main parser.run() File "/Users/lzaoral/redhat/OpenScanHub/kobo/kobo/cli.py", line 296, in run cmd.run(*cmd_args, **cmd_kwargs) File "/Users/lzaoral/redhat/OpenScanHub/osh/client/commands/cmd_download_results.py", line 51, in run fetch_results(self.hub, results_dir, task_id) File "/Users/lzaoral/redhat/OpenScanHub/osh/client/commands/shortcuts.py", line 138, in fetch_results urlretrieve(url, local_path) File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 241, in urlretrieve with contextlib.closing(urlopen(url, data)) as fp: ^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 216, in urlopen return opener.open(url, data, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 525, in open response = meth(req, response) ^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 634, in http_response response = self.parent.error( ^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 563, in error return self._call_chain(*args) ^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 496, in _call_chain result = func(*args) ^^^^^^^^^^^ File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 643, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 404: Not Found ``` Related: release-engineering/kobo#214 Related: https://gitlab.cee.redhat.com/covscan/covscan/-/issues/273
lzaoral
added a commit
to lzaoral/openscanhub
that referenced
this pull request
Sep 7, 2023
Fixes the following Traceback for tasks without any results: ``` $ osh/client/osh-cli download-results 1 Downloading dotnet3.1-3.1.424-1.fc35.tar.xz Traceback (most recent call last): File "/Users/lzaoral/redhat/OpenScanHub/osh/client/osh-cli", line 79, in <module> main() File "/Users/lzaoral/redhat/OpenScanHub/osh/client/osh-cli", line 72, in main parser.run() File "/Users/lzaoral/redhat/OpenScanHub/kobo/kobo/cli.py", line 296, in run cmd.run(*cmd_args, **cmd_kwargs) File "/Users/lzaoral/redhat/OpenScanHub/osh/client/commands/cmd_download_results.py", line 51, in run fetch_results(self.hub, results_dir, task_id) File "/Users/lzaoral/redhat/OpenScanHub/osh/client/commands/shortcuts.py", line 138, in fetch_results urlretrieve(url, local_path) File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 241, in urlretrieve with contextlib.closing(urlopen(url, data)) as fp: ^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 216, in urlopen return opener.open(url, data, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 525, in open response = meth(req, response) ^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 634, in http_response response = self.parent.error( ^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 563, in error return self._call_chain(*args) ^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 496, in _call_chain result = func(*args) ^^^^^^^^^^^ File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 643, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 404: Not Found ``` Related: release-engineering/kobo#214 Related: https://gitlab.cee.redhat.com/covscan/covscan/-/issues/273
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Otherwise, the response would yield an empty file and 200 status code.
Resolves: #49