Skip to content
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

Breadcrumb Mongo query succeeded meta_data collection:Array has been dropped for having an invalid data type #635

Open
godfrey-altmetric opened this issue Oct 1, 2020 · 2 comments
Labels
awaiting feedback Awaiting a response from a customer. Will be automatically closed after approximately 2 weeks.

Comments

@godfrey-altmetric
Copy link

godfrey-altmetric commented Oct 1, 2020

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
@mattdyoung
Copy link

Hi @godfrey-altmetric

Thanks for reporting. We're taking a look.

@mattdyoung mattdyoung added backlog We hope to fix this feature/bug in the future bug Confirmed bug labels Oct 7, 2020
@bugsnagbot bugsnagbot added scheduled Work is starting on this feature/bug and removed backlog We hope to fix this feature/bug in the future labels Dec 21, 2020
@imjoehaines
Copy link
Contributor

Hey @godfrey-altmetric, I've been looking into this today but I can't reproduce this issue. Is there anything in your application that might be affecting this? For example, do you change the Mongoid collection with methods like Model.with(collection: 'xyz')?

Mongoid didn't support Rails 5.1 until v6.2.0, so it's possible this is a compatibility issue and updating Mongoid may resolve it

The validation we do is actually no longer necessary, so I've removed it in #648 which should be in the next release. This should stop the logs you're seeing and might help debugging the issue as we'll be able to see what collection is

@abigailbramble abigailbramble added awaiting feedback Awaiting a response from a customer. Will be automatically closed after approximately 2 weeks. and removed scheduled Work is starting on this feature/bug bug Confirmed bug labels Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting feedback Awaiting a response from a customer. Will be automatically closed after approximately 2 weeks.
Projects
None yet
Development

No branches or pull requests

5 participants