SolusVM 2 update fails: ERROR: constraint \"compute_resource_vms_storage_id_foreign\" of relation \"compute_resource_vms\" does not exist

Have more questions? Submit a request

Applicable to:

  • SolusVM 2

Symptoms 

  • SolusVM 2 update fails:

    SVM_ERROR: Failed to download update

  • The following error is in the log file /var/log/solus/installer.log on Management node:

    CONFIG_TEXT: ERROR: constraint \"compute_resource_vms_storage_id_foreign\" of relation \"compute_resource_vms\" does not exist

Cause

Database inconsistency.

Resolution

  1. Connect to Management node via SSH
  2. Create Management node backup:

    # /usr/local/solus/bin/installer -backup

  3. Access database:

    # docker exec -it $(docker ps -q -f name=solus_postgres | head -n1) psql -U$(docker exec $(docker ps -q -f name=solus_postgres | head -n1) env | grep POSTGRES_USER | awk -F "=" {'print $2'}) $(docker exec $(docker ps -q -f name=solus_postgres | head -n1) env | grep POSTGRES_DB | awk -F "=" {'print $2'})

  4. Add the missing indexes:

    MYSQL_LIN: ALTER TABLE compute_resource_vms ADD CONSTRAINT "compute_resource_vms_storage_id_foreign" FOREIGN KEY (storage_id) REFERENCES storages(id) ON UPDATE CASCADE ON DELETE SET NULL;

Articles in this section

Was this article helpful?
0 out of 0 found this helpful
Share

Comments

0 comments

Please sign in to leave a comment.