honeybadger 2.6.0 → 2.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2222a4433ac78457a32df416c829a8e0723a7a4e
4
- data.tar.gz: 2b86c78e7f197cb536bc113b0f529fbe1c8922f4
3
+ metadata.gz: d602a9205496510494a04ef272fd244394280071
4
+ data.tar.gz: a2a9ef904df4c7aae69a2a5ecd7aedcf520ebd81
5
5
  SHA512:
6
- metadata.gz: 5df00423284aa557dcf82df4d6e951e63fe0c4cd1c1cd019332c03f5b60cccaab0169e39692e40369ba4e5a5d01c145f4abd740ecce2f6b609c83a55c94cee90
7
- data.tar.gz: 052aab1703d0ab8895754725423791079bf675ca274442b8b5ba475bc8b28b5a7febe13906c1eed7bd946a427b8646dd36675e36b5a0f2d6335918e6eabf5921
6
+ metadata.gz: 4f437187a727ce3cc61542e0df3a64dbd7e0af43fcee10e8346a9476f0a78f1a50225a0a3e3861090f5de16e33362c2f7bcc4e3c5ee13da0bab780abab5cffb9
7
+ data.tar.gz: 84a063b994896e85b8a10024b60cb79674e6d904ffcdb3412445afdf4d549d85a6885ad294f6cc3c8f36f93f6ba927b6ab9e3ff76222d422dfe9c0c62d067771
data/CHANGELOG.md CHANGED
@@ -5,6 +5,17 @@ adheres to [Semantic Versioning](http://semver.org/).
5
5
 
6
6
  ## [Unreleased][unreleased]
7
7
 
8
+ ## [2.6.1] - 2016-08-24
9
+ ### Added
10
+ - shoryuken plugin. -@ivanvc
11
+
12
+ ### Fixed
13
+ - Handle `Errno::ENETUNREACH` error when contacting server. -@tank-bohr
14
+ - Remove `ActionDispatch::Http::Headers` from trace payload (fixes `IOError`
15
+ when JSON encoding traces in Rails 5).
16
+ - Fix "`invoke("git:set_current_revision")` already invoked" warning in
17
+ Capistrano 3.6.
18
+
8
19
  ## [2.6.0] - 2016-04-22
9
20
  ### Added
10
21
  - Automatically report unhandled exceptions at exit.
data/README.md CHANGED
@@ -1,7 +1,5 @@
1
1
  # Honeybadger for Ruby
2
2
 
3
- [![Code Climate](https://codeclimate.com/github/honeybadger-io/honeybadger-ruby/badges/gpa.svg)](https://codeclimate.com/github/honeybadger-io/honeybadger-ruby)
4
- [![Test Coverage](https://codeclimate.com/github/honeybadger-io/honeybadger-ruby/badges/coverage.svg)](https://codeclimate.com/github/honeybadger-io/honeybadger-ruby)
5
3
  [![Build Status](https://secure.travis-ci.org/honeybadger-io/honeybadger-ruby.png?branch=master)](http://travis-ci.org/honeybadger-io/honeybadger-ruby)
6
4
  [![Gem Version](https://badge.fury.io/rb/honeybadger.png)](http://badge.fury.io/rb/honeybadger)
7
5
 
@@ -21,7 +19,7 @@ When an uncaught exception occurs, Honeybadger will POST the relevant data to th
21
19
 
22
20
  | Framework | Version | Native? |
23
21
  | ------------- | ------------- |------------|
24
- | Rails | >= 3.0 | yes |
22
+ | Rails | >= 3.2 | yes |
25
23
  | Sinatra | >= 1.2.1 | yes |
26
24
  | Rack | >= 1.0 | middleware |
27
25
 
@@ -262,7 +260,7 @@ You can use any of the options below in your config file, or in the environment.
262
260
  |`feedback.enabled` | Boolean | Enable the UserFeedback middleware. Feedback displays a comment form to your-end user when they encounter an error. When the user creates a comment, it is added to the error in Honeybadger, and a notification is sent.  [Learn More](http://docs.honeybadger.io/article/166-how-to-implement-a-custom-feedback-form)<br/>_Default: `true`_|
263
261
  |&nbsp; | ||
264
262
  |__EXCEPTION REPORTING__ | ||
265
- |`exceptions.ignore` | Array | A list of exception class names to ignore (appends to defaults).<br/>_Default: `['ActiveRecord::RecordNotFound', 'ActionController::RoutingError', 'ActionController::InvalidAuthenticityToken', 'CGI::Session::CookieStore::TamperedWithCookie', 'ActionController::UnknownAction', 'AbstractController::ActionNotFound', 'Mongoid::Errors::DocumentNotFound Sinatra::NotFound']`_|
263
+ |`exceptions.ignore` | Array | A list of exception class names to ignore (appends to defaults).<br/>_Default: `['ActionController::RoutingError', 'AbstractController::ActionNotFound', 'ActionController::MethodNotAllowed', 'ActionController::UnknownHttpMethod', 'ActionController::NotImplemented', 'ActionController::UnknownFormat', 'ActionController::InvalidAuthenticityToken', 'ActionController::InvalidCrossOriginRequest', 'ActionDispatch::ParamsParser::ParseError', 'ActionController::BadRequest', 'ActionController::ParameterMissing', 'ActiveRecord::RecordNotFound', 'ActionController::UnknownAction', 'CGI::Session::CookieStore::TamperedWithCookie', 'Mongoid::Errors::DocumentNotFound', 'Sinatra::NotFound']`_|
266
264
  |`exceptions.ignore_only` | Array | A list of exception class names to ignore (overrides defaults).<br/>_Default: `[]`_|
267
265
  |`exceptions.` `ignored_user_agents` | Array | A list of user agents to ignore.<br/>_Default: `[]`_|
268
266
  |`exceptions.rescue_rake` | Boolean | Enable rescuing exceptions in rake tasks.<br/>_Default: `true` when run in background; `false` when run in terminal._|
@@ -295,13 +293,14 @@ You can use any of the options below in your config file, or in the environment.
295
293
 
296
294
  Sometimes, default exception data just isn't enough. If you have extra data that will help you in debugging, send it as part of an error's context. [View full method documentation](http://www.rubydoc.info/gems/honeybadger/Honeybadger%3Acontext)
297
295
 
296
+ Global context is stored in a thread local variable and automatically reported with any exception which occurrs within the current thread's execution.
297
+
298
298
  #### Use this method if:
299
299
 
300
300
  * You want to record the current user's id at the time of an exception
301
301
  * You need to send raw POST data for use in debugging
302
302
  * You have any other metadata you'd like to send with an exception
303
303
 
304
-
305
304
  #### Examples:
306
305
 
307
306
  ```ruby
@@ -315,6 +314,7 @@ end
315
314
  # Clearing global context:
316
315
  Honeybadger.context.clear!
317
316
  ```
317
+
318
318
  ---
319
319
 
320
320
 
@@ -501,9 +501,10 @@ If you're adding a new feature, please [submit an issue](https://github.com/hone
501
501
 
502
502
  1. Fork it.
503
503
  2. Create a topic branch `git checkout -b my_branch`
504
- 3. Commit your changes `git commit -am "Boom"`
505
- 3. Push to your branch `git push origin my_branch`
506
- 4. Send a [pull request](https://github.com/honeybadger-io/honeybadger-ruby/pulls)
504
+ 3. Make your changes and add an entry to the [CHANGELOG](CHANGELOG.md).
505
+ 4. Commit your changes `git commit -am "Boom"`
506
+ 5. Push to your branch `git push origin my_branch`
507
+ 6. Send a [pull request](https://github.com/honeybadger-io/honeybadger-ruby/pulls)
507
508
 
508
509
  ### Running the tests
509
510
 
@@ -511,8 +512,9 @@ We're using the [Appraisal](https://github.com/thoughtbot/appraisal) gem to run
511
512
  our [RSpec](https://www.relishapp.com/rspec/) test suite against multiple
512
513
  versions of [Rails](http://rubyonrails.org/).
513
514
 
514
- * The unit test suite can be run with `rake` (aliased to `rake spec:unit`).
515
+ * The unit test suite can be run with `rake spec:units`.
515
516
  * The integration test suite can be run with `rake spec:features`.
517
+ * The combined suite can be run with `rake`.
516
518
 
517
519
  ### License
518
520
 
@@ -0,0 +1,131 @@
1
+ # Troubleshooting
2
+
3
+ Common issues/workarounds are documented here. If you don't find a solution to
4
+ your problem here or in our [support
5
+ documentation](http://docs.honeybadger.io/), email support@honeybadger.io and
6
+ one or all of our helpful founders will assist you!
7
+
8
+ ## Upgrade the gem
9
+
10
+ Before digging deeper into this guide, **make sure you are on the latest minor
11
+ release of the honeybadger gem** (i.e. 2.x.x). There's a chance you've found a bug
12
+ which has already been fixed!
13
+
14
+ ## How to enable verbose logging
15
+
16
+ Troubleshooting any of these issues will be much easier if you can see what's
17
+ going on with Honeybadger when your app starts. To enable verbose debug logging,
18
+ run your app with the `HONEYBADGER_DEBUG=true` environment variable or add the
19
+ following to your *honeybadger.yml* file:
20
+
21
+ ```yml
22
+ debug: true
23
+ ```
24
+
25
+ By default Honeybadger will log to the default Rails logger or STDOUT outside of
26
+ Rails. When debugging it can be helpful to have a dedicated log file for
27
+ Honeybadger. To enable one, set the
28
+ `HONEYBADGER_LOGGING_PATH=log/honeybadger.log` environment variable or add the
29
+ following to your *honeybadger.yml* file:
30
+
31
+ ```yml
32
+ logging:
33
+ path: 'log/honeybadger.log'
34
+ ```
35
+
36
+ ## Common Issues
37
+
38
+ ### My errors aren't being reported
39
+
40
+ Error reporting may be disabled for several reasons:
41
+
42
+ #### Honeybadger is not configured
43
+
44
+ Honeybadger requires at minimum the `api_key` option to be set. If Honeybadger
45
+ is unable to start due to invalid configuration, you should see something like
46
+ the following in your logs:
47
+
48
+ ```
49
+ ** [Honeybadger] Unable to start Honeybadger -- api_key is missing or invalid. level=2 pid=18195
50
+ ```
51
+
52
+ #### Honeybadger is in a development environment
53
+
54
+ Errors are ignored by default in the "test", "development", and "cucumber"
55
+ environments. To explicitly enable Honeybadger in a development environment, set
56
+ the `HONEYBADGER_REPORT_DATA=true` environment variable or add the following
57
+ configuration to *honeybadger.yml* file (change "development" to the name of the
58
+ environment you want to enable):
59
+
60
+ ```yml
61
+ development:
62
+ report_data: true
63
+ ```
64
+
65
+ #### Is the error ignored by default?
66
+
67
+ Honeybadger ignores [this list of
68
+ exceptions](https://github.com/honeybadger-io/honeybadger-ruby/blob/master/lib/honeybadger/config/defaults.rb#L7)
69
+ by default.
70
+
71
+ #### Is the error rescued without re-raising?
72
+
73
+ Honeybadger will automatically report exceptions in many frameworks including
74
+ Rails, Sinatra, Sidekiq, Rake, etc. For exceptions to reported automatically
75
+ they must be raised; check for any `rescue` statements in your app where
76
+ exceptions may be potentially silenced. In Rails, this includes any use of
77
+ `rescue_from` which does not re-raise the exception.
78
+
79
+ Errors which are handled in a `rescue` block without re-raising must be reported
80
+ to Honeybadger manually:
81
+
82
+ ```ruby
83
+ begin
84
+ fail 'This error will be handled internally.'
85
+ rescue => e
86
+ Honeybadger.notify(e)
87
+ end
88
+ ```
89
+
90
+ #### Honeybadger is not started
91
+
92
+ We currently initialize Rails and Sinatra apps automatically. If you use either
93
+ of those frameworks and are not receiving error reports, then you probably have
94
+ a different issue and should skip this section. For all other frameworks (or
95
+ plain ol' Ruby), `Honeybadger.start()` must be called manually.
96
+
97
+ To verify that Honeybadger is not started, [enable debug
98
+ logging](#how-to-enable-verbose-logging) and then start your app; if Honeybadger
99
+ was initialized, you should see something in the log output.
100
+
101
+ ```
102
+ ** [Honeybadger] Starting Honeybadger version 2.1.0 level=1 pid=18077
103
+ ```
104
+
105
+ If you don't get any logs prefixed with "** [Honeybadger]", then you can start
106
+ Honeybadger manually like this:
107
+
108
+ ```ruby
109
+ honeybadger_config = Honeybadger::Config.new
110
+ Honeybadger.start(honeybadger_config)
111
+ ```
112
+
113
+ ## Sidekiq/Resque/ActiveJob/etc.
114
+
115
+ - See [Common Issues](#common-issues)
116
+
117
+ ### If the error is ignored by default
118
+
119
+ Honeybadger ignores [this list of
120
+ exceptions](https://github.com/honeybadger-io/honeybadger-ruby/blob/master/lib/honeybadger/config/defaults.rb#L7)
121
+ by default. It may be surprising that `ActiveRecord::RecordNotFound` is on that
122
+ list; that's because in a Rails controller that error class is treated as a 404
123
+ not-found and handled internally (and thus we shouldn't report it). Support for
124
+ Sidekiq and friends was added later and inherited the default. We would like to
125
+ provide alternate defaults for job processors in the future, but for now you can
126
+ provide your own list of ignored class names if you want to change this
127
+ behavior:
128
+
129
+ ```
130
+ HONEYBADGER_EXCEPTIONS_IGNORE_ONLY=Error,ClassNames,Here bundle exec sidekiq
131
+ ```
@@ -34,7 +34,7 @@ module Honeybadger
34
34
 
35
35
  private
36
36
 
37
- def self.load_plugins(config)
37
+ def self.load_plugins!(config)
38
38
  Dir[File.expand_path('../plugins/*.rb', __FILE__)].each do |plugin|
39
39
  require plugin
40
40
  end
@@ -71,7 +71,7 @@ module Honeybadger
71
71
  end
72
72
 
73
73
  config.logger.info("Starting Honeybadger version #{VERSION}")
74
- load_plugins(config)
74
+ load_plugins!(config)
75
75
  @instance = new(config)
76
76
 
77
77
  true
@@ -20,11 +20,12 @@ module Honeybadger
20
20
  HTTP_ERRORS = [Timeout::Error,
21
21
  Errno::EINVAL,
22
22
  Errno::ECONNRESET,
23
+ Errno::ECONNREFUSED,
24
+ Errno::ENETUNREACH,
23
25
  EOFError,
24
26
  Net::HTTPBadResponse,
25
27
  Net::HTTPHeaderSyntaxError,
26
28
  Net::ProtocolError,
27
- Errno::ECONNREFUSED,
28
29
  OpenSSL::SSL::SSLError,
29
30
  SocketError].freeze
30
31
 
@@ -162,6 +162,8 @@ module Honeybadger
162
162
  def ca_bundle_path
163
163
  if self[:'connection.system_ssl_cert_chain'] && File.exist?(OpenSSL::X509::DEFAULT_CERT_FILE)
164
164
  OpenSSL::X509::DEFAULT_CERT_FILE
165
+ elsif self[:'connection.ssl_ca_bundle_path']
166
+ self[:'connection.ssl_ca_bundle_path']
165
167
  else
166
168
  local_cert_path
167
169
  end
@@ -136,6 +136,11 @@ module Honeybadger
136
136
  default: false,
137
137
  type: Boolean
138
138
  },
139
+ :'connection.ssl_ca_bundle_path' => {
140
+ description: 'Use this ca bundle when establishing secure connections.',
141
+ default: nil,
142
+ type: String
143
+ },
139
144
  :'connection.http_open_timeout' => {
140
145
  description: 'The HTTP open timeout when connecting to the server.',
141
146
  default: 2,
@@ -461,6 +461,9 @@ module Honeybadger
461
461
  # doesn't exist in that object, it calls #session *again* on `nil`, which
462
462
  # also inherited it from Object, resulting in a SystemStackError.
463
463
  #
464
+ # See https://stackoverflow.com/questions/18202261/include-actiondispatchtestprocess-prevents-guard-from-reloading-properly
465
+ # for more info.
466
+ #
464
467
  # This method restores the correct #session method on @request and warns
465
468
  # the user of the issue.
466
469
  #
@@ -0,0 +1,46 @@
1
+ require 'honeybadger/plugin'
2
+ require 'honeybadger'
3
+
4
+ module Honeybadger
5
+ module Plugins
6
+ module Shoryuken
7
+ class Middleware
8
+ def call(worker, queue, sqs_msg, body)
9
+ if sqs_msg.is_a?(Array)
10
+ yield
11
+ return
12
+ end
13
+
14
+ klass = worker.class.name
15
+ Honeybadger.flush do
16
+ Honeybadger::Trace.instrument("#{klass}#perform", { :source => 'shoryuken'.freeze, :queue => sqs_msg.queue_name.freeze, :message_id => sqs_msg.data.message_id.freeze, :class => klass }) do
17
+ begin
18
+ yield
19
+ rescue => e
20
+ receive_count = sqs_msg.attributes['ApproximateReceiveCount'.freeze]
21
+ if receive_count && ::Honeybadger::Agent.config[:'shoryuken.attempt_threshold'].to_i <= receive_count.to_i
22
+ Honeybadger.notify(e, parameters: body)
23
+ end
24
+ raise e
25
+ end
26
+ end
27
+ end
28
+ ensure
29
+ Honeybadger.context.clear!
30
+ end
31
+ end
32
+
33
+ Plugin.register do
34
+ requirement { defined?(::Shoryuken) }
35
+
36
+ execution do
37
+ ::Shoryuken.configure_server do |config|
38
+ config.server_middleware do |chain|
39
+ chain.add Middleware
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -205,7 +205,7 @@ module Honeybadger
205
205
 
206
206
  class ActionController < Base
207
207
  def payload
208
- event.payload.reject {|k, v| k == :params }
208
+ event.payload.reject {|k, v| k == :params || k == :headers }
209
209
  end
210
210
 
211
211
  def to_s
@@ -1,4 +1,4 @@
1
1
  module Honeybadger
2
2
  # Public: The current String Honeybadger version.
3
- VERSION = '2.6.0'.freeze
3
+ VERSION = '2.6.1'.freeze
4
4
  end
@@ -4,10 +4,9 @@ namespace :honeybadger do
4
4
  end
5
5
 
6
6
  desc 'Notify Honeybadger of the deployment.'
7
- task :deploy => :env do
7
+ task :deploy => [:env, :'deploy:set_current_revision'] do
8
8
  next if sshkit_outdated?
9
9
  if server = fetch(:honeybadger_server)
10
- invoke "#{scm}:set_current_revision"
11
10
  revision = fetch(:current_revision)
12
11
 
13
12
  on server do |host|
@@ -70,6 +69,13 @@ namespace :honeybadger do
70
69
  end
71
70
  end
72
71
 
72
+ namespace :deploy do
73
+ task :set_current_revision do
74
+ # noop -- we just want to make sure this task exists prior to Capistrano
75
+ # 3.2, since we depend on it.
76
+ end
77
+ end
78
+
73
79
  namespace :load do
74
80
  task :defaults do
75
81
  set :bundle_bins, fetch(:bundle_bins, []).push('honeybadger')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: honeybadger
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Honeybadger Industries LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-22 00:00:00.000000000 Z
11
+ date: 2016-08-24 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Make managing application errors a more pleasant experience.
14
14
  email:
@@ -21,6 +21,7 @@ files:
21
21
  - CHANGELOG.md
22
22
  - LICENSE
23
23
  - README.md
24
+ - TROUBLESHOOTING.md
24
25
  - bin/honeybadger
25
26
  - lib/honeybadger.rb
26
27
  - lib/honeybadger/agent.rb
@@ -61,6 +62,7 @@ files:
61
62
  - lib/honeybadger/plugins/passenger.rb
62
63
  - lib/honeybadger/plugins/rails.rb
63
64
  - lib/honeybadger/plugins/resque.rb
65
+ - lib/honeybadger/plugins/shoryuken.rb
64
66
  - lib/honeybadger/plugins/sidekiq.rb
65
67
  - lib/honeybadger/plugins/sucker_punch.rb
66
68
  - lib/honeybadger/plugins/thor.rb
@@ -140,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
142
  version: '0'
141
143
  requirements: []
142
144
  rubyforge_project:
143
- rubygems_version: 2.4.5
145
+ rubygems_version: 2.5.1
144
146
  signing_key:
145
147
  specification_version: 4
146
148
  summary: Error reports you can be happy about.