-
Notifications
You must be signed in to change notification settings - Fork 176
Description
Describe the bug
The error:
DEBUG -- [Bugsnag]: Breadcrumb Mongo query succeeded meta_data collection:Array has been dropped for having an invalid data type
Bugsnag is failing to create the breadcrumbs when rescuing Mongoid::Errors::Validations
. We recently upgraded to Rails v5.2.4.4 and immediately started seeing these errors in our logs when a failed attempt to persist a record is rescued: gems/mongoid-6.1.1/lib/mongoid/persistable.rb:76:in 'fail_due_to_validation!'
This is the code for the rescue:
begin
identifier_mapping.save! if identifier_mapping.changed?
rescue Mongoid::Errors::Validations => e
Bugsnag.notify(e)
Rails.logger.warn(e.message)
end
According to https://docs.bugsnag.com/platforms/ruby/rails/automatically-captured-data/ for Mongo breadcrumbs, you automatically capture the collection
type meta_data for this breadcrumb type.
However, since the upgrade the Rails, these errors are being logged. We didn't change our Bugsnag version, and the Breadcrumbs validations
doesn't seem to support the type Array, which leaves me wondering if the returned error from Mongoid
has changed, and this needs to be added to the validations, as per this issue:#539
Environment
- Bugsnag version: 6.15.0
- Ruby version:
- Bundle version: 2.1.4
- Integration framework version:
- Rails: 5.2.4.4
- Mongoid: 6.1.1
- Mongo: 2.10.2