Skip to content

Commit

Permalink
Add distinction between failed to dial errors
Browse files Browse the repository at this point in the history
  • Loading branch information
superseb authored and Denise committed Jul 25, 2018
1 parent 5aca37c commit 25018af
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion hosts/dialer.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,12 @@ func (d *dialer) Dial(network, addr string) (net.Conn, error) {

remote, err := conn.Dial(network, addr)
if err != nil {
return nil, fmt.Errorf("Unable to access the Docker socket (%s). Please check if the configured user can execute `docker ps` on the node, and if the SSH server version is at least version 6.7 or higher. If you are using RedHat/CentOS, you can't use the user `root`. Please refer to the documentation for more instructions. Error: %v", addr, err)
if strings.Contains(err.Error(), "connect failed") {
return nil, fmt.Errorf("Unable to access the service on %s. The service might be still starting up. Error: %v", addr, err)
} else if strings.Contains(err.Error(), "administratively prohibited") {
return nil, fmt.Errorf("Unable to access the Docker socket (%s). Please check if the configured user can execute `docker ps` on the node, and if the SSH server version is at least version 6.7 or higher. If you are using RedHat/CentOS, you can't use the user `root`. Please refer to the documentation for more instructions. Error: %v", addr, err)
}
return nil, fmt.Errorf("Failed to dial to %s: %v", addr, err)
}
return remote, err
}
Expand Down

0 comments on commit 25018af

Please sign in to comment.