ERPGAP Blog / What is a stable Odoo server?
What is a stable Odoo server?

What is a stable Odoo server?


No, not everybody understands the meaning and importance of a stable server.

Maintaining an ERP server requires some established procedures to ensure that the server is properly sized, properly customized, properly deployed, and has an efficient disaster recovery plan. In this article we will focus on how to correctly deploy an Odoo server. There are other important topics such as unit testing and monitoring, but we want to focus on making sure we don't have a server that logs errors while updating its modules.

Odoo manages modules and their updates to ensure the integrity and consistency of the whole system. Here's how Odoo updates a module and the role of the dependency tree in this process:

  1. Module Versioning: Each Odoo module has a version number specified in its manifest file (__manifest__.py). This helps Odoo determine if a newer version of the module is available. Odoo.sh uses version to determine if the modules need to be updated.

  2. Module Manifests: The manifest file also contains other critical information, such as dependencies, data files, and initialization scripts.

  3. Dependency Check: Before updating a module, Odoo checks the module's dependencies. If the module relies on other modules, Odoo ensures that those dependencies are satisfied and updated if necessary.

  4. Install New Version: The new version of the module is then installed. This includes:

    • Applying any new database schema changes (e.g., adding new tables or fields).
    • Executing any new or updated initialization scripts.
    • Loading new or updated data files (e.g., demo data, configuration data).
  5. Data Migration: If the update involves changes in the data structure, Odoo runs migration scripts to convert existing data to the new format. These scripts are often custom-written to handle the specific changes in the module.

Dependency Tree

The dependency tree is a critical component in the module update process. It represents the relationships and dependencies between various modules within the Odoo system. Here's how it relates to the update process:

When updating a module, Odoo uses the dependency tree to determine which other modules need to be updated first. For example, if Module A depends on Module B, Odoo will update Module B before updating Module A. By maintaining the dependency tree, Odoo ensures that the system remains consistent and that all interdependent modules are correctly updated together. This prevents situations where a module is updated, but its dependencies are not, leading to potential runtime errors or data inconsistencies.

This is an example excerpt of the dependency graph generated from Odoo update routine:

. . .
-> portal
   -> auth_totp_portal
   -> digest
      -> account
         -> account_check_printing
         -> account_edi_ubl_cii
         -> account_external_tax
            -> account_avatax
         -> account_invoice_extract
         -> account_payment
            -> sale
               -> delivery
                  -> sale_loyalty_delivery
                  -> stock_delivery
                     -> website_sale_stock
                  -> website_sale
                     -> spreadsheet_dashboard_website_sale
                     -> website_sale_dashboard
                     -> website_sale_external_tax
                     -> website_sale_loyalty
                     -> website_sale_product_configurator
                     -> website_sale_wishlist
                        -> website_sale_stock_wishlist
               -> sale_async_emails
               -> sale_crm
               -> sale_management
                  -> sale_pdf_quote_builder
               -> sale_product_configurator
               -> sale_sms
               -> sale_stock
               -> spreadsheet_dashboard_sale
            -> website_payment
         -> account_payment_term
. . .

This dependency tree can be very large, so it would be pointless to print it all here. This is just to illustrate the problem. The Odoo upgrade routines calculate the dependency graph depending on several factors and in most cases it will only update the minimal set of modules needed to apply the changes that have been added to a certain module or list of modules that have a pending "TO UPGRADE" status. Odoo.sh will add all modules that have a raised version to this list, but regardless if you are self-hosted or on Odoo.sh, this mechanism is mostly the same.

Server Stability

When deploying a new release, it is essential to ensure that all modules are updated by using the following command line parameters: -u all or -u base. This guarantees that the code base on the file system matches the Odoo database. If any ERROR messages appear in the log during this process, this indicates an unstable server that requires immediate attention. Failure to update all modules will lead to a faulty dependency state because you will end up with modules running on your server that don't have the updated records, which most often come from XML files, but even worse, they may be disconnected from newly defined methods and new module dependencies, or have migrations and hooks that failed to run.

A deployment is considered UNSTABLE if it's not possible to update all modules without errors. While the server may still be running, this state can lead to several problems. The most obvious problem is that code is only partially loaded, resulting in different versions of the code base coexisting and introducing bugs.

In addition, this unstable state makes it extremely difficult to reproduce bugs. Inconsistent code versions mean that bugs can appear randomly, complicating troubleshooting and resolution efforts. This undermines code accountability, as developers may end up blaming each other for system failures.

This problem is common in large deployments, especially in organizations with rigid hierarchies and poor communication between departments. It significantly slows progress on roadmaps, as more time is spent fixing these problems than moving forward with development. Ensuring that all modules are properly updated is critical to maintaining server stability and fostering a productive development environment.

Conclusion

Not all business owners or company managers are familiar with software development best practices, so situations like this are to be expected. Ideally, all developers should read and follow the Odoo Development Guidelines, even though minor deviations may not cause significant problems.

However, overlooking the need for a stable server can have a significant impact on overall productivity, quality and performance. Proactively addressing these issues will ensure a more reliable and efficient development process that will benefit the entire organization.



Need help with your Odoo server?


Other articles



How to install and manage Odoo modules

How to install and manage Odoo modules

How to Configure Stripe as a Payment Provider in Odoo Branches

How to Configure Stripe as a Payment Provider in Odoo Branches

What is a stable Odoo server?

What is a stable Odoo server?

About us

Odoo is a management software that fits all sizes. This software is for small, medium and large companies. Your company's information is all in one place. You don't have to go back and forth to check something. All apps have real-time access to your database.

Tags tags icon