Pivotal Knowledge Base

Follow

gprecoverseg fails with " gprecoverseg failed. (Reason=''PGPORT'') "

Problem

Running gprecoverseg to recover the failed segments errors out with the message

gprecoverseg failed. (Reason=''PGPORT'') 

The complete meessage along with the python stack looks like below

20150305:12:15:24:027141 gprecoverseg:mdw:gpadmin-[CRITICAL]:-gprecoverseg failed. (Reason=''PGPORT'') exiting...
Traceback (most recent call last):
  File "/usr/local/greenplum-db/./bin/gprecoverseg", line 19, in 
    GpRecoverSegmentProgram.mainOptions() )
  File "/usr/local/greenplum-db/lib/python/gppylib/mainUtils.py", line 195, in simple_main
    simple_main_internal(createOptionParserFn, createCommandFn, mainOptions)
  File "/usr/local/greenplum-db/lib/python/gppylib/mainUtils.py", line 219, in simple_main_internal
    simple_main_locked(createOptionParserFn, createCommandFn, mainOptions)
  File "/usr/local/greenplum-db/lib/python/gppylib/mainUtils.py", line 313, in simple_main_locked
    commandObject.cleanup()
  File "/usr/local/greenplum-db/lib/python/gppylib/programs/clsRecoverSegment.py", line 1392, in cleanup
    self.__pool.haltWork()    # \  MPP-13489, CR-2572
  File "/usr/local/greenplum-db/lib/python/gppylib/commands/base.py", line 157, in haltWork
    w.haltWork()
  File "/usr/local/greenplum-db/lib/python/gppylib/commands/base.py", line 253, in haltWork
    c.interrupt()
  File "/usr/local/greenplum-db/lib/python/gppylib/commands/base.py", line 725, in interrupt
    self.exec_context.interrupt(self)
AttributeError: 'NoneType' object has no attribute 'interrupt'

Cause

The issue is due to the environment variable "PGPORT" that the gprecoverseg python script uses is not set in the environment.

[gpadmin@mdw xx]$ echo $PGPORT

[gpadmin@mdw xx]$

Solution

Export the environment variable PGPORT and retry the gprecoverseg command again.

export PGPORT=<port of the GPDB cluster>

Comments

  • Avatar
    Yadukula Chengappa

    Very helpful. Thanks

    Regards,
    Yadu

Powered by Zendesk