Fetal Server Error after moving from one CB version to another

Problem 

When you successfully moved your database from 8.x to 9.x, you may see a generic server error upon login to the CloudBolt login page. The error would be presented as:

The /var/log/httpd/ssl_error.log, would present a similar migration error as:

django.db.utils.OperationalError: (1054, "Unknown column 'utilities_globalpreferences.show_video_tips' in 'field list'")

Cause

Your CB database schema is missing a migration. This has also been seen when running the CloudBolt upgrader so you may have to run the migration process manually and run the upgrade again.

Solution

Overview

Below are some steps to follow depending on the specific error message you receive. First off you will need to ensure you have run the database migration. If you still see very specific error messages around for example:

  • Portals

  • Accounts

Then you will have to run the migration for the failing component.

Ensure you have completed the Database migration steps of the upgrade process

  1. Follow the Run Django Database Migrations step in the Upgrading to 9.X documentation
    https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/upgrading-to-9-x/a/h2__1646278176
    You may have to follow the manual migrate if an upgrade fails and then try the upgrade again.

If your export included a database dump and load, you will need to run database migrations. This is because the database on your new CloudBolt 9.X instance will be in the exact same state as the database on your CloudBolt 8.X instance, but the CloudBolt 9.X instance will have code and schema changes that the CloudBolt 8.X instance lacks.

Fortunately, running Django database migrations is straightforward.

  1. Log in to your CloudBolt 9.X machine.

  2. Run the Django migration management command python /opt/cloudbolt/manage.py migrate. /opt/cloudbolt/ is the default directory for CloudBolt, but your root CloudBolt directory could be somewhere else.

  3. Wait for the migrations to complete, then restart httpd systemctl restart httpd.

If you have already done the above and you received an error message specific to a section. Then keep following on.


Running the migration for a failing component

  1. If you have run the migration and have come across a specific component failure. Then you can run the migration for just that component.

  2. SSH into your CloudBolt server if you have not already and run the following command

    /opt/cloudbolt/manage.py migrate <Failing Component>
  3. Replace <Failing Component> with the error message, for this example it is Portals

    /opt/cloudbolt/manage.py migrate accounts

  4. Once this migration completes, re run the complete migration.

    /opt/cloudbolt/manage.py migrate

  5. If step 4 still has a failure, repeat step 3 for the noted failing component then step 4 again. Continue to repeat until step 4 runs without any failures.

Additional information

https://docs.djangoproject.com/en/3.2/topics/migrations/


Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.