Following an upgrade of vCenter to 8.0.3 may discover that following services are in stopped state:
NOTE: This issue may carry over to 9.x if the problem isn't fixed
vCenter VAMI backups will also fail to run due to the stopped service state.
<timestamp> PANIC vcrecoverable/vcrecoverable.go:126 Error while getting providers. {"vStats": "MVP", "PANIC": "Error while getting providers."}vstats/util/vcrecoverable.handlePanic bora/vpx/vstats/vstats-svc/src/vstats/util/vcrecoverable/vcrecoverable.go:126runtime.gopanic
<timestamp> LOG: invalid magic number 0000 in log segment xxxxxxxxx, offset yyyyy<timestamp> LOG: invalid primary checkpoint record<timestamp> PANIC: could not locate a valid checkpoint record<timestamp> LOG : startup process (PID <PID>) was terminated by signal 6 : Aborted<timestamp> LOG : database system is shutting down
VMware vCenter Server 8.0.3
VMware vCenter Server 9.x
VMware Engineering is currently investigating the issue.
Run the following commands in a ssh session to the vCenter as root
sudo -u vtsdbuser pg_resetwal -f /storage/vtsdb/vtsdbdataservice-control --restart vtsdbservice-control --restart vstatsservice-control --status/opt/vmware/vpostgres/current/bin/psql -Uvstatsuser -dvstats_db -f /usr/lib/vmware-vstats/scripts/sttdb_patch03.sql -p5433 -w -X -h/var/run/vtsdb -v ON_ERROR_STOP=ON
CREATE FUNCTION
vstats_db database is present
You are now connected to database "vstats_db" as user "vstatsuser".
SET
DO
ALTER TABLE
DO
ALTER TABLE
ALTER TABLE
service-control --start vstats
Note: If the above mentioned workaround doesn't help then proceed with the below steps.
Standard workarounds like pg_resetwal may not be sufficient if the replorigin_checkpoint file specifically is corrupted. Moving the file allows the service to bypass the magic number validation panic.
mkdir -p /var/vtsdb_backupmv /storage/vtsdb/vtsdbdata/pg_logical/replorigin_checkpoint /var/vtsdb_backup/service-control --restart vtsdbservice-control --restart vstatsservice-control --status --all