quickbooks-ruby
quickbooks-ruby copied to clipboard
Quickbooks::IntuitRequestException: : <?xml version="1.0"?>
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
?
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 Is there a way we can not use net/http
or make it threadsafe?
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
Would installing the gem here https://github.com/drbrain/net-http-persistent/ help in the meantime you feel @ruckus ?
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?
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!
@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?
Any solution?
@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.
Are there plans to merge 389-oauth2
into master?
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 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.