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

Excaption while trying to use client #563

Closed
anoam opened this issue Apr 24, 2014 · 8 comments
Closed

Excaption while trying to use client #563

anoam opened this issue Apr 24, 2014 · 8 comments

Comments

@anoam
Copy link

anoam commented Apr 24, 2014

In my project I try to use client.
So I run:
client = Savon.client(wsdl: 'http://schemas.xmlsoap.org/soap/envelope/?wsdl')
client.operations

And I get:
RuntimeError: eventmachine not initialized: evma_connect_to_server
from /home/anoam/.rvm/gems/ruby-1.9.3-p385@ipr/gems/eventmachine-1.0.3/lib/eventmachine.rb:664:in connect_server' from /home/anoam/.rvm/gems/ruby-1.9.3-p385@ipr/gems/eventmachine-1.0.3/lib/eventmachine.rb:664:inbind_connect'
from /home/anoam/.rvm/gems/ruby-1.9.3-p385@ipr/gems/em-http-request-1.1.2/lib/em-http/http_connection.rb:55:in activate_connection' from /home/anoam/.rvm/gems/ruby-1.9.3-p385@ipr/gems/em-http-request-1.1.2/lib/em-http/http_connection.rb:92:insetup_request'
from (eval):6:in get' from /home/anoam/.rvm/gems/ruby-1.9.3-p385@ipr/gems/httpi-2.1.0/lib/httpi/adapter/em_http.rb:50:inblock in request'
from /home/anoam/.rvm/gems/ruby-1.9.3-p385@ipr/gems/httpi-2.1.0/lib/httpi/adapter/em_http.rb:68:in _request' from /home/anoam/.rvm/gems/ruby-1.9.3-p385@ipr/gems/httpi-2.1.0/lib/httpi/adapter/em_http.rb:50:inrequest'
from /home/anoam/.rvm/gems/ruby-1.9.3-p385@ipr/gems/httpi-2.1.0/lib/httpi.rb:140:in request' from /home/anoam/.rvm/gems/ruby-1.9.3-p385@ipr/gems/httpi-2.1.0/lib/httpi.rb:106:inget'
from /home/anoam/.rvm/gems/ruby-1.9.3-p385@ipr/gems/wasabi-3.2.3/lib/wasabi/resolver.rb:42:in load_from_remote' from /home/anoam/.rvm/gems/ruby-1.9.3-p385@ipr/gems/wasabi-3.2.3/lib/wasabi/resolver.rb:32:inresolve'
from /home/anoam/.rvm/gems/ruby-1.9.3-p385@ipr/gems/wasabi-3.2.3/lib/wasabi/document.rb:141:in xml' from /home/anoam/.rvm/gems/ruby-1.9.3-p385@ipr/gems/wasabi-3.2.3/lib/wasabi/document.rb:159:inparse'
from /home/anoam/.rvm/gems/ruby-1.9.3-p385@ipr/gems/wasabi-3.2.3/lib/wasabi/document.rb:146:in parser' from /home/anoam/.rvm/gems/ruby-1.9.3-p385@ipr/gems/wasabi-3.2.3/lib/wasabi/document.rb:63:insoap_actions'
from /home/anoam/.rvm/gems/ruby-1.9.3-p385@ipr/gems/savon-2.4.0/lib/savon/client.rb:28:in operations' from (irb):8 from /home/anoam/.rvm/gems/ruby-1.9.3-p385@ipr/gems/railties-3.2.16/lib/rails/commands/console.rb:47:instart'
from /home/anoam/.rvm/gems/ruby-1.9.3-p385@ipr/gems/railties-3.2.16/lib/rails/commands/console.rb:8:in start' from /home/anoam/.rvm/gems/ruby-1.9.3-p385@ipr/gems/railties-3.2.16/lib/rails/commands.rb:41:in<top (required)>'
from script/rails:6:in require' from script/rails:6:in

'

But when I have created new ampty project with same ruby, rails and savon gem - same code works fine.
It looks like there is a conflict but I can't find with what.

@tjarratt
Copy link
Contributor

Hey @anoam I'm sorry that I can't be more helpful, but this exception seems incredibly specific to your own use case. You seem to be using Savon with EventMachine and also Rails, and this particular exception is stemming from EventMachine.

If you can provide some more information to help debug this issue, (maybe a larger snippet of ruby code?) I'd be willing to take a look, but I'm not sure I'd be very helpful. Good luck!

@anoam
Copy link
Author

anoam commented Apr 29, 2014

Hi, @tjarratt! Thank you for your answer. Could you prompt, what information should I post? I have just installed gem and left all settings by default. EventMachine is just used as dependency for something. For my mind it even shouldn't use EventMachine in my case, but I not sure. Full crushed code example is in original post.
In blank application it works fine, but there is same problem in blank application with same gemfile.
Just in case, here my gemfile: https://gist.github.com/anoam/603c26ed0e95132d5e14

@tjarratt
Copy link
Contributor

Oh I see what's going on. It looks like HTTPI, a dependency of Savon, is using the EventMachine HTTP adapter and is failing for ... Some unknown reason?

Could you try this code:

after require 'savon'

HTTPI.adapter = :net_http

... Create client and call operation

My theory is that the EM HTTP adapter expects to be called with some particular state or at a particular time. Using another adapter should fix this particular error.

Sent From A Very Small Keyboard

On Apr 28, 2014, at 23:43, anoam notifications@github.com wrote:

Hi, @tjarratt! Thank you for your answer. Could you prompt, what information should I post? I have just installed gem and left all settings by default. EventMachine is just used as dependency for something. For my mind it even shouldn't use EventMachine in my case, but I not sure. Full crushed code example is in original post.
In blank application it warks fine, but there is sam problem in blank application with same gemfile.
Just in case, here my gemfile: https://gist.github.com/anoam/603c26ed0e95132d5e14


Reply to this email directly or view it on GitHub.

@anoam
Copy link
Author

anoam commented Apr 29, 2014

Thanks alot!
Now it works fine.
My humble opinion is that HTTPI trys adapters from list. And net_http is after VM in this list.
I thought that I need something like #566 and it looks like that in common it was correct.
But now I see that it is not Savon problem.
Thanks again. And I'm sorry if my question was too stupid.

@tjarratt
Copy link
Contributor

No apology needed. I was happy to help you with your problem! If anything, I should apologize for closing this issue so quickly and dismissing your problem. At the end of the day, the important thing is that we figured out how to fix a weird bug in some software.

@joshco
Copy link

joshco commented May 18, 2014

FYI, I ran into this as well. Changing the HTTPI transport to net_http fixed it.
Seems unfortunate that em_http defaults to a higher priority transport than net_http even though it seems to require some preparatory setup.

@tjarratt
Copy link
Contributor

I suppose it might be a good idea to lower em_http in the list.

Mostly I'm surprised to find this many people using event machine and Savon together.

Sent From A Very Small Keyboard

On May 18, 2014, at 5:37, Josh notifications@github.com wrote:

FYI, I ran into this as well. Changing the HTTPI transport to net_http fixed it.
Seems unfortunate that em_http defaults to a higher priority transport than net_http even though it seems to require some preparatory setup.


Reply to this email directly or view it on GitHub.

@joshco
Copy link

joshco commented May 18, 2014

Mostly I'm surprised to find this many people using event machine and Savon together.

This is uncommanded. My script is just a plain ruby file with require 'savon' in it.
I have eventmatchine installed on my machine, but other than that, I'm not including it or doing anything explicit with eventmachine in this script.

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

No branches or pull requests

3 participants