-
Notifications
You must be signed in to change notification settings - Fork 217
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
Initial ABRT proxy support #133
Conversation
Thanks for your contribution, the formal review will follow shortly. [test] |
@@ -18,7 +18,8 @@ module Proxy | |||
require "proxy/dns" if SETTINGS.dns | |||
require "proxy/dhcp" if SETTINGS.dhcp | |||
require "proxy/bmc" if SETTINGS.bmc | |||
require "proxy/chefproxy" if SETTINGS.chefproxy | |||
#require "proxy/chefproxy" if SETTINGS.chefproxy |
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.
Leftover?
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.
Oops. Should I reopen the PR or wait after you finish the review?
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.
Let us finish the review, then fix it, amend the changes and force-push into the same branch. Github will notice the changes, no need to close/open/reopen the PR.
When amending, please reword your commit message to:
fixes #4332 - initial abrt proxy support
I created feature for this: http://projects.theforeman.org/issues/4332
Initial code reading looks fine, can you paste some info how to configure the ABRT client. I will be happy to test this tomorrow. |
The client configuration is described on https://groups.google.com/forum/#!topic/foreman-dev/Yk2GrW9ne20 (please note that If anything is unclear, you can also contact me via IRC (either internal or as b42 on #abrt@freenode). |
#:foreman_url: http://127.0.0.1:3000 | ||
#:foreman_ssl_ca: ssl/certs/ca.pem | ||
#:foreman_ssl_cert: ssl/certs/fqdn.pem |
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.
Hmmm I am trying to find use of foreman_ssl_*
variables in this patch and I am not succesful. I only see validations for the abrt_server_ssl*
variables bellow. Am I searching correctly, or is this expected. I wonder what is unused settings for then.
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.
The variables are used in lib/proxy/request.rb
(which was renamed from lib/proxy/chefproxy.rb
in the commit). They should probably have been added in the patch that introduced the chef proxy.
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.
I see, thanks.
Sidenote: In the instructions for this feature, we must make sure that abrt-addon-ccpp package is installed. |
Ok this is working fine. The only issue I had was that abrt autoupload feature was not working properly on Fedora 20 minimal install. Workaround:
I will look on the ruby code now. |
ureport_json = request['file'][:tempfile].read | ||
ureport = JSON.parse(ureport_json) | ||
|
||
#forward to FAF |
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.
Can you also enclose the whole FAF sending to a begin/rescue block catching all the Exceptions with a message "Unable to send to FAF"? Use log_halt to generate the error and return 503.
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.
Thanks. [test]
Ok this needs some additional opinions from the team.
This change makes it possible for the proxy to pretend it is ABRT (Automatic Bug Reporting Tool[1]) server. When it receives a problem report, it forwards notification of the error to Foreman, and optionally also forwards the original report to an actual ABRT server. Non strictly ABRT-related changes: - Move module Proxy::ChefProxy to Proxy::Request - Add :foreman_ssl_ options to settings example [1] https://github.com/abrt/abrt/wiki/ABRT-Project
I don't think this should be in the proxy core, especially as it masquerades via configuration management reports. This should be written as a plugin once the proxy has plugin support of its own. |
Well my assumption was to generalize reports to some degree. I am fine Later, Lukas "lzap" Zapletal |
@domcleal Afaik it is planned for foreman to support multiple report types: |
Yes, Foreman should support different report types (http://projects.theforeman.org/issues/4151), but I don't think that would be appropriate still. Reports in Foreman's context are configuration management reports, so it would additionally require different treatment - e.g. we show a host as out of sync when it doesn't send in reports. If an ABRT "report" arrived, that would incorrectly imply that configuration management is working. I think it would require even more changes to how "reports" are handled, or simply to define a new object type.. which can already be done today in a plugin. I don't know when proxy plugin support (http://projects.theforeman.org/issues/3351) will be done, as it's not on our current sprint and not prioritised in the backlog. |
Oops, #4151 was what I meant to link. I'll take a closer look at foreman plugins. From what you say it certainly makes sense to treat them separately from the configuration management reports. |
@domcleal what about having reports more generic, and a subtype of them would be ConfigManagement related: this subtypes would update the sync status, while ABRT type would not cause it. Since the reports are all that similar, I don't see why we would need something completely different for the ABRT type of reports? |
@iNecas indeed. Tthough I don't know what ABRT sends, that'd be sensible. |
The ABRT reports look like this: https://github.com/mmilata/smart-proxy/blob/abrtproxy/test/fixtures/abrt/ureport1.json |
I think report is still a report. We may set host status based on config mgmt reports only but I think we could reuse a lot of existing report functionality.
I think it would be better to make reports more general. If we make STI which separates "config reports" and "crash reports" it will be easy to keep hosts statuses based only on config reports. Also maybe later we could have more host statuses based on reports type. E.g. crash report could make host in some failing state. I can imagine other reports from let's say monitoring tools. EDIT: I should have reloaded the page before submitting, seems like @iNecas already said it. |
I agree with Marek. Having that said, I think this deserves some investigation of the field. I suppose we aim for:
In addition to that, it would be good to consider support for syslog to Later, Lukas "lzap" Zapletal |
Maybe SCAP reports as well? |
Thanks for the feedback! I've opened new pull request for this, since the code changed significantly: #144 |
This change makes it possible for the proxy to pretend it is ABRT
(Automatic Bug Reporting Tool[1]) server. When it receives a problem
report, it forwards notification of the error to Foreman, and optionally
also forwards the original report to an actual ABRT server.
Non strictly ABRT-related changes:
[1] https://github.com/abrt/abrt/wiki/ABRT-Project
For some notes regarding usage, see https://groups.google.com/forum/#!topic/foreman-dev/Yk2GrW9ne20
I am quite new to Ruby so please let me know if anything should be done in a different way:)