Open PerilousApricot opened 8 years ago
@lzap @mmilata could you have a look? :point_up:
Sorry, I haven't worked on Foreman or ABRT for a long time so I won't be much help:( I'm not aware of any different place for the plugin settings.
@jfilak, any idea what's going on here?
Well, we haven't touched the code base for a long time, so I suspect something has changed in loading of plugin configuration files.
Taking into account the fact that syslog contains a message with the configured values I believe the line below:
if !AbrtProxy::Plugin.settings.enabled
was evaluated before AbrtProxy::Plugin.settings
was properly initialized.
@PerilousApricot Can you please confirm or reject my assumption?
Yeah I was looking into this already, didn't have time to resolve this. Something changed in plugin initialization, @witlessbird any idea?
https://github.com/theforeman/smart_proxy_abrt/blob/master/bin/smart-proxy-abrt-send#L27: this doesn't work anymore. Settings loading is a part of plugin initialization process and is initialized closer to the end of it, after plugin and its providers successfully finished loading (see https://github.com/theforeman/smart-proxy/blob/develop/lib/proxy/plugin_initializer.rb#L248).
If you need to access module settings from outside of smart-proxy process you will need to load and parse settings file yourself. Alternatively, you can now run an async scheduled task inside proxy process.
Is there any documentation for the async stuff? Examples? I am not aware we have that.
We are using Promises/Futures from concurrent-ruby. See https://github.com/theforeman/smart-proxy/blob/develop/modules/puppet_proxy_puppet_api/v3_environment_classes_api_classes_retriever.rb#L74 and https://github.com/theforeman/smart-proxy/pull/472/files#diff-a7b380254558ab8c9965ee50c789bf46R121 for examples (library docs are good too). Classes that implement start/stop interface can be treated as "services" and automatically started on proxy startup (for example: https://github.com/theforeman/smart-proxy/pull/472/files#diff-a7b380254558ab8c9965ee50c789bf46R174).
My smart-proxy-abrt-send 0.0.8 on Centos7 with foreman 1.12 always returns that the plugin is disabled, even though the proxy says it should be enabled:
Investigating further, I added the following lines right before the error to dump the settings:
at https://github.com/theforeman/smart_proxy_abrt/blob/master/bin/smart-proxy-abrt-send#L27
But it returns what appears to be an empty setting object with "{}". I have the following as my settings:
And cranking the logging on the smart proxy gives the following line, so I think it's loaded properly:
My ruby is ~nonexistent, but I suspect it's trying to load the settings from somewhere else. Is there a different place this should be installed?
Thanks!