Pivotal Knowledge Base

Follow

gprecoverseg failing due to server ssh banner

Problem

gprecoverseg command fails , turning on the verbose mode "gprecoverseg -v" shows the following error:

20150812:16:33:19:018897 gprecoverseg:00213SG1LGRE01:gpadmin-[DEBUG]:-[worker0] finished cmd: Get segment status cmdStr='ssh -o 'StrictHostKeyChecking no' 00213SG1LGRE05 ". /usr/local/greenplum-db/./greenplum_path.sh; $GPHOME/bin/gp_primarymirror -h 00213SG1LGRE05 -p 40003"' had result: cmd had rc=1 completed=True halted=False
stdout=''
stderr='DO NOT PROCEED UNLESS YOU ARE AN AUTHORISED USER

This is a private computer facility protected by a security system. Access to, and use of, this system is restricted to genuine account users. Activity and use of this network is strictly monitored to secure effective operation and for other lawful business purposes. Communications using these systems will also be monitored and may be recorded to secure the effective operation and for other lawful business purposes.

Unauthorised access or attempts to alter, destroy or damage data, programs or equipment could result in criminal prosecution.

stroy or damage data, programs or equipment could result in criminal prosecution.

mode: PrimarySegment
segmentState: Ready
dataState: InChangeTracking
faultType: NotInitialized
mode: PrimarySegment
segmentState: Ready
dataState: InChangeTracking
faultType: NotInitialized
'

Cause

This is caused due to ssh banner prompt of server i.e the banner that displayed on the screen when a user connect to the server.

Solution

Please do the following on all segment hosts

  • "vi" the /etc/ssh/sshd_config file and look for the banner in question and then comment it out.
#Banner /etc/issue
  • service sshd restart
  • retry gprecoverseg

Comments

  • Avatar
    Brendan Stephens

    gprecoverseg and other utilities which use gp_primarymirror are expecting the stderr to only include the mode information -- anything else will cause the script to crash when it performs it's evaluation...

    ```
    20161005:10:42:06:062639 gprecoverseg:ecdlnjqgrpms01:gpadmin-[ERROR]:-gprecoverseg failed. exiting...
    Traceback (most recent call last):
    File "/bb/gpdata/greenplum-db/lib/python/gppylib/mainUtils.py", line 281, in simple_main_locked
    exitCode = commandObject.run()
    File "/bb/gpdata/greenplum-db/lib/python/gppylib/programs/clsRecoverSegment.py", line 1266, in run
    raise Exception("Inconsistency in catalog and segment Role/Mode. Catalog Role = %s. Segment Mode = %s." % (db.getSegmentRole(), mode))
    Exception: Inconsistency in catalog and segment Role/Mode. Catalog Role = p. Segment Mode = error in locking authority file /home/gpadmin/.Xauthority.
    ```

    To find hosts or segments that are returning something other than 'mode':
    grep -Eo '(\-h .* \-p [0-9]+)|(stderr=.*)' [verbose_log_output_file] | grep -v mode | awk '/^-h/{host=$0}/^stderr/{print host;print $0}'

    And you will get the host / port and error...
    ```
    grep -Eo '(\-h .* \-p [0-9]+)|(stderr=.*)' gprecoverseg_20161005.log | grep -v mode | awk '/^-h/{host=$0}/^stderr/{print host;print $0}'
    -h sdw1 -p 50003
    stderr='/usr/bin/xauth: error in locking authority file /home/gpadmin/.Xauthority
    -h sdw2 -p 50005
    stderr='/usr/bin/xauth: error in locking authority file /home/gpadmin/.Xauthority
    -h sdw3 -p 40002
    stderr='Warning: No xauth data; using fake authentication data for X11 forwarding.
    ```

    Edited by Brendan Stephens
Powered by Zendesk