quickbooks-ruby icon indicating copy to clipboard operation
quickbooks-ruby copied to clipboard

Quickbooks::IntuitRequestException: : <?xml version="1.0"?>

Open bcackerman opened this issue 7 years ago • 12 comments

We just switched to Puma/Sidekiq and we get this error often as well when using quickbooks-ruby gem. Here's a short backtrace: https://cl.ly/ly83

Is this a bug with quickbooks-ruby?

bcackerman avatar Aug 11 '17 14:08 bcackerman

Possibly related to #393 - it looks like net/http is not thread-safe which might be the crux of this

https://stackoverflow.com/questions/3063088/is-rubys-nethttp-threadsafe

ruckus avatar Aug 11 '17 18:08 ruckus

@ruckus Is there a way we can not use net/http or make it threadsafe?

bcackerman avatar Aug 11 '17 23:08 bcackerman

I think we're going to have to switch to a threadsafe HTTP client like

  • rest-client : https://github.com/rest-client/rest-client
  • httpclient : https://github.com/nahi/httpclient

ruckus avatar Aug 11 '17 23:08 ruckus

Would installing the gem here https://github.com/drbrain/net-http-persistent/ help in the meantime you feel @ruckus ?

bcackerman avatar Aug 11 '17 23:08 bcackerman

Although I am quite surprised that no one has encountered this issue before. Put another way: I find it hard to believe you're the first Puma/Sidekiq user to use this library.

I see you're on Ruby 2.4. Perhaps thats an issue? Is it reproducible on Ruby 2.3 under Puma/Sidekiq?

ruckus avatar Aug 11 '17 23:08 ruckus

We've been getting this for a long time on ruby 2.3.1 in sidekiq jobs. I'd never bothered trying to track down the cause so I'm excited to see this thread!

drewish avatar Aug 31 '17 02:08 drewish

@ruckus in the OAuth2 branch you're moving to Faraday. Would you consider pulling some of that work forward into a separate PR to help address these threading issues?

drewish avatar Apr 10 '18 15:04 drewish

Any solution?

briandiaz avatar Jul 18 '18 23:07 briandiaz

@drewish Yes the 389-oauth2 branch does use Faraday but thats really indirectly by virtue of the dependent oauth2 gem using it.

This gem does not directly use net/http, its used internally by the oauth(1) gem.

Which is to say that its not so easy for this gem to swap out the internal HTTP library as really its internal to the underlying oauth gem.

ruckus avatar Jul 19 '18 15:07 ruckus

Are there plans to merge 389-oauth2 into master?

bcackerman avatar Jul 23 '18 22:07 bcackerman

Hi all, I'm currently on quickbooks-ruby version 1.0.17 and am seeing this error periodically in my Sidekiq jobs. I've upgraded Faraday (1.10.0) and OAuth2 (1.4.9), and set the http adapter to net_http_persistent.

Is anyone else still seeing this error?

greycampbell avatar Apr 12 '22 15:04 greycampbell

@greycampbell oof, thats no bueno. im still in a single-threaded / process based environment, so I wouldn't see this. hopefully others that can chime in and provide advice/ideas/support.

ruckus avatar Apr 16 '22 23:04 ruckus