vcf-sos.log and /var/log/messages files, potentially exhausting space on the root disk partition (/).systemctl status sosrest.service -l reports a sqlite3.DatabaseError: database disk image is malformed error:orsosrest.service - VMware Cloud Foundation Supportability and Serviceability(SoS) ServiceLoaded: loaded (/etc/systemd/system/sosrest.service; enabled; vendor preset: enabled)Active: active (running) since ######## UTC; # days agoMain PID: ### (sosrest)YYYY-MM-DDT HH:MM:SS sosrest[##]: framework.dbinterface.db_api.DBException: DatabaseError('(sqlite3.DatabaseError) database disk image is malformed')YYYY-MM-DDT HH:MM:SS sosrest[##]: During handling of the above exception, another exception occurred:YYYY-MM-DDT HH:MM:SS sosrest[##]: Traceback (most recent call last):YYYY-MM-DDT HH:MM:SS sosrest[##]: File "sosapi/controllers/statusapi2.py", line 72, in sos_statusYYYY-MM-DDT HH:MM:SS sosrest[##]: File "framework/workflowhandler.py", line 129, in get_workflow_statusYYYY-MM-DDT HH:MM:SS sosrest[##]: AssertionError: Convert from db to json failed
YYYY-MM-DDT HH:MM:SS sosrest[####]: During handling of the above exception, another exception occurred:YYYY-MM-DDT HH:MM:SS sosrest[####]: Traceback (most recent call last):YYYY-MM-DDT HH:MM:SS sosrest[####]: File "framework/workflowhandler.py", line 154, in get_workflow_statusYYYY-MM-DDT HH:MM:SS sosrest[####]: File "framework/dbinterface/db_api.py", line 415, in db_to_jsonYYYY-MM-DDT HH:MM:SS sosrest[####]: framework.dbinterface.db_api.DBException: Converting from db to json failed
/var/log/vmware/vcf/sddc-support/vcf-sos.log:YYYY-MM-DDT HH:MM:SS ERROR [vcf_sos] [db_api.py::return_a_session::##::MainThread] DB commit failed
YYYY-MM-DDT HH:MM:SS ERROR [vcf_sos] [db_api.py::db_to_json::###::MainThread] Converting to JSON from db failed
YYYY-MM-DDT HH:MM:SS sqlite3.DatabaseError: database disk image is malformed
YYYY-MM-DDT HH:MM:SS framework.dbinterface.db_api.DBException: Upserting Json to DB failedThe issue is typically caused by corruption within the SOS service database or temporary JSON files. This can occur if:
Required files for the sosrest service become out of sync.
A disk partition on the SDDC appliance becomes full.
A storage event occurs while the service is writing data.
The sos service was forcefully stopped or restarted during an active operation.
Note: This procedure will remove the Backup history and SOS Health Check history from the SDDC Manager UI. Ensure a Cold snapshot of the SDDC Manager is taken before proceeding.
su -systemctl stop sosrest.service3.Relocate the corrupted database and temporary status files to a backup directory
mv /opt/vmware/vcf/sddc-support/soservice.db /home/vcfmv /opt/vmware/vcf/sddc-support/status.json /home/vcf mv /opt/vmware/vcf/sddc-support/.status-tmp.json /home/vcf4.Clear the SOS-related tasks from the Task Aggregator database:
For VCF 5.1.1 and higher:
/usr/pgsql/13/bin/psql -h localhost -U postgres -d platform -c "delete from task_metadata where task_url like '%sos%'"/usr/pgsql/13/bin/psql -h localhost -U postgres -d platform -c "delete from task_metadata where task_type='SDDCMANAGER_BACKUP'" For VCF 5.1.0 and lower:
psql -h localhost -U postgres -d platform -c "delete from task_metadata where task_url like '%sos%'" psql -h localhost -U postgres -d platform -c "delete from task_metadata where task_type='SDDCMANAGER_BACKUP'"5.Restart the sosrest service:
systemctl start sosrest.service
sosrest.service does not start successfully, the following KB may be applicable: sosrest.service is not starting in SDDC after trying to reset the sosservice.db6.Restart all SDDC services to synchronize the UI:
/opt/vmware/vcf/operationsmanager/scripts/cli/sddcmanager_restart_services.sh
7.Log in to the SDDC Manager UI and verify that "Fetching Task" entries have resolved and the dashboard is functional.
sosrest.service is not starting in SDDC after trying to reset the sosservice.dbIf stale tasks remain after following the above attempt script removal as detailed in following: