FPP: Comando “rhpctl import image” Falha com Erro “PRGO-1773 : The compressed file /fpp/images/<image_name>/swhome/home.zip is not valid for import”

No FPP podemos criar GoldImage a partir de uma instalação existente em qualquer servidor acessível pelo FPP Server. O processo consiste em utilizar o comando “rhpctl import image”, que acessa o servidor de destino via ssh e realiza a cópia do binário para um ACFS dentro do FPP Server.

Neste post demonstro um erro que encontrei ao tentar utilizar esse procedimento em um ambiente recém instalado, e como involuntariamente cheguei na solução do problema.

Problema

Ao tentar criar uma nova GoldImage importando um Oracle Home a partir de um FPP Target:

rhpctl import image -image GI1922_DBA -targetnode lab01 -path /u01/app/19.0.0/grid2 -imagetype ORACLEGISOFTWARE -cred dibiei_root
fppserver.dibiei.com: Audit ID: 166
fppserver.dibiei.com: Adding storage for image ...
fppserver.dibiei.com: Creating a new ACFS file system for image "GI1922_DBA" ...
fppserver.dibiei.com: Copying files...
fppserver.dibiei.com: Extracting files to directory /fpp/images/iGI1922_DBA143088/swhome...
PRGO-1257 : failed to import image "GI1922_DBA"
PRGO-1257 : failed to import image "GI1922_DBA"
PRGO-1773 : The compressed file /fpp/images/iGI1922_DBA143088/swhome/home.zip is not valid for import.
PRCR-1178 : Execution of command failed on one or more nodes

PRCF-2072 : The command "unzip" failed.
PRCF-2071 : The command "unzip" failed on the following nodes: fppserver.
[/fpp/images/iGI1922_DBA143088/swhome/home.zip]  End-of-central-directory signature not found.  Either this file is not  a zipfile, or it constitutes one disk of a multi-part archive.  In the  latter case the central directory and zipfile comment will be found on  the last disk(s) of this archive.unzip:  cannot find zipfile directory in one of /fpp/images/iGI1922_DBA143088/swhome/home.zip or        /fpp/images/iGI1922_DBA143088/swhome/home.zip.zip, and cannot find /fpp/images/iGI1922_DBA143088/swhome/home.zip.ZIP, period. :failed

O comando falhou informando que o arquivo “.zip” não é válido.

Tetando descompactar o arquivo manualmente, recebo o mesmo erro:

[grid@fppserver ~]$ mkdir -p /u01/medias/teste
[grid@fppserver ~]$ unzip -q /fpp/images/iGI1922_DBA143088/swhome/home.zip -d /u01/medias/teste/
[/fpp/images/iGI1922_DBA143088/swhome/home.zip]
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /fpp/images/iGI1922_DBA143088/swhome/home.zip or
        /fpp/images/iGI1922_DBA143088/swhome/home.zip.zip, and cannot find /fpp/images/iGI1922_DBA143088/swhome/home.zip.ZIP, period.

Ao verificar o tamanho do arquivo .zip, constatei que realmente havia algo de errado, pois o tamanho do arquivo estava zerado:

[grid@fppserver ~]$ du -sh /fpp/images/iGI1922_DBA143088/swhome/home.zip
0       /fpp/images/iGI1922_DBA143088/swhome/home.zip

Investigando o arquivo de log do FPP Server, antes da mensagem de erro, haviam mensagens de log indicando que a cópia foi concluída com sucesso, mas nenhum erro (o log abaixo foi truncado as primeiras colunas com timestamp para facilitar a visualizaçao):

JSChChannel.execCommandInternal:1474   setting env variable SRVM_TRACE=true
JSChChannel.execCommandInternal:1474   setting env variable RHPHELPER_TRACEFILE=/tmp//rhphelp_20240419234708.trc
JSChChannel.execCommandInternal:1474   setting env variable LANG=en_US.UTF-8
JSChChannel.execCommandInternal:1474   setting env variable LC_ALL=en_US.UTF-8
JSChChannel.execCommandInternal:1474   setting env variable NLS_LANG=American_America.UTF8
JSChChannel.execCommandInternal:1474   setting env variable TMP=/tmp/
JSChChannel.execCommandInternal:1615   Reading output from the remote node
JSChChannel.execCommandInternal:1630   Using output after password/stdin have been written
JSChChannel.execCommandInternal:1632   Getting input stream from channel
JSChChannel.execCommandInternal:1642   trying to read from input buffer, start time = 1713581229101
CopyListenerImpl.run:242   CopyListener - Accepted a connection
CopyListenerImpl.handleClientRequests:293   Looking for type of action to be done by listener
CopyListenerImpl.handleClientRequests:308   Verified that the message contained key ...
CopyListenerImpl.handleClientRequests:311   Action type to be performed: COPYTOME
CopyListenerImpl$CopyToMeHandler.run:609   Sending SEND ack ...
CopyListenerImpl$CopyToMeHandler.run:611   SEND ack sent
CopyListenerImpl$CopyToMeHandler.run:613   Making sure that directory structure exists ...
CopyListenerImpl$CopyToMeHandler.run:617   Directory structure now exists
CopyListenerImpl$CopyToMeHandler.run:619   Copying file to location /fpp/images/iGI1922_DBA143088/swhome/home.zip
CopyListenerImpl$CopyToMeHandler.run:626   Starting copy thread on receiver side ...
StreamCopy.run:345   StreamCopy End: no exceptions
CopyListenerImpl$CopyToMeHandler.run:630   Acquired stream copy semaphore ...
CopyListenerImpl$CopyToMeHandler.run:660   Closing socket streams
CopyListenerImpl$CopyToMeHandler.run:676   File copy successful ...

No servidor target, eu olhei o arquivo de “/tmp//rhphelp_20240419234708.trc” indicado acima, mas também não havia indicativo de erro. No entanto a última mensagem desse trace era “zip sent succsfully”.

Resolvi testar o utilitário “zip” neste servidor e ele não estava instalado:

[grid@lab01 grid2]$ zip
-bash: zip: command not found

Solução

Esta solução foi mais por indução do que por evidência.

Resolvi instalar o utilitário zip no servidor de onde estava tentando importar uma GoldImage, e depois tentar criar a Gold Image novamente.

[grid@lab01 grid2]$ su -
Password:
Last login: Fri Apr 19 23:42:34 -03 2024 on pts/3
[root@lab01 ~]# dnf install zip
Last metadata expiration check: 1:25:24 ago on Fri 19 Apr 2024 11:00:37 PM -03.
Dependencies resolved.
==============================================================================================================================================================================================================
 Package                                    Architecture                                  Version                                              Repository                                                Size
==============================================================================================================================================================================================================
Installing:
 zip                                        x86_64                                        3.0-23.el8                                           ol8_baseos_latest                                        270 k

Transaction Summary
==============================================================================================================================================================================================================
Install  1 Package

Total download size: 270 k
Installed size: 822 k
Is this ok [y/N]: y
Downloading Packages:
zip-3.0-23.el8.x86_64.rpm                                                                                                                                                     729 kB/s | 270 kB     00:00
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                         724 kB/s | 270 kB     00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                      1/1
  Installing       : zip-3.0-23.el8.x86_64                                                                                                                                                                1/1
  Running scriptlet: zip-3.0-23.el8.x86_64                                                                                                                                                                1/1
  Verifying        : zip-3.0-23.el8.x86_64                                                                                                                                                                1/1

Installed:
  zip-3.0-23.el8.x86_64

Complete!

De volta ao FPP Server, deletei o registro da GoldImage no repositório.

[grid@fppserver rhp]$ rhpctl delete image -image GI1922_DBA
fppserver.dibiei.com: Audit ID: 171
fppserver.dibiei.com: Finding ACFS file system of the image "GI1922_DBA" with home path "/fpp/images/iGI1922_DBA932018/swhome" ...
fppserver.dibiei.com: Deleting image from the repository ...

DICA: Quando você importa uma GoldImage, a primeira coisa que o FPP faz é registrar no repositório.
Se esse processo apresenta falha, uma nova tentativa com o mesmo nome requer que você delete a que foi criada parcialmente.)

E ao tentar importar a GoldImage novamente, voilá !

[grid@fppserver rhp]$ rhpctl import image -image GI1922_DBA -targetnode lab01 -path /u01/app/19.0.0/grid2 -imagetype ORACLEGISOFTWARE -cred dibiei_root
fppserver.dibiei.com: Audit ID: 177
fppserver.dibiei.com: Adding storage for image ...
fppserver.dibiei.com: Creating a new ACFS file system for image "GI1922_DBA" ...
fppserver.dibiei.com: Copying files...
fppserver.dibiei.com: Extracting files to directory /fpp/images/iGI1922_DBA405978/swhome...
fppserver.dibiei.com: Files successfully extracted

Validando que foi criada com sucesso:

