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

Issue when using the stripe_event gem #23

Closed
benedikt opened this issue Aug 15, 2014 · 3 comments
Closed

Issue when using the stripe_event gem #23

benedikt opened this issue Aug 15, 2014 · 3 comments
Assignees
Labels

Comments

@benedikt
Copy link

Hi!

I'm running into an issue using the stripe_event gem. The gem provides an endpoint for webhooks from Stripe. In order to validate them, it also re-fetches the events via the Stripe API. This is slow and triggers the slow transaction monitoring of the appsignal gem. Unfortunately something breaks, apparently while preprocessing some object of the stripe-ruby gem.

app2 method=POST path=/stripe/endpoint/ format=xml controller=stripe_event/webhook action=event status=200 duration=1313.95
app2 
app2 NoMethodError (Cannot set id on this object. HINT: you can't set: api_key, id):
app2   appsignal (0.10.2) lib/appsignal/transaction.rb:120:in `block (2 levels) in convert_values_to_primitives!'
app2   appsignal (0.10.2) lib/appsignal/transaction.rb:119:in `block in convert_values_to_primitives!'
app2   appsignal (0.10.2) lib/appsignal/transaction.rb:118:in `map'
app2   appsignal (0.10.2) lib/appsignal/transaction.rb:118:in `convert_values_to_primitives!'
app2   appsignal (0.10.2) lib/appsignal/aggregator.rb:61:in `pre_process_slowness!'
app2   appsignal (0.10.2) lib/appsignal/aggregator.rb:20:in `add'
app2   appsignal (0.10.2) lib/appsignal/agent.rb:88:in `enqueue'
app2   appsignal (0.10.2) lib/appsignal.rb:73:in `enqueue'
app2   appsignal (0.10.2) lib/appsignal/transaction.rb:151:in `complete!'
app2   appsignal (0.10.2) lib/appsignal/transaction.rb:26:in `complete_current!'
app2   appsignal (0.10.2) lib/appsignal/rack/listener.rb:24:in `call_with_appsignal_monitoring'
app2   appsignal (0.10.2) lib/appsignal/rack/listener.rb:11:in `call'
app2 
app2 

The NoMethodError is triggered by this line in the stripe-ruby gem: https://github.com/stripe/stripe-ruby/blob/4aed61af42df22d77106558354bd2f5370c04e06/lib/stripe/stripe_object.rb#L168
Apparently the appsignal gem tries to modify a Stripe::StripeObject instance.

I tried to further debug the issue, but couldn't figure out what's going on.

@matsimitsu matsimitsu self-assigned this Aug 15, 2014
@matsimitsu matsimitsu added the bug label Aug 15, 2014
@matsimitsu matsimitsu added this to the 0.10.3 milestone Aug 15, 2014
@matsimitsu
Copy link
Member

Thanks for reporting! I'll pick this up this weekend :)

@matsimitsu
Copy link
Member

I just pushed a branch (events) that should fix this issue. I expect a release of 0.10.3 with this fix today. If you want to try it out, you can by using the events branch in your gemfile.

gem 'appsignal', :git => 'https://github.com/appsignal/appsignal.git', :branch => 'events'

@thijsc
Copy link
Member

thijsc commented Dec 3, 2014

This branch has been shipped in gem 0.11.

@thijsc thijsc closed this as completed Dec 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants