GPPKG Install Fails "No Such File or Directory"
search cancel

GPPKG Install Fails "No Such File or Directory"

book

Article ID: 295210

calendar_today

Updated On:

Products

VMware Tanzu Greenplum

Issue/Introduction

When attempting to install a package via "gppkg", errors similar to the following may be seen:
 

gpadmin@testserver1 ~]$ gppkg -i /tmp/postgis-2.5.4+pivotal.4.build.3-gp6-rhel7-x86_64.gppkg
20210609:12:53:40:005319 gppkg:testserver1:gpadmin-[INFO]:-Starting gppkg with args: -i /tmp/postgis-2.5.4+pivotal.4.build.3-gp6-rhel7-x86_64.gppkg
20210609:12:53:40:005319 gppkg:testserver1:gpadmin-[INFO]:-Installing package postgis-2.5.4+pivotal.4.build.3-gp6-rhel7-x86_64.gppkg
20210609:12:53:40:005319 gppkg:testserver1:gpadmin-[INFO]:-Validating rpm installation cmdStr='rpm --test -i /opt/greenplum/greenplum-db-6.15.0/.tmp/libexpat-2.1.0-1.x86_64.rpm /opt/greenplum/greenplum-db-6.15.0/.tmp/gdal-1.11.1-1.x86_64.rpm /opt/greenplum/greenplum-db-6.15.0/.tmp/proj-4.8.0-1.x86_64.rpm /opt/greenplum/greenplum-db-6.15.0/.tmp/json-c-0.12-1.x86_64.rpm /opt/greenplum/greenplum-db-6.15.0/.tmp/postgis-2.5.4-1.x86_64.rpm /opt/greenplum/greenplum-db-6.15.0/.tmp/geos-3.4.2-1.x86_64.rpm --dbpath /opt/greenplum/greenplum-db-6.15.0/share/packages/database --prefix /opt/greenplum/greenplum-db-6.15.0'
20210609:12:53:41:005319 gppkg:testserver1:gpadmin-[ERROR]:-[Errno 2] No such file or directory: '/opt/greenplum/greenplum-db-6.15.0/.tmp/deps/libexpat-2.1.0-1.x86_64.rpm'
Traceback (most recent call last):
File "/opt/greenplum/greenplum-db-6.15.0/lib/python/gppylib/commands/base.py", line 278, in run
self.cmd.run()
File "/opt/greenplum/greenplum-db-6.15.0/lib/python/gppylib/operations/__init__.py", line 53, in run
self.ret = self.execute()
File "/opt/greenplum/greenplum-db-6.15.0/lib/python/gppylib/operations/utils.py", line 57, in execute
raise ret
IOError: [Errno 2] No such file or directory: '/opt/greenplum/greenplum-db-6.15.0/.tmp/deps/libexpat-2.1.0-1.x86_64.rpm'
20210609:12:53:41:005319 gppkg:testserver1:gpadmin-[ERROR]:-[Errno 39] Directory not empty: '/opt/greenplum/greenplum-db-6.15.0/.tmp'
Traceback (most recent call last):
File "/opt/greenplum/greenplum-db-6.15.0/lib/python/gppylib/commands/base.py", line 278, in run
self.cmd.run()
File "/opt/greenplum/greenplum-db-6.15.0/lib/python/gppylib/operations/__init__.py", line 53, in run
self.ret = self.execute()
File "/opt/greenplum/greenplum-db-6.15.0/lib/python/gppylib/operations/utils.py", line 57, in execute
raise ret
OSError: [Errno 39] Directory not empty: '/opt/greenplum/greenplum-db-6.15.0/.tmp'


Also, the gp_segment_configuration table may show that the same hosts are listed in multiple ways (FQDN, Short Name, IP).  For example, all three below segments are the same physical host, but the hostname is different.
 

  10 |       8 | p    | p              | s    | u      | 16008 | 10.1.2.3                | 10.125.97.34 | /data/gpdb9/primary/gpseg8  
 11 |       9 | p    | p              | s    | u      | 16009 | testsegment1.acme.com | 10.125.97.34 | /data/gpdb10/primary/gpseg9
   12 |      10 | p    | p              | s    | u      | 16010 | 10.1.2.3                 | 10.125.97.34 | /data/gpdb11/primary/gpseg10




Resolution

GPPKG looks at the gp_segment_configuration hostname fields to determine which hosts need package installation.  If a single host is appearing under multiple names on this list, there will be issues during package operations.

Please Note: Any changes to the gp_segment_configuration should be done in master only mode to avoid corruption. 

The below query can be used to help confirm if there is an issue present.  This example would encounter issues with gppkg due to the fact that host "gpdb-615-1" is listed by multiple hostnames.

gpadmin=# select count(*),hostname,address from gp_segment_configuration group by hostname,address;
 count |  hostname  |  address   
-------+------------+------------
     4 | gpdb-615-2 | gpdb-615-2
     3 | gpdb-615-1 | gpdb-615-1
     1 | 10.1.1.3   | gpdb-615-1
     1 | gpdb-615-m | gpdb-615-m
(3 rows)



In order to correct this, the hostname field in gp_segment_configuration must be updated.  This should be done in master only mode.

Following the example above, the full gp_segment_configuration would look like this example.  Note the hostname for DBID 2.

gpadmin=# select * from gp_segment_configuration
gpadmin-# ;
 dbid | content | role | preferred_role | mode | status | port  |  hostname  |  address   |                 datadir                 
------+---------+------+----------------+------+--------+-------+------------+------------+-----------------------------------------
    1 |      -1 | p    | p              | n    | u      |  3000 | gpdb-615-m | gpdb-615-m | /data/master/gp_6.15.0_20210315193310-1
    9 |       3 | p    | m              | s    | u      | 35001 | gpdb-615-1 | gpdb-615-1 | /data/mirror/gp_6.15.0_202103151933103
    5 |       3 | m    | p              | s    | u      | 30001 | gpdb-615-2 | gpdb-615-2 | /data/primary/gp_6.15.0_202103151933103
    6 |       0 | p    | m              | s    | u      | 35000 | gpdb-615-2 | gpdb-615-2 | /data/mirror/gp_6.15.0_202103151933100
    2 |       0 | m    | p              | s    | u      | 30000 | 10.1.1.3 | gpdb-615-1 | /data/primary/gp_6.15.0_202103151933100
    7 |       1 | p    | m              | s    | u      | 35001 | gpdb-615-2 | gpdb-615-2 | /data/mirror/gp_6.15.0_202103151933101
    3 |       1 | m    | p              | s    | u      | 30001 | gpdb-615-1 | gpdb-615-1 | /data/primary/gp_6.15.0_202103151933101
    8 |       2 | p    | m              | s    | u      | 35000 | gpdb-615-1 | gpdb-615-1 | /data/mirror/gp_6.15.0_202103151933102
    4 |       2 | m    | p              | s    | u      | 30000 | gpdb-615-2 | gpdb-615-2 | /data/primary/gp_6.15.0_202103151933102
(9 rows)


In the above example, we would correct this by running the following:

BEGIN;
set allow_system_table_mods=true;
update gp_segment_configuration set hostname='gpdb-615-1' where dbid=2;
COMMIT;

After this stop the master and restart the database.