powervc-diag command is hung

You might encounter errors when working with powervc-diag command.


In some environments, yum or RPM database could get corrupted (due to reasons outside of PowerVC). This might impact functioning of the powervc-diag CLI and the command could hang for an indefinite period of time.

Sample errors:

error: rpmdb: BDB0113 Thread/process 225875/140736166909792 failed: BDB1507 Thread died in Berkeley DB library
error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db5 - (-30973)
error: cannot open Packages database in /var/lib/rpm

Traceback (most recent call last):

File "/usr/bin/powervc-diag", line 17, in <module>
  File "/usr/lib/python3.6/site-packages/powervc_ras/cmd/diag.py", line 185, in main
  File "/usr/lib/python3.6/site-packages/powervc_ras/cmd/diag.py", line 233, in begin
    common.capture_generic_data(dinfo, utils.maxwaittime, dtmp)
  File "/usr/lib/python3.6/site-packages/powervc_ras/cli/diag_utils/common.py", line 139, in capture_generic_data
  File "/usr/lib/python3.6/site-packages/powervc_ras/cli/diag_utils/common.py", line 452, in collect_platform_info
  File "/usr/lib/python3.6/site-packages/powervc_ras/cli/diag_utils/utils.py", line 737, in getinstallinfo
    miter = tset.dbMatch()
_rpm.error: rpmdb open failed


Cancel the powevc-diag command execution by running Ctrl + C. Then, backup and rebuild the yum database following the below steps:
mkdir /var/lib/rpm/backup
cp -a /var/lib/rpm/__db* /var/lib/rpm/backup/
rm -f /var/lib/rpm/__db.[0-9][0-9]*
rpm --quiet -qa
rpm --rebuilddb
yum clean all

Now, retry running the powervc-diag command.