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
Fixes #22668 - Always delete report records #327
Conversation
Does this mean that when user will try to delete it from UI and proxy is down, we'll get into inconsistent state? Could we fix this through foreman-maintain later? If this was found as upgrade issue and we stop deleting reports on proxy which is down, I guess the upgrade can leave leftovers on the proxy? |
e07c504
to
1cb3771
Compare
I guess we can keep the logic as it is since this bug affects only reports without policy, which is what the migration is trying to remove. So we delete the reports without policy just from the db (and we could not delete them even if proxy was online - we need the digest which is stored in policy_arf_report association object, which is likely missing as well) I would definitely like to have something that would allow us to clean up directories on proxy, I created a ticket in forman_maintain. |
else | ||
logger.error "Failed to delete report with id #{id} from proxy, no host associated with report" | ||
openscap_proxy_api.destroy_report(self, ForemanOpenscap::Helper::find_name_or_uuid_by_host(host)) |
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.
we're no longer rescuing from errors on proxy? does that mean we'd render ugly error if proxy returns 500 e.g.? previously, the method in case of proxy error returned true (because of logger.debug
), should we perhaps keep the rescue in this else branch?
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.
ah scratch that, I see the rescue is handled in #destroy_report
already and it returns false
turns out other error can occure because of taxnomies, the migration should be wrapped in |
I wrapped the migration in |
Thanks @xprazak2, works as expected and fixes the issue, merging!. I'll cp to 0.7-stable. |
No description provided.