Hi Matt,

Paramiko doesn't have a connection cache that I'm aware of, but Fabric
itself does. However, from your description it sounds like you are
creating a new instance and then connecting to it, so I'm not sure why
a cache would present a problem.

If you're rebooting a remote system or doing anything to alter the
networking of an already-connected system, then you can force a
reconnect by manipulating fabric.state.connections. For example, see
what the (master-only) reboot() operation does:

    
http://code.fabfile.org/repositories/entry/fabric/master/fabric/operations.py#L668

If the problem is as straightforward as it sounds, though, I'm
honestly not sure what's up other than "possible Paramiko bug". Are
you getting any prompts or anything when you connect to the new
instance by hand?

Another thing to try is to upgrade Paramiko to 1.7.6 if you're using
the bundled 1.7.4.

-Jeff


On Thu, Jun 10, 2010 at 5:38 PM, Matt Calder <mvcal...@gmail.com> wrote:
> Bruno,
>
> No it is in a good group. I can log in using fabric if I restart it
> and the instance is already running. I can see that fabric is inside
> network.py trying to make the connection. I get one of two errors:
> either timeout or low level socket error. In debugging, I added
> retries to network.connect and it will fail repeatedly. First it times
> out a few times, then gives the "low level socket" error. While it
> doing that, I can ssh into it from a terminal. I wonder does paramiko
> have a connection cache ? Maybe it is not really retrying? Thanks for
> any help.
>
>
> Matt
>
> On Thu, Jun 10, 2010 at 5:23 PM, Bruno Clermont
> <bruno.clerm...@gmail.com> wrote:
>> Is your instance in a security group that allow your IP and the port your
>> trying to connect to?
>> If it timeout, it's probably blocked by Amazon firewalls.
>>
>> On Thu, Jun 10, 2010 at 15:07, Matt Calder <mvcal...@gmail.com> wrote:
>>>
>>> Hi,
>>>
>>> I am having problems using fabric with EC2 instances. I am not
>>> entirely sure fabric is even the source of the problem, but I am
>>> hoping someone on this list can suggest a solution or a path to
>>> investigate. Here is the problem. I start an EC2 instance using boto.
>>> I wait for the instance to report its state as "running". I wait an
>>> addition 60 seconds after that. Then I try to "run" things on the
>>> instance through fabric. At that point I get:
>>>
>>>  [ubu...@ec2-174-129-96-241.compute-1.amazonaws.com] run: ls
>>>
>>> Fatal error: Timed out trying to connect to
>>> ec2-174-129-96-241.compute-1.amazonaws.com
>>>
>>> Aborting.
>>>
>>> Now, the interesting thing is this. During that additional 60 second
>>> wait I can log into the instance from a separate terminal, moreover,
>>> when I do that separate login, the fabric login succeeds.
>>>
>>> Obviously, there is not a lot to go on here, but I am not entirely
>>> sure what additional information would be helpful. If anyone has a
>>> suggestion of what I might try to do, I would greatly appreciate it.
>>> Thanks,
>>>
>>> Matt
>>>
>>> _______________________________________________
>>> Fab-user mailing list
>>> Fab-user@nongnu.org
>>> http://lists.nongnu.org/mailman/listinfo/fab-user
>>
>>
>
> _______________________________________________
> Fab-user mailing list
> Fab-user@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/fab-user
>



-- 
Jeff Forcier
Unix sysadmin; Python/Ruby developer
http://bitprophet.org

_______________________________________________
Fab-user mailing list
Fab-user@nongnu.org
http://lists.nongnu.org/mailman/listinfo/fab-user

Reply via email to