Discussion:
AWS spot instance is up and running but Fog timeout
Sylvain Kalache
2013-10-15 00:48:00 UTC
Permalink
Hello,

I'm launching AWS spot instance with the fog.spot_requests.bootstrap()
method.

Sometime it works, sometime it timeout on line 75 of the file
spot_requests.rb
https://github.com/fog/fog/blob/master/lib/fog/aws/models/compute/spot_requests.rb

However the spot instance is actually launched, running state. Any idea of
what I can do to avoid that?

Cheers!
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
geemus (Wesley Beary)
2013-10-15 14:45:59 UTC
Permalink
By default timeout is 600 seconds (10 minutes). Which is usually
sufficient. If you are running into issues like this regularly you can bump
that value up by using `Fog.timeout = 1200` or similar. See also:
https://github.com/fog/fog/blob/master/lib/fog/core/timeout.rb

Hope that helps, that should be the easiest way to accommodate for the
timeouts I believe.


On Mon, Oct 14, 2013 at 7:48 PM, Sylvain Kalache
Post by Sylvain Kalache
Hello,
I'm launching AWS spot instance with the fog.spot_requests.bootstrap()
method.
Sometime it works, sometime it timeout on line 75 of the file
spot_requests.rb
https://github.com/fog/fog/blob/master/lib/fog/aws/models/compute/spot_requests.rb
However the spot instance is actually launched, running state. Any idea of
what I can do to avoid that?
Cheers!
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Sylvain Kalache
2013-10-15 20:33:44 UTC
Permalink
Thanks for your answer.

Unfortunately that did not make the trick. What is weird is that the spot
instance is in a running state and I can SSH to it, but it's still timing
out on server.wait_for { ready? }

I'll dive deeper in this wait_for method.
Post by geemus (Wesley Beary)
By default timeout is 600 seconds (10 minutes). Which is usually
sufficient. If you are running into issues like this regularly you can bump
https://github.com/fog/fog/blob/master/lib/fog/core/timeout.rb
Hope that helps, that should be the easiest way to accommodate for the
timeouts I believe.
Post by Sylvain Kalache
Hello,
I'm launching AWS spot instance with the fog.spot_requests.bootstrap()
method.
Sometime it works, sometime it timeout on line 75 of the file
spot_requests.rb
https://github.com/fog/fog/blob/master/lib/fog/aws/models/compute/spot_requests.rb
However the spot instance is actually launched, running state. Any idea
of what I can do to avoid that?
Cheers!
--
You received this message because you are subscribed to the Google Groups
"ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Kyle Rames
2013-10-15 20:58:57 UTC
Permalink
Hmmmm.

wait_for just reloads the server state and then calls the ready? method to
determine if the server is ready for usage. Looking at the implementation
of the ready? method, it seems to check to see if it is in the 'running'
state. It could be that this implementation needs to be revised.

https://github.com/fog/fog/blob/master/lib/fog/aws/models/compute/server.rb#L133-L135

Can you run your script again and prefix it with EXCON_DEBUG=true. That
will print out the request/response coming from aws.

Kyle
Post by Sylvain Kalache
Thanks for your answer.
Unfortunately that did not make the trick. What is weird is that the spot
instance is in a running state and I can SSH to it, but it's still timing
out on server.wait_for { ready? }
I'll dive deeper in this wait_for method.
Post by geemus (Wesley Beary)
By default timeout is 600 seconds (10 minutes). Which is usually
sufficient. If you are running into issues like this regularly you can bump
https://github.com/fog/fog/blob/master/lib/fog/core/timeout.rb
Hope that helps, that should be the easiest way to accommodate for the
timeouts I believe.
Post by Sylvain Kalache
Hello,
I'm launching AWS spot instance with the fog.spot_requests.bootstrap()
method.
Sometime it works, sometime it timeout on line 75 of the file
spot_requests.rb
https://github.com/fog/fog/blob/master/lib/fog/aws/models/compute/spot_requests.rb
However the spot instance is actually launched, running state. Any idea
of what I can do to avoid that?
Cheers!
--
You received this message because you are subscribed to the Google
Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Sylvain Kalache
2013-10-15 22:47:01 UTC
Permalink
Thanks Kyle for your answer.

So actually the issue was coming from line 76 with server.setup(:key_data =>
[spot_request.private_key])
My bad, I was specifying the wrong private key.

