VMware Cloud Community
leshe
Contributor
Contributor
Jump to solution

Upgrade VCSA 6.5u3a to 6.7u3m Fails Stage 2 Database pre-upgrade checks

Process upgrade via web-ui get error

 

cat /tmp/read_db_value_err-RiXevk.tmp

Password for user postgres:
psql.bin: fe_sendauth: no password supplied

 

ERROR __main__ Upgrade Phase 'vcdb:CollectRequirements' failed. Exception: could not convert string to float:

CollectRequirements_com.vmware.vcdb

 

2021-07-14T03:29:22.804Z INFO __main__ Set root upgrade folder to: /tmp/vmware-upgrade-temp-dirsII12ZPY0m/tmpu5gbPLatIt/payload/component-scripts
2021-07-14T03:29:22.861Z INFO sdk_utils Loading external install configuration from /tmp/vmware-upgrade-temp-dirsII12ZPY0m/tmpu5gbPLatIt/config/vcsa_install_config.json
2021-07-14T03:29:24.949Z INFO install_param_utils Retrieve install-parameter feature.states=
2021-07-14T03:29:24.949Z INFO featureState_utils Found FSS 'DeferHistoryImport' with value 'True'
2021-07-14T03:29:24.957Z INFO __main__ Context file /tmp/vmware-upgrade-temp-dirsII12ZPY0m/tmpu5gbPLatIt/upgrade_working_directory/system-data/upgrade-com.vmware.vcdb-upgradeContext does not exist. Use default context
2021-07-14T03:29:24.957Z INFO extensions Found upgrade phase <module 'vcdb' from '/tmp/vmware-upgrade-temp-dirsII12ZPY0m/tmpu5gbPLatIt/payload/component-scripts/vcdb/__init__.py'>:CollectRequirements'
2021-07-14T03:29:24.958Z INFO extensions Executing upgrade phase '<module 'vcdb' from '/tmp/vmware-upgrade-temp-dirsII12ZPY0m/tmpu5gbPLatIt/payload/component-scripts/vcdb/__init__.py'>:CollectRequirements' with context {u'targetManagementAddress': u'10.221.21.72', u'resourceDir': u'/tmp/vmware-upgrade-temp-dirsII12ZPY0m/tmpu5gbPLatIt/upgrade_working_directory', u'targetManagementPort': 443, u'devMode': False, u'locale': u'en', u'targetManagementUsername': u'root', u'targetManagementPassword': 'CENSORED', u'destinationSsoVersion': u'', u'sourceSsoUsername': None, u'sourceSsoPassword': 'CENSORED', u'sourceManagementPassword': 'CENSORED', u'destinationVcVersion': u'6.7', u'sourceManagementAddress': u'10.221.21.72', u'sourceVcVersion': u'6.5', u'sourceManagementUsername': u'root', 'logDir': u'/var/log/vmware/upgrade', u'systemExportDir': u'/tmp/vmware-upgrade-temp-dirsII12ZPY0m/tmpu5gbPLatIt/upgrade_working_directory/system-data', u'sourcePlatform': u'Linux', u'destinationPlatform': u'Linux', u'sourceManagementPort': 443, u'sourceManagementThumbprint': u'', u'sourceSsoVersion': u'', u'targetManagementThumbprint': u''}.
2021-07-14T03:29:25.7Z INFO vcdb.const Configuring log folder paths in /var/log/vmware/upgrade
2021-07-14T03:29:25.7Z INFO vcdb.const Retrieving DB type...
2021-07-14T03:29:25.7Z INFO vcdb.const DB type retrieved: PostgreSQL
2021-07-14T03:29:25.425Z INFO vcdb.const Retrieving DB user...
2021-07-14T03:29:25.489Z INFO vcdb.const DB user retrieved: vc
2021-07-14T03:29:25.505Z INFO vcdb.const Retrieving DB password...
2021-07-14T03:29:25.605Z INFO vcdb.const DB password retrieved: ****
2021-07-14T03:29:25.621Z INFO vcdb.const Applying DBM constraints fix..
2021-07-14T03:29:25.649Z INFO vcdb.const DBM fix applied.
2021-07-14T03:29:25.656Z INFO vcdb.const Validating source embedded schema...
2021-07-14T03:30:19.395Z INFO vcdb.const Souce embedded schema validation completed.
2021-07-14T03:30:19.422Z INFO vcdb.const read_db_value: 
2021-07-14T03:30:19.422Z ERROR __main__ Upgrade Phase 'vcdb:CollectRequirements' failed. Exception: could not convert string to float: 
Traceback (most recent call last):
  File "/tmp/vmware-upgrade-temp-dirsII12ZPY0m/tmpu5gbPLatIt/payload/componentPhaseLauncher.py", line 461, in main
    executionResult = systemExtension(exeContext)
  File "/tmp/vmware-upgrade-temp-dirsII12ZPY0m/tmpu5gbPLatIt/libs/sdk/extensions.py", line 94, in __call__
    result = self.extension(*args)
  File "/tmp/vmware-upgrade-temp-dirsII12ZPY0m/tmpu5gbPLatIt/libs/sdk/extensions.py", line 110, in _func
    return func(*args)
  File "/tmp/vmware-upgrade-temp-dirsII12ZPY0m/tmpu5gbPLatIt/payload/component-scripts/vcdb/__init__.py", line 22, in do_collect_upgrade_requirements
    req = do_linux_collect_req(context)
  File "/tmp/vmware-upgrade-temp-dirsII12ZPY0m/tmpu5gbPLatIt/payload/component-scripts/vcdb/vcdb_collect_requirements_functions.py", line 393, in do_linux_collect_req
    size_core, size_set, size_core_et = core_set_size_postgres()
  File "/tmp/vmware-upgrade-temp-dirsII12ZPY0m/tmpu5gbPLatIt/payload/component-scripts/vcdb/vcdb_db_utils.py", line 280, in core_set_size_postgres
    size_core = num(get_psql_query_result(sql_core))
  File "/tmp/vmware-upgrade-temp-dirsII12ZPY0m/tmpu5gbPLatIt/payload/component-scripts/vcdb/vcdb_db_utils.py", line 46, in num
    return float(str_num)