[grid@fppserver rhp]$ rhpctl query image -image GI1922_DBA
fppserver.dibiei.com: Audit ID: 178
Image name: GI1922_DBA
Owner: grid@fppserver
Site: fppserver
Access control: USER:grid@fppserver
Access control: ROLE:OTHER
Access control: ROLE:GH_IMG_PUBLISH
Access control: ROLE:GH_IMG_ADMIN
Access control: ROLE:GH_IMG_VISIBILITY
Parent Image:
Software home path: /fpp/images/iGI1922_DBA405978/swhome
Image state: PUBLISHED
Image size: 11774 Megabytes
Image Type: ORACLEGISOFTWARE
Image Version: 19.0.0.0.0:19.23.0.0.0
Groups configured in the image: OSDBA=dba,OSOPER=dba,OSASM=dba,OSBACKUP=dba,OSDG=dba,OSKM=dba,OSRAC=dba
Image platform: Linux_AMD64
Interim patches installed: 36460248,36383196,36240578,36233343,36233263
Contains a non-rolling patch: FALSE
Complete: TRUE
[grid@fppserver rhp]$ du -sh /fpp/images/iGI1922_DBA405978/swhome
13G     /fpp/images/iGI1922_DBA405978/swhome

Teste Reverso

Como a solução acima foi mais no achismo do que qualquer outra coisa, eu repeti o teste removendo o zip novamente do servidor de banco de dados, e o FPP voltou a apresentar o comando de erro.

1) Removendo a GoldImage no FPP Server

[grid@fppserver rhp]$ rhpctl delete image -image GI1922_DBA
fppserver.dibiei.com: Audit ID: 179
fppserver.dibiei.com: Finding ACFS file system of the image "GI1922_DBA" with home path "/fpp/images/iGI1922_DBA405978/swhome" ...
fppserver.dibiei.com: Deleting image from the repository ...

2) No FPP Target, removi o utilitário zip:

[root@lab01 tmp]# dnf remove zip
Dependencies resolved.
==============================================================================================================================================================================================================
 Package                                    Architecture                                  Version                                             Repository                                                 Size
==============================================================================================================================================================================================================
Removing:
 zip                                        x86_64                                        3.0-23.el8                                          @ol8_baseos_latest                                        822 k

Transaction Summary
==============================================================================================================================================================================================================
Remove  1 Package

Freed space: 822 k
Is this ok [y/N]: y
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                      1/1
  Erasing          : zip-3.0-23.el8.x86_64                                                                                                                                                                1/1
  Running scriptlet: zip-3.0-23.el8.x86_64                                                                                                                                                                1/1
  Verifying        : zip-3.0-23.el8.x86_64                                                                                                                                                                1/1

Removed:
  zip-3.0-23.el8.x86_64

Complete!
[root@lab01 tmp]#
[root@lab01 tmp]# zip
-bash: zip: command not found

3) No FPP Server, tentei importar a GoldImage novamente com o mesmo comando que havia apresentado sucesso:

[grid@fppserver rhp]$ rhpctl import image -image GI1922_DBA -targetnode lab01 -path /u01/app/19.0.0/grid2 -imagetype ORACLEGISOFTWARE -cred dibiei_root
fppserver.dibiei.com: Audit ID: 180
fppserver.dibiei.com: Adding storage for image ...
fppserver.dibiei.com: Creating a new ACFS file system for image "GI1922_DBA" ...
fppserver.dibiei.com: Copying files...
fppserver.dibiei.com: Extracting files to directory /fpp/images/iGI1922_DBA212014/swhome...
PRGO-1257 : failed to import image "GI1922_DBA"
PRGO-1257 : failed to import image "GI1922_DBA"
PRGO-1773 : The compressed file /fpp/images/iGI1922_DBA212014/swhome/home.zip is not valid for import.
PRCR-1178 : Execution of command failed on one or more nodes

PRCF-2072 : The command "unzip" failed.
PRCF-2071 : The command "unzip" failed on the following nodes: fppserver.
[/fpp/images/iGI1922_DBA212014/swhome/home.zip]  End-of-central-directory signature not found.  Either this file is not  a zipfile, or it constitutes one disk of a multi-part archive.  In the  latter case the central directory and zipfile comment will be found on  the last disk(s) of this archive.unzip:  cannot find zipfile directory in one of /fpp/images/iGI1922_DBA212014/swhome/home.zip or        /fpp/images/iGI1922_DBA212014/swhome/home.zip.zip, and cannot find /fpp/images/iGI1922_DBA212014/swhome/home.zip.ZIP, period. :failed

Com isso confirmamos que o processo de importar Gold Image depende do zip instalado no servidor de destino que possui o oracle Home sendo importado.

Leave a Comment

Scroll to Top

Discover more from Blog do Dibiei

Subscribe now to keep reading and get access to the full archive.

Continue reading