Is there anyway that I could have debug this in a easier/faster way?
Post by Kyle Rames
Hmmmm.
wait_for just reloads the server state and then calls the ready? method to
determine if the server is ready for usage. Looking at the implementation
of the ready? method, it seems to check to see if it is in the 'running'
state. It could be that this implementation needs to be revised.
https://github.com/fog/fog/blob/master/lib/fog/aws/models/compute/server.rb#L133-L135
Can you run your script again and prefix it with EXCON_DEBUG=true. That
will print out the request/response coming from aws.
Kyle
Post by Sylvain Kalache
Thanks for your answer.
Unfortunately that did not make the trick. What is weird is that the spot
instance is in a running state and I can SSH to it, but it's still timing
out on server.wait_for { ready? }
I'll dive deeper in this wait_for method.
Post by geemus (Wesley Beary)
By default timeout is 600 seconds (10 minutes). Which is usually
sufficient. If you are running into issues like this regularly you can bump
https://github.com/fog/fog/blob/master/lib/fog/core/timeout.rb
Hope that helps, that should be the easiest way to accommodate for the
timeouts I believe.
Post by Sylvain Kalache
Hello,
I'm launching AWS spot instance with the fog.spot_requests.bootstrap()
method.
Sometime it works, sometime it timeout on line 75 of the file
spot_requests.rb
https://github.com/fog/fog/blob/master/lib/fog/aws/models/compute/spot_requests.rb
However the spot instance is actually launched, running state. Any idea
of what I can do to avoid that?
Cheers!
--
You received this message because you are subscribed to the Google
Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Kyle Rames
2013-10-16 13:05:07 UTC
Permalink
I am glad you got it figured out!

It looks like we are specifically thwarting you attempts to find out this
information by catching the Net::SSH::AuthenticationFailed exception here:

https://github.com/fog/fog/blob/master/lib/fog/compute/models/server.rb#L72

To answer your question, I believe you could have updated line 76 to
include a :verbose => :debug which would have probably gotten some better
debug information from the SSH library.

server.setup(:key_data => [spot_request.private_key], :verbose => :debug)

I think this is very unintuitive and I can see this issue cropping up for
other developers. To that end, I created a github issue to get this fixed.
https://github.com/fog/fog/issues/2273.