ValueError: could not convert string to float: 

 

 

 

Reply
0 Kudos
1 Solution

Accepted Solutions
Ferozrah
VMware Employee
VMware Employee
Jump to solution

Hi,

Thank you for your reply.

Could you please remove .pgpass file that you have created and recreate it following the below given procedure:

Note: Take Snapshot of Source vCenter Server Appliance before proceeding with below steps.

  1. Copy PGUSER Password from the /etc/vmware-vpx/embedded_db.cfg file.

For example:

root@vcenter [ / ]# cat /etc/vmware-vpx/embedded_db.cfg | grep PGUSER_PASSWORD
PGUSER_PASSWORD='5%|=w&L?gWa>p70_'

 

2. Create the .pgpass file under /root with the new password:

  • touch /root/.pgpass
  • chmod 0600 /root/.pgpass
  • vi /root/.pgpass
  • Press Insert Key and Copy below contents to the file, replace PASSWORD with the password copied from above step and press ESC Key and wq! to exit the VI editor:

localhost:5432:postgres:postgres:PASSWORD
127.0.0.1:5432:postgres:postgres:PASSWORD
localhost:5432:VCDB:postgres:PASSWORD
127.0.0.1:5432:VCDB:postgres:PASSWORD

3.Take a copy of /storage/db/vpostgres/pg_hba.conf file:

cp /storage/db/vpostgres/pg_hba.conf /storage/db/vpostgres/pg_hba.conf_backup
 
4. Edit the /storage/db/vpostgres/pg_hba.conf file using VI editor and change md5 to trust for below values:
# TYPE  DATABASE        USER            ADDRESS                 METHOD
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
 
4. Save and close the pg_hba.conf file.
 
5. Stop and Start vPostgres service for the changes to be effective:
service-control --stop vmware-vpostgres
service-control --start vmware-vpostgres
 
6. Connect to the database as a postgres user. It does not ask for a password because we have changed the method in pg_hba.conf file to trust:
/opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres
 
