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

Fix importer crash #1541 #1542

Merged
merged 4 commits into from
Aug 16, 2024
Merged

Fix importer crash #1541 #1542

merged 4 commits into from
Aug 16, 2024

Conversation

pombredanne
Copy link
Member

@pombredanne pombredanne commented Aug 9, 2024

This PR is correction for the crash in #1541
The issue was introduced by this commit 0fe73ef#diff-11856d929972b1aa71dcd476298a831d6b598b291c0638057af6d62050ba4a15R192

We now check for empty published_at before using it. Otherwise the VulnerabilitySeverity.published_at data will be an invalid "None" string resulting from str(None).

Also improve logging.

Reference: #1541
Signed-off-by: Philippe Ombredanne <[email protected]>
Use the latest date file from nginx

Reference: #1541
Signed-off-by: Philippe Ombredanne <[email protected]>
Otherwise the VulnerabilitySeverity.published_at data will be an invalid
"None" string.

Reference: #1541
Signed-off-by: Philippe Ombredanne <[email protected]>
@pombredanne
Copy link
Member Author

@ziadhany @TG1999 FYI, review welcome

Copy link
Collaborator

@ziadhany ziadhany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, and I apologize for introducing this bug.

except Exception as e:
logger.info(f"Failed to process advisory: {advisory!r} with error {e!r}")
except Exception:
from pprint import pformat
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pombredanne Would it be better to move the pprint library import to the top of the code?

Copy link
Contributor

@TG1999 TG1999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@TG1999 TG1999 merged commit b7a7237 into main Aug 16, 2024
8 checks passed
@pombredanne pombredanne deleted the 1541-fix-importer-crash branch September 24, 2024 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants