You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hawq.apache.org by radarwave <gi...@git.apache.org> on 2017/04/07 05:24:11 UTC

[GitHub] incubator-hawq pull request #1211: HAWQ-1425. Print error message if ssh con...

GitHub user radarwave opened a pull request:

    https://github.com/apache/incubator-hawq/pull/1211

    HAWQ-1425. Print error message if ssh connect failed.

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/radarwave/incubator-hawq ssherr

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-hawq/pull/1211.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1211
    
----
commit fb04af3c73843af466c23d5f452488be78292dc9
Author: rlei <rl...@pivotal.io>
Date:   2017-04-06T09:14:56Z

    HAWQ-1425. Print error message if ssh connect failed.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request #1211: HAWQ-1425. Print error message if ssh con...

Posted by radarwave <gi...@git.apache.org>.
Github user radarwave commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/1211#discussion_r110324197
  
    --- Diff: tools/bin/hawqpylib/hawqlib.py ---
    @@ -203,6 +203,13 @@ def check_hostname_equal(remote_host, user = ""):
         cmd = "hostname"
         result_local, local_hostname, stderr_remote  = local_ssh_output(cmd)
         result_remote, remote_hostname, stderr_remote = remote_ssh_output(cmd, remote_host, user)
    +    if result_remote != 0:
    +        print stderr_remote
    +        print "Execute remote command failed on %s." % remote_host
    --- End diff --
    
    For Q1, added command line and error code in the error message.
    For Q2, there are enough error information inside stderr_remote. User can read and know what's happening.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request #1211: HAWQ-1425. Print error message if ssh con...

Posted by paul-guo- <gi...@git.apache.org>.
Github user paul-guo- commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/1211#discussion_r110322817
  
    --- Diff: tools/bin/hawqpylib/hawqlib.py ---
    @@ -203,6 +203,13 @@ def check_hostname_equal(remote_host, user = ""):
         cmd = "hostname"
         result_local, local_hostname, stderr_remote  = local_ssh_output(cmd)
         result_remote, remote_hostname, stderr_remote = remote_ssh_output(cmd, remote_host, user)
    +    if result_remote != 0:
    +        print stderr_remote
    +        print "Execute remote command failed on %s." % remote_host
    --- End diff --
    
    " with return code %d"  % result_remote?
    
    Do we have error log or output in log file or hawq utility output?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request #1211: HAWQ-1425. Print error message if ssh con...

Posted by radarwave <gi...@git.apache.org>.
Github user radarwave commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/1211#discussion_r110341344
  
    --- Diff: tools/bin/hawqpylib/hawqlib.py ---
    @@ -203,6 +203,13 @@ def check_hostname_equal(remote_host, user = ""):
         cmd = "hostname"
         result_local, local_hostname, stderr_remote  = local_ssh_output(cmd)
         result_remote, remote_hostname, stderr_remote = remote_ssh_output(cmd, remote_host, user)
    +    if result_remote != 0:
    +        print "Execute command '%s' failed with return code %d on %s." % (cmd, result_remote, remote_host)
    +        print "Either ssh connection fails or command exits with error. Details:"
    +        print stderr_remote
    +        print "For ssh connection issue, please make sure passwordless ssh is enabled or check remote host."
    --- End diff --
    
    Although a simple command, it's possible the remote OS have some issue can cause failures. So not only the ssh connection error.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request #1211: HAWQ-1425. Print error message if ssh con...

Posted by huor <gi...@git.apache.org>.
Github user huor commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/1211#discussion_r110327071
  
    --- Diff: tools/bin/hawqpylib/hawqlib.py ---
    @@ -203,6 +203,13 @@ def check_hostname_equal(remote_host, user = ""):
         cmd = "hostname"
         result_local, local_hostname, stderr_remote  = local_ssh_output(cmd)
         result_remote, remote_hostname, stderr_remote = remote_ssh_output(cmd, remote_host, user)
    +    if result_remote != 0:
    +        print "Execute command '%s' failed with return code %d on %s." % (cmd, result_remote, remote_host)
    +        print "Either ssh connection fails or command exits with error. Details:"
    +        print stderr_remote
    +        print "For ssh connection issue, please make sure passwordless ssh is enabled or check remote host."
    --- End diff --
    
    The remote command only check if the host exist.
    ```
    if result_remote != 0:
        print "Execute command '%s' failed with return code %d on %s." % (cmd, result_remote, remote_host)
        print "Please check ssh connection and make sure passwordless ssh is enabled."
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request #1211: HAWQ-1425. Print error message if ssh con...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-hawq/pull/1211


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request #1211: HAWQ-1425. Print error message if ssh con...

Posted by paul-guo- <gi...@git.apache.org>.
Github user paul-guo- commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/1211#discussion_r110319372
  
    --- Diff: tools/bin/hawqpylib/hawqlib.py ---
    @@ -203,6 +203,17 @@ def check_hostname_equal(remote_host, user = ""):
         cmd = "hostname"
         result_local, local_hostname, stderr_remote  = local_ssh_output(cmd)
         result_remote, remote_hostname, stderr_remote = remote_ssh_output(cmd, remote_host, user)
    +    # SSH return 255 error code when having connection issues, otherwise return code is in [0, 255).
    +    if result_remote == 255:
    +        print "Create ssh connection to %s failed." % remote_host
    +        print "Please check the ssh connection and make sure passwordless ssh enabled."
    +        sys.exit(result_remote)
    +    elif result_remote > 0:
    +        print "Execute remote command failed."
    +        sys.exit(result_remote)
    +    else:
    +        pass
    +
    --- End diff --
    
    Judge via 255 seems to be wrong since the cmd could return 255, e.g.
    [pguo@host67:/home/pguo]$ ssh 127.0.0.1 'exit 255'
    [pguo@host67:/home/pguo]$ echo $?
    255
    
    I'm wondering whether we could show the error info in hawq utility output or log file, and we still check result_remote>0 and log for this condition like this:
    
    ssh command returns with error, either ssh connection fails or cmd exits with error. see more in log or.....



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request #1211: HAWQ-1425. Print error message if ssh con...

Posted by huor <gi...@git.apache.org>.
Github user huor commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/1211#discussion_r110323503
  
    --- Diff: tools/bin/hawqpylib/hawqlib.py ---
    @@ -203,6 +203,13 @@ def check_hostname_equal(remote_host, user = ""):
         cmd = "hostname"
         result_local, local_hostname, stderr_remote  = local_ssh_output(cmd)
         result_remote, remote_hostname, stderr_remote = remote_ssh_output(cmd, remote_host, user)
    +    if result_remote != 0:
    +        print stderr_remote
    +        print "Execute remote command failed on %s." % remote_host
    +        print "Either ssh connection fails or command exits with error."
    +        print "For ssh connection issue, please check connection and make sure passwordless ssh enabled."
    --- End diff --
    
    ```
    if result_remote != 0:
        print "Failed to execute remote command on %s. Either ssh connection issue or command error. Details:" % remote_host
        print stderr_remote
        print "Please check connection and make sure passwordless ssh is enabled, or check remote host"
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request #1211: HAWQ-1425. Print error message if ssh con...

Posted by radarwave <gi...@git.apache.org>.
Github user radarwave commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/1211#discussion_r110322606
  
    --- Diff: tools/bin/hawqpylib/hawqlib.py ---
    @@ -203,6 +203,17 @@ def check_hostname_equal(remote_host, user = ""):
         cmd = "hostname"
         result_local, local_hostname, stderr_remote  = local_ssh_output(cmd)
         result_remote, remote_hostname, stderr_remote = remote_ssh_output(cmd, remote_host, user)
    +    # SSH return 255 error code when having connection issues, otherwise return code is in [0, 255).
    +    if result_remote == 255:
    +        print "Create ssh connection to %s failed." % remote_host
    +        print "Please check the ssh connection and make sure passwordless ssh enabled."
    +        sys.exit(result_remote)
    +    elif result_remote > 0:
    +        print "Execute remote command failed."
    +        sys.exit(result_remote)
    +    else:
    +        pass
    +
    --- End diff --
    
    Thanks @paul-guo- , print error message is good idea. Fixed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq issue #1211: HAWQ-1425. Print error message if ssh connect fa...

Posted by huor <gi...@git.apache.org>.
Github user huor commented on the issue:

    https://github.com/apache/incubator-hawq/pull/1211
  
    +1 for the fix


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---