Kyle
Post by Sylvain Kalache
Thanks Kyle for your answer.
So actually the issue was coming from line 76 with server.setup(:key_data
=> [spot_request.private_key])
My bad, I was specifying the wrong private key.
Is there anyway that I could have debug this in a easier/faster way?
Post by Kyle Rames
Hmmmm.
wait_for just reloads the server state and then calls the ready? method
to determine if the server is ready for usage. Looking at the
implementation of the ready? method, it seems to check to see if it is in
the 'running' state. It could be that this implementation needs to be
revised.
https://github.com/fog/fog/blob/master/lib/fog/aws/models/compute/server.rb#L133-L135
Can you run your script again and prefix it with EXCON_DEBUG=true. That
will print out the request/response coming from aws.
Kyle
Post by Sylvain Kalache
Thanks for your answer.
Unfortunately that did not make the trick. What is weird is that the
spot instance is in a running state and I can SSH to it, but it's still
timing out on server.wait_for { ready? }
I'll dive deeper in this wait_for method.
Post by geemus (Wesley Beary)
By default timeout is 600 seconds (10 minutes). Which is usually
sufficient. If you are running into issues like this regularly you can bump
https://github.com/fog/fog/blob/master/lib/fog/core/timeout.rb
Hope that helps, that should be the easiest way to accommodate for the
timeouts I believe.
Post by Sylvain Kalache
Hello,
I'm launching AWS spot instance with the fog.spot_requests.bootstrap()
method.
Sometime it works, sometime it timeout on line 75 of the file
spot_requests.rb
https://github.com/fog/fog/blob/master/lib/fog/aws/models/compute/spot_requests.rb
However the spot instance is actually launched, running state. Any
idea of what I can do to avoid that?
Cheers!
--
You received this message because you are subscribed to the Google
Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
geemus (Wesley Beary)
2013-10-16 13:06:37 UTC
Permalink
It is a tricky problem. I'll comment on the ticket.
Post by Kyle Rames
I am glad you got it figured out!
It looks like we are specifically thwarting you attempts to find out this
https://github.com/fog/fog/blob/master/lib/fog/compute/models/server.rb#L72
To answer your question, I believe you could have updated line 76 to
include a :verbose => :debug which would have probably gotten some better
debug information from the SSH library.
server.setup(:key_data => [spot_request.private_key], :verbose => :debug)
I think this is very unintuitive and I can see this issue cropping up for
other developers. To that end, I created a github issue to get this fixed.
https://github.com/fog/fog/issues/2273.
Kyle
Post by Sylvain Kalache
Thanks Kyle for your answer.
So actually the issue was coming from line 76 with server.setup(:key_data
=> [spot_request.private_key])
My bad, I was specifying the wrong private key.
Is there anyway that I could have debug this in a easier/faster way?
Post by Kyle Rames
Hmmmm.
wait_for just reloads the server state and then calls the ready? method
to determine if the server is ready for usage. Looking at the
implementation of the ready? method, it seems to check to see if it is in
the 'running' state. It could be that this implementation needs to be
revised.
https://github.com/fog/fog/**blob/master/lib/fog/aws/**
models/compute/server.rb#L133-**L135<https://github.com/fog/fog/blob/master/lib/fog/aws/models/compute/server.rb#L133-L135>
Can you run your script again and prefix it with EXCON_DEBUG=true. That
will print out the request/response coming from aws.
Kyle
Post by Sylvain Kalache
Thanks for your answer.
Unfortunately that did not make the trick. What is weird is that the
spot instance is in a running state and I can SSH to it, but it's still
timing out on server.wait_for { ready? }
I'll dive deeper in this wait_for method.
Post by geemus (Wesley Beary)
By default timeout is 600 seconds (10 minutes). Which is usually
sufficient. If you are running into issues like this regularly you can bump
https://github.com/fog/**fog/blob/master/lib/fog/core/**timeout.rb<https://github.com/fog/fog/blob/master/lib/fog/core/timeout.rb>
Hope that helps, that should be the easiest way to accommodate for the
timeouts I believe.
Post by Sylvain Kalache
Hello,
I'm launching AWS spot instance with the
fog.spot_requests.bootstrap() method.
Sometime it works, sometime it timeout on line 75 of the file
spot_requests.rb
https://github.com/fog/fog/**blob/master/lib/fog/aws/**
models/compute/spot_requests.**rb<https://github.com/fog/fog/blob/master/lib/fog/aws/models/compute/spot_requests.rb>
However the spot instance is actually launched, running state. Any
idea of what I can do to avoid that?
Cheers!
--
You received this message because you are subscribed to the Google
Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it,
For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
.
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Sylvain Kalache
2013-10-17 18:46:39 UTC
Permalink
This :verbose => :debug was VERY useful to debug, thanks :-)
Post by geemus (Wesley Beary)
It is a tricky problem. I'll comment on the ticket.
Post by Kyle Rames
I am glad you got it figured out!
It looks like we are specifically thwarting you attempts to find out this
information by catching the Net::SSH::AuthenticationFailed exception here
https://github.com/fog/fog/blob/master/lib/fog/compute/models/server.rb#L72
To answer your question, I believe you could have updated line 76 to
include a :verbose => :debug which would have probably gotten some
better debug information from the SSH library.
server.setup(:key_data => [spot_request.private_key], :verbose => :debug
)
I think this is very unintuitive and I can see this issue cropping up for
other developers. To that end, I created a github issue to get this fixed.
https://github.com/fog/fog/issues/2273.
Kyle
Post by Sylvain Kalache
Thanks Kyle for your answer.
So actually the issue was coming from line 76 with server.setup(
:key_data => [spot_request.private_key])
My bad, I was specifying the wrong private key.
Is there anyway that I could have debug this in a easier/faster way?
Post by Kyle Rames
Hmmmm.
wait_for just reloads the server state and then calls the ready? method
to determine if the server is ready for usage. Looking at the
implementation of the ready? method, it seems to check to see if it is in
the 'running' state. It could be that this implementation needs to be
revised.
https://github.com/fog/fog/**blob/master/lib/fog/aws/**
models/compute/server.rb#L133-**L135<https://github.com/fog/fog/blob/master/lib/fog/aws/models/compute/server.rb#L133-L135>
Can you run your script again and prefix it with EXCON_DEBUG=true. That
will print out the request/response coming from aws.
Kyle
Post by Sylvain Kalache
Thanks for your answer.
Unfortunately that did not make the trick. What is weird is that the
spot instance is in a running state and I can SSH to it, but it's still
timing out on server.wait_for { ready? }
I'll dive deeper in this wait_for method.
Post by geemus (Wesley Beary)
By default timeout is 600 seconds (10 minutes). Which is usually
sufficient. If you are running into issues like this regularly you can bump
https://github.com/fog/**fog/blob/master/lib/fog/core/**timeout.rb<https://github.com/fog/fog/blob/master/lib/fog/core/timeout.rb>
Hope that helps, that should be the easiest way to accommodate for
the timeouts I believe.
On Mon, Oct 14, 2013 at 7:48 PM, Sylvain Kalache <
Post by Sylvain Kalache
Hello,
I'm launching AWS spot instance with the
fog.spot_requests.bootstrap() method.
Sometime it works, sometime it timeout on line 75 of the file
spot_requests.rb
https://github.com/fog/fog/**blob/master/lib/fog/aws/**
models/compute/spot_requests.**rb<https://github.com/fog/fog/blob/master/lib/fog/aws/models/compute/spot_requests.rb>
However the spot instance is actually launched, running state. Any
idea of what I can do to avoid that?
Cheers!
--
You received this message because you are subscribed to the Google
Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it,
For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
.
--
You received this message because you are subscribed to the Google Groups
"ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Loading...