-
Notifications
You must be signed in to change notification settings - Fork 136
Failed tasks no longer store traceback. #7065
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
Draft
aKlimau
wants to merge
27
commits into
pulp:main
Choose a base branch
from
aKlimau:no-traceback-exception
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+144
−31
Draft
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
cfcdd6a
New class for exception without traceback added
29fe731
Exception traceback removed from failed tasks
bce2ec0
NoTraceException class removed. Exceptions now return generic eror me…
c711a2e
Update change text message
aKlimau c1bcc53
Merge branch 'pulp:main' into no-traceback-exception
aKlimau 184d9da
Replace generic errors with specific PulpExceptions
43966ea
PulpExceptions now logged without traceback
0a5587f
Added PulpException for not supproted URL schema
01431de
NonAsyncImmediateTaskError message fixed
a2bb263
Merge branch 'main' of pulpcore into no-traceback-exception
970fcd6
Add exception for proxy authentication error
643adc9
Add exception for repository version delete
0d3fa50
Fix linting, removed unused exceptions
ba22c61
Add pulp-glue exceptions handling
aKlimau cb4fe92
Update tasking tests to expect generic internal error messages
aKlimau f10b3ba
Bump pulp-glue dependency to >=0.30.0 and add pycares constraint
aKlimau 320a4d1
Merge branch 'main' into no-traceback-exception
aKlimau 6858bab
Merge main into no-traceback-exception
aKlimau bbb4420
Proxy authentication exception catch reworked
aKlimau 27d421f
Fix RepositoryVersionDeleteError exception instantiation
aKlimau 8a11824
Fix DnsDomainNameException url leak
aKlimau f204627
Function set_failed no longer accepts traceback as an arg
aKlimau 3259440
Add InternalErrorException as PulpException with PLP0000
aKlimau 6967040
Merge branch 'main' into no-traceback-exception
aKlimau 30a2a2a
Linting fix
aKlimau 3cc8d65
Fixed set_fail call in test
aKlimau 27e4e4f
Bump pulp-glue minimum version to 30.0
aKlimau File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Stopped leaking sensitive information of failures in the task API. |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,6 +44,18 @@ def exception_to_dict(exc, traceback=None): | |
| return {"description": str(exc), "traceback": traceback} | ||
|
|
||
|
|
||
| class InternalErrorException(PulpException): | ||
| """ | ||
| Exception to signal that an unexpected internal error occurred. | ||
| """ | ||
|
|
||
| def __init__(self): | ||
| super().__init__("PLP0000") | ||
|
|
||
| def __str__(self): | ||
| return _("An internal error occurred.") | ||
|
|
||
|
|
||
| class ResourceImmutableError(PulpException): | ||
| """ | ||
| Exceptions that are raised due to trying to update an immutable resource | ||
|
|
@@ -94,3 +106,73 @@ def __init__(self): | |
|
|
||
| def __str__(self): | ||
| return _("You cannot delete a domain that still contains repositories with content.") | ||
|
|
||
|
|
||
| class DnsDomainNameException(PulpException): | ||
| """ | ||
| Exception to signal that dns could not resolve the domain name for specified url. | ||
| """ | ||
|
|
||
| def __init__(self, url): | ||
| """ | ||
| :param url: the url that dns could not resolve | ||
| :type url: str | ||
| """ | ||
| super().__init__("PLP0008") | ||
| self.url = url | ||
|
|
||
| def __str__(self): | ||
| return _("URL lookup failed.") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's more leaked data with the other exceptions. |
||
|
|
||
|
|
||
| class UrlSchemeNotSupportedError(PulpException): | ||
| """ | ||
| Exception raised when a URL scheme (e.g. 'ftp://') is provided that | ||
| Pulp does not have a registered handler for. | ||
| """ | ||
|
|
||
| def __init__(self, url): | ||
| """ | ||
| :param url: The full URL that failed validation. | ||
| :type url: str | ||
| """ | ||
| super().__init__("PLP0009") | ||
| self.url = url | ||
|
|
||
| def __str__(self): | ||
| return _("URL: {u} not supported.").format(u=self.url) | ||
|
|
||
|
|
||
| class ProxyAuthenticationRequiredError(PulpException): | ||
| """ | ||
| Exception to signal that the proxy server requires authentication | ||
| but it was not provided or is invalid (HTTP 407). | ||
| """ | ||
|
|
||
| def __init__(self, proxy_url): | ||
| """ | ||
| :param proxy_url: The URL of the proxy server. | ||
| :type proxy_url: str | ||
| """ | ||
| super().__init__("PLP0010") | ||
| self.proxy_url = proxy_url | ||
|
|
||
| def __str__(self): | ||
| return _( | ||
| "Proxy authentication failed for {proxy_url}. Please check your proxy credentials." | ||
| ).format(proxy_url=self.proxy_url) | ||
|
|
||
|
|
||
| class RepositoryVersionDeleteError(PulpException): | ||
| """ | ||
| Raised when attempting to delete a repository version that cannot be deleted | ||
| """ | ||
|
|
||
| def __init__(self): | ||
| super().__init__("PLP0011") | ||
|
|
||
| def __str__(self): | ||
| return _( | ||
| "Cannot delete repository version. Repositories must have at least one " | ||
| "repository version." | ||
| ) | ||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you have a chance, could you please squash the commits where it makes sense? Also, if you want to sync the branch with
main, rebasing instead of creating merge commits would help to keep the history clean.