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

Fix internal Rollbar error caused when ActiveRecord was present, but not used #204

Merged
merged 1 commit into from
Jan 20, 2015

Conversation

GUI
Copy link
Contributor

@GUI GUI commented Jan 17, 2015

If the ActiveRecord gem was required in a Rails app, but not actually used or configured (in favor of some other ORM or no ORM), then Rollbar would internally error whenever it tried to send an exception message. This was being caused by the person tracking functionality seeing that ActiveRecord existed, but then it would raise a ActiveRecord::ConnectionNotEstablished error when it actually tried to use the connection. This in turn led to a rather non-obvious error in the logs:

[Rollbar] Reporting internal error encountered while sending data to Rollbar.
[Rollbar] Sending payload
[Rollbar] Got unexpected status code from Rollbar api: 422
[Rollbar] Response: {
  "err": 1,
  "message": "Invalid format. data.context object value found, but a string is required."
}

This should fix this person-tracking situation by first checking whether ActiveRecord is actually connected before trying to do ActiveRecord-specific functions.

If the ActiveRecord gem was required in a Rails app, but not actually
used or configured (in favor of some other ORM or no ORM), then Rollbar
would internally error whenever it tried to send an exception message.
This was being caused by the person tracking functionality seeing that
ActiveRecord existed, but then it would raise a
ActiveRecord::ConnectionNotEstablished error when it actually tried to
use the connection. This in turn led to a rather non-obvious error in
the logs:

```
[Rollbar] Reporting internal error encountered while sending data to Rollbar.
[Rollbar] Sending payload
[Rollbar] Got unexpected status code from Rollbar api: 422
[Rollbar] Response: {
  "err": 1,
  "message": "Invalid format. data.context object value found, but a string is required."
}
```

This should fix this person-tracking situation by first checking whether
ActiveRecord is actually connected before trying to do
ActiveRecord-specific functions.
GUI added a commit to NREL/api-umbrella-web that referenced this pull request Jan 17, 2015
Basically, seed-fu was requiring activerecord, even though it wasn't
being used. This in turn triggered an internal Rollbar error when
Rollbar attempted to report exceptions. See:
rollbar/rollbar-gem#204
@jondeandres
Copy link
Contributor

@GUI thanks for this! ;-)

@brianr we can merge this, it's a clear bug in our side.

brianr added a commit that referenced this pull request Jan 20, 2015
Fix internal Rollbar error caused when ActiveRecord was present, but not used
@brianr brianr merged commit 9244c49 into rollbar:master Jan 20, 2015
@brianr
Copy link
Member

brianr commented Jan 20, 2015

Thanks @GUI! Will get a new release out shortly.

@brianr
Copy link
Member

brianr commented Jan 20, 2015

Up on rubygems in version 1.4.1. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants