{"action":"created","issue":{"url":"https://api.github.com/repos/theforeman/puppet-foreman/issues/534","repository_url":"https://api.github.com/repos/theforeman/puppet-foreman","labels_url":"https://api.github.com/repos/theforeman/puppet-foreman/issues/534/labels{/name}","comments_url":"https://api.github.com/repos/theforeman/puppet-foreman/issues/534/comments","events_url":"https://api.github.com/repos/theforeman/puppet-foreman/issues/534/events","html_url":"https://github.com/theforeman/puppet-foreman/issues/534","id":213781447,"number":534,"title":"Puppet reporting: allow to retry sending report to Foreman","user":{"login":"mateusz-gozdek-sociomantic","id":16538006,"avatar_url":"https://avatars3.githubusercontent.com/u/16538006?v=3","gravatar_id":"","url":"https://api.github.com/users/mateusz-gozdek-sociomantic","html_url":"https://github.com/mateusz-gozdek-sociomantic","followers_url":"https://api.github.com/users/mateusz-gozdek-sociomantic/followers","following_url":"https://api.github.com/users/mateusz-gozdek-sociomantic/following{/other_user}","gists_url":"https://api.github.com/users/mateusz-gozdek-sociomantic/gists{/gist_id}","starred_url":"https://api.github.com/users/mateusz-gozdek-sociomantic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mateusz-gozdek-sociomantic/subscriptions","organizations_url":"https://api.github.com/users/mateusz-gozdek-sociomantic/orgs","repos_url":"https://api.github.com/users/mateusz-gozdek-sociomantic/repos","events_url":"https://api.github.com/users/mateusz-gozdek-sociomantic/events{/privacy}","received_events_url":"https://api.github.com/users/mateusz-gozdek-sociomantic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-03-13T14:22:03Z","updated_at":"2017-03-14T17:03:55Z","closed_at":null,"body":"After upgrading puppet master to `xenial` and applying a [workaround](https://tickets.puppetlabs.com/browse/SERVER-17?focusedCommentId=357002&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-357002) reporting to Foreman is working again. However, this creates another issue.\r\n\r\nNow `puppetserver` is sometimes not able to send report to Foreman because of some Java SSL problem. Here is the stacktrace:\r\n```\r\n2017-03-13 00:12:28,941 ERROR [qtp472597471-107990] [puppetserver] Puppet Report processor failed: Could not send report to Foreman at https://localhost:8443/api/reports: Recei\r\nved fatal alert: bad_record_mac\r\n[\"org/jruby/ext/openssl/SSLSocket.java:215:in `connect'\", \"/opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/lib/ruby/1.9/net/http.rb:800:in `connect'\r\n\", \"org/jruby/ext/timeout/Timeout.java:98:in `timeout'\", \"/opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/lib/ruby/1.9/net/http.rb:800:in `connect'\"\r\n, \"/opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/lib/ruby/1.9/net/http.rb:756:in `do_start'\", \"/opt/puppetlabs/server/apps/puppetserver/puppet-ser\r\nver-release.jar!/META-INF/jruby.home/lib/ruby/1.9/net/http.rb:745:in `start'\", \"/opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/lib/ruby/1.9/net/htt\r\np.rb:1293:in `request'\", \"/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/reports/foreman.rb:67:in `process'\", \"/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/report/proc\r\nessor.rb:37:in `process'\", \"/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/report/processor.rb:53:in `processors'\", \"org/jruby/RubyArray.java:1613:in `each'\", \"/opt/puppetla\r\nbs/puppet/lib/ruby/vendor_ruby/puppet/indirector/report/processor.rb:51:in `processors'\", \"/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/report/processor.rb:30:in `process'\r\n\", \"/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/report/processor.rb:14:in `save'\", \"/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:285:in `s\r\nave'\", \"/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:176:in `do_save'\", \"/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/ind\r\nirected_routes.rb:48:in `call'\", \"/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'\", \"/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:293:in `override'\"\r\n, \"/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:47:in `call'\", \"/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:82:in `\r\nprocess'\", \"org/jruby/RubyArray.java:1613:in `each'\", \"/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:81:in `process'\", \"/opt/puppetlabs/puppet/lib/ruby/vendor_ru\r\nby/puppet/network/http/route.rb:87:in `process'\", \"/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:87:in `process'\", \"/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/p\r\nuppet/network/http/handler.rb:60:in `process'\", \"/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler/around_profiler.rb:58:in `profile'\", \"/opt/puppetlabs/puppet/lib/ruby/vend\r\nor_ruby/puppet/util/profiler.rb:51:in `profile'\", \"/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:58:in `process'\", \"file:/opt/puppetlabs/server/apps/puppetserv\r\ner/puppet-server-release.jar!/puppetserver-lib/puppet/server/master.rb:42:in `handleRequest'\", \"Puppet$$Server$$Master_294703649.gen:13:in `handleRequest'\", \"request_handler_core.clj:273:i\r\nn `invoke'\", \"jruby_request.clj:46:in `invoke'\", \"jruby_request.clj:31:in `invoke'\", \"request_handler_service.clj:34:in `handle_request'\", \"request_handler.clj:3:in `invoke'\", \"request_han\r\ndler.clj:3:in `invoke'\", \"core.clj:2515:in `invoke'\", \"ring_middleware.clj:284:in `invoke'\", \"core.clj:168:in `invoke'\", \"core.clj:211:in `invoke'\", \"core.clj:45:in `invoke'\", \"core.clj:34\r\n3:in `invoke'\", \"core.clj:51:in `invoke'\", \"ringutils.clj:83:in `invoke'\", \"master_core.clj:430:in `invoke'\", \"ring.clj:21:in `invoke'\", \"ring.clj:12:in `invoke'\", \"comidi.clj:249:in `invo\r\nke'\", \"jetty9_core.clj:424:in `invoke'\", \"normalized_uri_helpers.clj:80:in `invoke'\"]\r\n/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/reports/foreman.rb:69:in `process'\r\n/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/report/processor.rb:37:in `process'\r\n/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/report/processor.rb:53:in `processors'\r\norg/jruby/RubyArray.java:1613:in `each'\r\n/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/report/processor.rb:51:in `processors'\r\n/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/report/processor.rb:30:in `process'\r\n/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/report/processor.rb:14:in `save'\r\n/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:285:in `save'\r\n/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:176:in `do_save'\r\n/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:48:in `call'\r\n/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'\r\n/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:293:in `override'\r\n/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:47:in `call'\r\n/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:82:in `process'\r\norg/jruby/RubyArray.java:1613:in `each'\r\n/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:81:in `process'\r\n/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:87:in `process'\r\n/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:87:in `process'\r\n/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:60:in `process'\r\n/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler/around_profiler.rb:58:in `profile'\r\n/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler.rb:51:in `profile'\r\n/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:58:in `process'\r\nfile:/opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/puppetserver-lib/puppet/server/master.rb:42:in `handleRequest'\r\nPuppet$$Server$$Master_294703649.gen:13:in `handleRequest'\r\nrequest_handler_core.clj:273:in `invoke'\r\njruby_request.clj:46:in `invoke'\r\njruby_request.clj:31:in `invoke'\r\nrequest_handler_service.clj:34:in `handle_request'\r\nrequest_handler.clj:3:in `invoke'\r\nrequest_handler.clj:3:in `invoke'\r\ncore.clj:2515:in `invoke'\r\nring_middleware.clj:284:in `invoke'\r\ncore.clj:168:in `invoke'\r\ncore.clj:211:in `invoke'\r\ncore.clj:45:in `invoke'\r\ncore.clj:343:in `invoke'\r\ncore.clj:51:in `invoke'\r\nringutils.clj:83:in `invoke'\r\nmaster_core.clj:430:in `invoke'\r\nring.clj:21:in `invoke'\r\nring.clj:12:in `invoke'\r\ncomidi.clj:249:in `invoke'\r\njetty9_core.clj:424:in `invoke'\r\nnormalized_uri_helpers.clj:80:in `invoke'\r\n```\r\n\r\nTo avoid losing some reports and to make reporting to Foreman more error-proof with the low cost, I think it's a good idea to add a `retry` to begin rescue block in process function in [foreman-report_v2.rb](https://github.com/theforeman/puppet-foreman/blob/master/files/foreman-report_v2.rb).\r\n\r\nTo avoid changing default behaviour of reporting plugin, retry limit can be stored in puppet settings with default value 1.\r\n\r\nI'm going to raise a PR soon. It's working, but there is definitely a space for improvements."},"comment":{"url":"https://api.github.com/repos/theforeman/puppet-foreman/issues/comments/286489939","html_url":"https://github.com/theforeman/puppet-foreman/issues/534#issuecomment-286489939","issue_url":"https://api.github.com/repos/theforeman/puppet-foreman/issues/534","id":286489939,"user":{"login":"mmoll","id":1434927,"avatar_url":"https://avatars1.githubusercontent.com/u/1434927?v=3","gravatar_id":"","url":"https://api.github.com/users/mmoll","html_url":"https://github.com/mmoll","followers_url":"https://api.github.com/users/mmoll/followers","following_url":"https://api.github.com/users/mmoll/following{/other_user}","gists_url":"https://api.github.com/users/mmoll/gists{/gist_id}","starred_url":"https://api.github.com/users/mmoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmoll/subscriptions","organizations_url":"https://api.github.com/users/mmoll/orgs","repos_url":"https://api.github.com/users/mmoll/repos","events_url":"https://api.github.com/users/mmoll/events{/privacy}","received_events_url":"https://api.github.com/users/mmoll/received_events","type":"User","site_admin":false},"created_at":"2017-03-14T17:03:55Z","updated_at":"2017-03-14T17:03:55Z","body":"I see... I think the \"correct\" fix in these situation is either to add the DH params **only** to the file used by the Foreman vhost (that's what's I'm doing in my setups) or to use the boncycastle security provider."}}
{"actor":{"display_login":"mmoll"}}