Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Output from SSH command that fails should be printed #1266

Closed
bfirsh opened this issue May 29, 2015 · 3 comments
Closed

Output from SSH command that fails should be printed #1266

bfirsh opened this issue May 29, 2015 · 3 comments
Labels

Comments

@bfirsh
Copy link
Contributor

bfirsh commented May 29, 2015

$ docker-machine create ...
Creating SSH key...
Creating Digital Ocean droplet...
Error creating machine: exit status 255
You will want to check the provider to make sure the machine and associated resources were properly removed.

This isn't particularly helpful. It should probably be something like this:

$ docker-machine create ...
Creating SSH key...
Creating Digital Ocean droplet...
Error running command "sudo -E apt-get update" on the Machine. Here is the output:

---------------------------------
... error ...
---------------------------------

You will want to check the provider to make sure the machine and associated resources were properly removed.
@prologic
Copy link

+1

@nathanleclaire
Copy link
Contributor

I'm all for storing / showing more information in the case of an error, although I think we need to think about the approach a bit. Generally where I'm headed is towards having a docker-machine logs command which allows access to anything which gets logged by Machine in flight (including all debug output) to a log file on disk (just like docker logs), and that is something which can be queried later by the user, or by us if we want to selectively show things like above.

Bear in mind that there are many cases in Machine where things like SSH commands could fail and it is perfectly fine and normal (e.g. the SSH command timed out so we want to re-try it), so implementing this kind of thing without also spewing "undesirable"/scary error messages at the user is a little trickier than it may look at first glance.

@nathanleclaire
Copy link
Contributor

Update: I may have been a bit hasty. I think that the "good" SSH failures (testing if SSH is up / working) are largely exit code 255, so perhaps the proposed solution in my PR might work OK for now.

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

No branches or pull requests

3 participants