7. Change the postgres user password with the password copied from the first step (from file /etc/vmware-vpx/embedded_db.cfg😞
ALTER USER postgres PASSWORD 'new_password';
\q (to exit from postgres)
 
8. Revert the changes made on pg_ha.conf file, edit /storage/db/vpostgres/pg_hba.conf using VI editor and change trust to md5 for below values:
# TYPE  DATABASE        USER            ADDRESS                 METHOD
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
# IPv6 local connections:
host    all             all             ::1/128                 trust
 
9. Save and close the pg_hba.conf file.
 
10. Stop and Start vPostgres service for the changes to be effective:
service-control --stop vmware-vpostgres
service-control --start vmware-vpostgres
 
11. Connect to the database as a postgres user to verify the new password. If password is set properly, it will not ask for a password as it will take the password from .pgpass file:
/opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres
\q (to exit from postgres)
 
12. Continue with the upgrade process.

View solution in original post

Reply
0 Kudos
5 Replies
Ferozrah
VMware Employee
VMware Employee
Jump to solution

Hi,

Greetings for the day.

Thank you for posting your query.

With respect to the error and log snippet posted I would request you to please validate if .pgpass is present.

To validate:

  1. Login to Source VCSA using SSH.
  2. Execute the command ls /root/ -larth to verify the file presence.

If the file is not present we need to create that file manually and then attempt upgrade again.

 

Regards

Feroz Rah

Install Upgrade Specialist

"Did you find this helpful? Let us know by completing this survey (takes 1 minute!)"

 

Reply
0 Kudos
leshe
Contributor
Contributor
Jump to solution

Hi

Thanks for the quick reply.

I have checked the file  .pgpass  does indeed not present.

After we create that file manually and attempt to upgrade again.

the error still remains.

Reply
0 Kudos
Ferozrah
VMware Employee
VMware Employee
Jump to solution

Hi,

Thank you for your reply.

Could you please remove .pgpass file that you have created and recreate it following the below given procedure:

Note: Take Snapshot of Source vCenter Server Appliance before proceeding with below steps.

  1. Copy PGUSER Password from the /etc/vmware-vpx/embedded_db.cfg file.

For example:

root@vcenter [ / ]# cat /etc/vmware-vpx/embedded_db.cfg | grep PGUSER_PASSWORD
PGUSER_PASSWORD='5%|=w&L?gWa>p70_'

 

2. Create the .pgpass file under /root with the new password:

  • touch /root/.pgpass
  • chmod 0600 /root/.pgpass
  • vi /root/.pgpass
  • Press Insert Key and Copy below contents to the file, replace PASSWORD with the password copied from above step and press ESC Key and wq! to exit the VI editor:

localhost:5432:postgres:postgres:PASSWORD
127.0.0.1:5432:postgres:postgres:PASSWORD
localhost:5432:VCDB:postgres:PASSWORD
127.0.0.1:5432:VCDB:postgres:PASSWORD

3.Take a copy of /storage/db/vpostgres/pg_hba.conf file:

cp /storage/db/vpostgres/pg_hba.conf /storage/db/vpostgres/pg_hba.conf_backup
 
4. Edit the /storage/db/vpostgres/pg_hba.conf file using VI editor and change md5 to trust for below values:
# TYPE  DATABASE        USER            ADDRESS                 METHOD
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
 
4. Save and close the pg_hba.conf file.
 
5. Stop and Start vPostgres service for the changes to be effective:
service-control --stop vmware-vpostgres
service-control --start vmware-vpostgres
 
6. Connect to the database as a postgres user. It does not ask for a password because we have changed the method in pg_hba.conf file to trust:
/opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres
 
7. Change the postgres user password with the password copied from the first step (from file /etc/vmware-vpx/embedded_db.cfg😞
ALTER USER postgres PASSWORD 'new_password';
\q (to exit from postgres)
 
8. Revert the changes made on pg_ha.conf file, edit /storage/db/vpostgres/pg_hba.conf using VI editor and change trust to md5 for below values:
# TYPE  DATABASE        USER            ADDRESS                 METHOD
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
# IPv6 local connections:
host    all             all             ::1/128                 trust
 
9. Save and close the pg_hba.conf file.
 
10. Stop and Start vPostgres service for the changes to be effective:
service-control --stop vmware-vpostgres
service-control --start vmware-vpostgres
 
11. Connect to the database as a postgres user to verify the new password. If password is set properly, it will not ask for a password as it will take the password from .pgpass file:
/opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres
\q (to exit from postgres)
 
12. Continue with the upgrade process.
Reply
0 Kudos
leshe
Contributor
Contributor
Jump to solution

After completing what you posted. We encountered a new error.

1.png

2.png

Encountered an internal error. Traceback (most recent call last): File "/usr/lib/vmware-vmafd/firstboot/vmafd-firstboot.py", line 179, in main controller.client_mode() File "/usr/lib/vmware-vmafd/firstboot/vmafd-firstboot.py", line 79, in client_mode service.client_mode() File "/usr/lib/vmware-vmafd/firstboot/identityinstall/vmafdUpgrade.py", line 267, in client_mode self.post_init() File "/usr/lib/vmware-vmafd/firstboot/identityinstall/vmafdUpgrade.py", line 252, in post_init self.set_sca_hostid() File "/usr/lib/vmware-vmafd/firstboot/identityinstall/vmafdUpgrade.py", line 40, in set_sca_hostid vmafdclient.GetMachineID()) RuntimeError: unidentifiable C++ exception

 

2021-07-17T03:05:07.119Z  vmafd-cli refresh-site-name failed
2021-07-17T03:05:07.119Z  Refreshing Site name failed with error: 9127

2021-07-17T03:05:07.159Z  Exception: Traceback (most recent call last):
  File "/usr/lib/vmware-vmafd/firstboot/vmafd-firstboot.py", line 179, in main
    controller.client_mode()
  File "/usr/lib/vmware-vmafd/firstboot/vmafd-firstboot.py", line 79, in client_mode
    service.client_mode()
  File "/usr/lib/vmware-vmafd/firstboot/identityinstall/vmafdUpgrade.py", line 267, in client_mode
    self.post_init()
  File "/usr/lib/vmware-vmafd/firstboot/identityinstall/vmafdUpgrade.py", line 252, in post_init
    self.set_sca_hostid()
  File "/usr/lib/vmware-vmafd/firstboot/identityinstall/vmafdUpgrade.py", line 40, in set_sca_hostid
    vmafdclient.GetMachineID())
RuntimeError: unidentifiable C++ exception

 

Reply
0 Kudos
leshe
Contributor
Contributor
Jump to solution

Hi

we have successfully upgraded. 

The ACL configuration on the DNS Server that we did not aware of was causing the new issue.

Thank you very much for your assistance.