inventree / InvenTree

Open Source Inventory Management System
https://docs.inventree.org
MIT License
4.32k stars 781 forks source link

Reverting to an older Version did end up in al lot of error messages. #7893

Closed PrintINGU closed 2 months ago

PrintINGU commented 3 months ago

Deployment Method

Describe the problem*

Firstly I am not shure if this is a install problem or a bug. I'm sorry if I used the wrong tag.

Last week I wanted to upgrade the system as usual. Intended upgrade was from 0.15.7 to 0.15.8 but the system automaticly updated to 0.16.dev (I did not remember the exact wording, maybe it was 0.16dev or 0.16 dev) with the INVENTREE_TAG=stable. No errors and the system worked. But I wanted no development version in my production environment, so I reverted manualy to 0.15.8 (via INVENTREE_TAG=0.15.8 in .env file). But I got a lot of error messages while the database upgrade (command: docker compose run --rm inventree-server invoke update). Relevant log output at the end.

Afterwards the system was usable and on the first look everything was okay. But after a few days of usage a lot of error messages apeared: Error_msg_inventree

I tried to reinstall inventree on another container and import the userdata but the same error messages appeard. In the second try I reinstalled inventree and copied the userdata exept the pgdb folder and tried to migrate the database without success. Then I tried to migrate the Database with invoke export-records -f data.json but it also failed with the following error: /root/.local/lib/python3.11/site-packages/allauth/exceptions.py:9: UserWarning: allauth.exceptions is deprecated, use allauth.core.exceptions warnings.warn("allauth.exceptions is deprecated, use allauth.core.exceptions") CommandError: Unable to serialize database: relation "report_testreport" does not exist LINE 1: SELECT COUNT(*) AS "__count" FROM "report_testreport"

Than I noticed that 2 of 22 scheduled tasks failed: Scheduled_tasks_inventree Last run of both failed tasks: delaware-pip-kentucky-cola zebra-golf-quebec-bacon

I think there is something wrong with the database but I don't know how to fix it.

My last resort would be to restore an old backup. But a lot of entrys in between would be lost.

Has somebody an idea how to fix this? Is it even a good idea to go back to older versions?

Steps to Reproduce

  1. Used official instructions for upgrading. INVENTREE_TAG=stable. Intended upgrade: 0.15.7 to 0.15.8.
  2. System automaticly upgraded to 0.16.dev (I think there was a wrong release in the master at that time)
  3. Manualy changed the INVENTREE_Tag in .env file to 0.15.8 and updated.
  4. Error messages after database upgrade.
  5. System works partialy stable.

Relevant log output

Failed to query report for 'report/inventree/test/inventree_test_report.html' - you should run 'invoke update' first!
Traceback (most recent call last):
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
psycopg.errors.UndefinedTable: relation "report_testreport" does not exist
LINE 1: SELECT 1 AS "a" FROM "report_testreport" WHERE "report_testr...
                             ^

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/inventree/src/backend/InvenTree/generic/templating/apps.py", line 118, in create_template_file
    if model.objects.filter(**{self.db: filename}).exists():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/query.py", line 1241, in exists
    return self.query.has_results(using=self.db)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/query.py", line 598, in has_results
    return compiler.has_results()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1530, in has_results
    return bool(self.execute_sql(SINGLE))
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1562, in execute_sql
    cursor.execute(sql, params)
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 102, in execute
    return super().execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
    return executor(sql, params, many, context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 84, in _execute
    with self.db.wrap_database_errors:
  File "/root/.local/lib/python3.11/site-packages/django/db/utils.py", line 91, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
django.db.utils.ProgrammingError: relation "report_testreport" does not exist
LINE 1: SELECT 1 AS "a" FROM "report_testreport" WHERE "report_testr...
                             ^
Creating entry for <class 'report.models.TestReport'> 'InvenTree Test Report'
Checking plugin registry hash
Failed to create report 'InvenTree Test Report' with error 'relation "report_testreport" does not exist
LINE 1: INSERT INTO "report_testreport" ("metadata", "name", "templa...
                    ^'
Failed to query report for 'report/inventree/build/inventree_build_order.html' - you should run 'invoke update' first!
Traceback (most recent call last):
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
psycopg.errors.UndefinedTable: relation "report_buildreport" does not exist
LINE 1: SELECT 1 AS "a" FROM "report_buildreport" WHERE "report_buil...
                             ^

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/inventree/src/backend/InvenTree/generic/templating/apps.py", line 118, in create_template_file
    if model.objects.filter(**{self.db: filename}).exists():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/query.py", line 1241, in exists
    return self.query.has_results(using=self.db)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/query.py", line 598, in has_results
    return compiler.has_results()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1530, in has_results
    return bool(self.execute_sql(SINGLE))
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1562, in execute_sql
    cursor.execute(sql, params)
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 102, in execute
    return super().execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
    return executor(sql, params, many, context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 84, in _execute
    with self.db.wrap_database_errors:
  File "/root/.local/lib/python3.11/site-packages/django/db/utils.py", line 91, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
django.db.utils.ProgrammingError: relation "report_buildreport" does not exist
LINE 1: SELECT 1 AS "a" FROM "report_buildreport" WHERE "report_buil...
                             ^
Creating entry for <class 'report.models.BuildReport'> 'InvenTree Build Order'
Checking plugin registry hash
Failed to create report 'InvenTree Build Order' with error 'relation "report_buildreport" does not exist
LINE 1: INSERT INTO "report_buildreport" ("metadata", "name", "templ...
                    ^'
Hash differs for 'report/inventree/bom/inventree_bill_of_materials_report.html'
Copying report template 'report/inventree/bom/inventree_bill_of_materials_report.html'
Failed to query report for 'report/inventree/bom/inventree_bill_of_materials_report.html' - you should run 'invoke update' first!
Traceback (most recent call last):
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
psycopg.errors.UndefinedTable: relation "report_billofmaterialsreport" does not exist
LINE 1: SELECT 1 AS "a" FROM "report_billofmaterialsreport" WHERE "r...
                             ^

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/inventree/src/backend/InvenTree/generic/templating/apps.py", line 118, in create_template_file
    if model.objects.filter(**{self.db: filename}).exists():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/query.py", line 1241, in exists
    return self.query.has_results(using=self.db)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/query.py", line 598, in has_results
    return compiler.has_results()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1530, in has_results
    return bool(self.execute_sql(SINGLE))
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1562, in execute_sql
    cursor.execute(sql, params)
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 102, in execute
    return super().execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
    return executor(sql, params, many, context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 84, in _execute
    with self.db.wrap_database_errors:
  File "/root/.local/lib/python3.11/site-packages/django/db/utils.py", line 91, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
django.db.utils.ProgrammingError: relation "report_billofmaterialsreport" does not exist
LINE 1: SELECT 1 AS "a" FROM "report_billofmaterialsreport" WHERE "r...
                             ^
Creating entry for <class 'report.models.BillOfMaterialsReport'> 'Bill of Materials'
Checking plugin registry hash
Failed to create report 'Bill of Materials' with error 'relation "report_billofmaterialsreport" does not exist
LINE 1: INSERT INTO "report_billofmaterialsreport" ("metadata", "nam...
                    ^'
Failed to query report for 'report/inventree/purchaseorder/inventree_po_report.html' - you should run 'invoke update' first!
Traceback (most recent call last):
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
psycopg.errors.UndefinedTable: relation "report_purchaseorderreport" does not exist
LINE 1: SELECT 1 AS "a" FROM "report_purchaseorderreport" WHERE "rep...
                             ^

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/inventree/src/backend/InvenTree/generic/templating/apps.py", line 118, in create_template_file
    if model.objects.filter(**{self.db: filename}).exists():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/query.py", line 1241, in exists
    return self.query.has_results(using=self.db)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/query.py", line 598, in has_results
    return compiler.has_results()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1530, in has_results
    return bool(self.execute_sql(SINGLE))
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1562, in execute_sql
    cursor.execute(sql, params)
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 102, in execute
    return super().execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
    return executor(sql, params, many, context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 84, in _execute
    with self.db.wrap_database_errors:
  File "/root/.local/lib/python3.11/site-packages/django/db/utils.py", line 91, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
django.db.utils.ProgrammingError: relation "report_purchaseorderreport" does not exist
LINE 1: SELECT 1 AS "a" FROM "report_purchaseorderreport" WHERE "rep...
                             ^
Creating entry for <class 'report.models.PurchaseOrderReport'> 'InvenTree Purchase Order'
Checking plugin registry hash
Failed to create report 'InvenTree Purchase Order' with error 'relation "report_purchaseorderreport" does not exist
LINE 1: INSERT INTO "report_purchaseorderreport" ("metadata", "name"...
                    ^'
Failed to query report for 'report/inventree/salesorder/inventree_so_report.html' - you should run 'invoke update' first!
Traceback (most recent call last):
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
psycopg.errors.UndefinedTable: relation "report_salesorderreport" does not exist
LINE 1: SELECT 1 AS "a" FROM "report_salesorderreport" WHERE "report...
                             ^

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/inventree/src/backend/InvenTree/generic/templating/apps.py", line 118, in create_template_file
    if model.objects.filter(**{self.db: filename}).exists():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/query.py", line 1241, in exists
    return self.query.has_results(using=self.db)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/query.py", line 598, in has_results
    return compiler.has_results()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1530, in has_results
    return bool(self.execute_sql(SINGLE))
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1562, in execute_sql
    cursor.execute(sql, params)
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 102, in execute
    return super().execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
    return executor(sql, params, many, context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 84, in _execute
    with self.db.wrap_database_errors:
  File "/root/.local/lib/python3.11/site-packages/django/db/utils.py", line 91, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
django.db.utils.ProgrammingError: relation "report_salesorderreport" does not exist
LINE 1: SELECT 1 AS "a" FROM "report_salesorderreport" WHERE "report...
                             ^
Creating entry for <class 'report.models.SalesOrderReport'> 'InvenTree Sales Order'
Checking plugin registry hash
Failed to create report 'InvenTree Sales Order' with error 'relation "report_salesorderreport" does not exist
LINE 1: INSERT INTO "report_salesorderreport" ("metadata", "name", "...
                    ^'
Failed to query report for 'report/inventree/returnorder/inventree_return_order_report.html' - you should run 'invoke update' first!
Traceback (most recent call last):
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
psycopg.errors.UndefinedTable: relation "report_returnorderreport" does not exist
LINE 1: SELECT 1 AS "a" FROM "report_returnorderreport" WHERE "repor...
                             ^

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/inventree/src/backend/InvenTree/generic/templating/apps.py", line 118, in create_template_file
    if model.objects.filter(**{self.db: filename}).exists():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/query.py", line 1241, in exists
    return self.query.has_results(using=self.db)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/query.py", line 598, in has_results
    return compiler.has_results()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1530, in has_results
    return bool(self.execute_sql(SINGLE))
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1562, in execute_sql
    cursor.execute(sql, params)
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 102, in execute
    return super().execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
    return executor(sql, params, many, context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 84, in _execute
    with self.db.wrap_database_errors:
  File "/root/.local/lib/python3.11/site-packages/django/db/utils.py", line 91, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
django.db.utils.ProgrammingError: relation "report_returnorderreport" does not exist
LINE 1: SELECT 1 AS "a" FROM "report_returnorderreport" WHERE "repor...
                             ^
Creating entry for <class 'report.models.ReturnOrderReport'> 'InvenTree Return Order'
Checking plugin registry hash
Failed to create report 'InvenTree Return Order' with error 'relation "report_returnorderreport" does not exist
LINE 1: INSERT INTO "report_returnorderreport" ("metadata", "name", ...
                    ^'
Hash differs for 'report/inventree/slr/inventree_slr_report.html'
Copying report template 'report/inventree/slr/inventree_slr_report.html'
Failed to query report for 'report/inventree/slr/inventree_slr_report.html' - you should run 'invoke update' first!
Traceback (most recent call last):
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
psycopg.errors.UndefinedTable: relation "report_stocklocationreport" does not exist
LINE 1: SELECT 1 AS "a" FROM "report_stocklocationreport" WHERE "rep...
                             ^

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/inventree/src/backend/InvenTree/generic/templating/apps.py", line 118, in create_template_file
    if model.objects.filter(**{self.db: filename}).exists():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/query.py", line 1241, in exists
    return self.query.has_results(using=self.db)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/query.py", line 598, in has_results
    return compiler.has_results()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1530, in has_results
    return bool(self.execute_sql(SINGLE))
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1562, in execute_sql
    cursor.execute(sql, params)
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 102, in execute
    return super().execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
    return executor(sql, params, many, context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 84, in _execute
    with self.db.wrap_database_errors:
  File "/root/.local/lib/python3.11/site-packages/django/db/utils.py", line 91, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
django.db.utils.ProgrammingError: relation "report_stocklocationreport" does not exist
LINE 1: SELECT 1 AS "a" FROM "report_stocklocationreport" WHERE "rep...
                             ^
Creating entry for <class 'report.models.StockLocationReport'> 'InvenTree Stock Location'
Checking plugin registry hash
Failed to create report 'InvenTree Stock Location' with error 'relation "report_stocklocationreport" does not exist
LINE 1: INSERT INTO "report_stocklocationreport" ("metadata", "name"...
                    ^'
Setting maintenance mode state: False
Event triggered: 'common_inventreesetting.saved'
Enqueued [InvenTree] 197349
Pushed ('arkansas-robert-social-angel', 'f84dce72aa27407780380d79ad09ac0d')
Saving setting 'InvenTreeSetting:_MAINTENANCE_MODE' to cache
Setting maintenance mode state: False
Event triggered: 'common_inventreesetting.saved'
Enqueued [InvenTree] 197350
Pushed ('indigo-echo-rugby-batman', 'e757dd091a004c6f9b09250abbacd5d0')
Saving setting 'InvenTreeSetting:_MAINTENANCE_MODE' to cache
Loading InvenTree machines
Collecting machine types
Found 1 machine types
Collecting machine drivers
Found 0 machine drivers
Initialized 0 machines
Starting background tasks...
Created 1 new scheduled tasks
Started 18 scheduled background tasks...
Enqueued [InvenTree] 197351
Pushed ('alanine-hawaii-fillet-cup', '69d100bab4eb494daab64b13354786da')
Collecting notification methods
Found 3 notification methods
Loaded unit registry in 0.602 s
Done activating
Finished loading plugins
Event triggered: 'plugins_loaded'
Enqueued [InvenTree] 197352
Pushed ('emma-arizona-juliet-romeo', '97c4583557694c7a86d45e6004812b12')
Plugin Registry: Loaded 10 plugins
Setting maintenance mode state: False
Event triggered: 'common_inventreesetting.saved'
Enqueued [InvenTree] 197353
Pushed ('fish-october-solar-undress', 'cd5838eb419e453b894e353c55862712')
Saving setting 'InvenTreeSetting:_MAINTENANCE_MODE' to cache
Setting maintenance mode state: True
Event triggered: 'common_inventreesetting.saved'
Enqueued [InvenTree] 197354
Pushed ('connecticut-pennsylvania-nebraska-green', 'f2f1b8970c8641658265e494842c4eb0')
Saving setting 'InvenTreeSetting:_MAINTENANCE_MODE' to cache
Setting maintenance mode state: False
Event triggered: 'common_inventreesetting.saved'
Enqueued [InvenTree] 197355
Pushed ('shade-lactose-three-skylark', '1414bd79fd474e80bdc95df683cd8206')
Saving setting 'InvenTreeSetting:_MAINTENANCE_MODE' to cache
Setting maintenance mode state: False
Event triggered: 'common_inventreesetting.saved'
Enqueued [InvenTree] 197356
Pushed ('alabama-july-potato-three', '1ed45f9450a84dd88d7e81c098425b5e')
Saving setting 'InvenTreeSetting:_MAINTENANCE_MODE' to cache
Setting maintenance mode state: True
Event triggered: 'common_inventreesetting.saved'
Enqueued [InvenTree] 197357
Pushed ('happy-minnesota-xray-colorado', '4e5985cb9bde4f819a06b2d5a48c2426')
Saving setting 'InvenTreeSetting:_MAINTENANCE_MODE' to cache
Failed to query report for 'report/inventree/test/inventree_test_report.html' - you should run 'invoke update' first!
Traceback (most recent call last):
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
psycopg.errors.UndefinedTable: relation "report_testreport" does not exist
LINE 1: SELECT 1 AS "a" FROM "report_testreport" WHERE "report_testr...
                             ^

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/inventree/src/backend/InvenTree/generic/templating/apps.py", line 118, in create_template_file
    if model.objects.filter(**{self.db: filename}).exists():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/query.py", line 1241, in exists
    return self.query.has_results(using=self.db)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/query.py", line 598, in has_results
    return compiler.has_results()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1530, in has_results
    return bool(self.execute_sql(SINGLE))
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1562, in execute_sql
    cursor.execute(sql, params)
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 102, in execute
    return super().execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
    return executor(sql, params, many, context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 84, in _execute
    with self.db.wrap_database_errors:
  File "/root/.local/lib/python3.11/site-packages/django/db/utils.py", line 91, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
django.db.utils.ProgrammingError: relation "report_testreport" does not exist
LINE 1: SELECT 1 AS "a" FROM "report_testreport" WHERE "report_testr...
                             ^
Creating entry for <class 'report.models.TestReport'> 'InvenTree Test Report'
Checking plugin registry hash
Failed to create report 'InvenTree Test Report' with error 'relation "report_testreport" does not exist
LINE 1: INSERT INTO "report_testreport" ("metadata", "name", "templa...
                    ^'
Failed to query report for 'report/inventree/build/inventree_build_order.html' - you should run 'invoke update' first!
Traceback (most recent call last):
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
psycopg.errors.UndefinedTable: relation "report_buildreport" does not exist
LINE 1: SELECT 1 AS "a" FROM "report_buildreport" WHERE "report_buil...
                             ^

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/inventree/src/backend/InvenTree/generic/templating/apps.py", line 118, in create_template_file
    if model.objects.filter(**{self.db: filename}).exists():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/query.py", line 1241, in exists
    return self.query.has_results(using=self.db)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/query.py", line 598, in has_results
    return compiler.has_results()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1530, in has_results
    return bool(self.execute_sql(SINGLE))
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1562, in execute_sql
    cursor.execute(sql, params)
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 102, in execute
    return super().execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
    return executor(sql, params, many, context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 84, in _execute
    with self.db.wrap_database_errors:
  File "/root/.local/lib/python3.11/site-packages/django/db/utils.py", line 91, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
django.db.utils.ProgrammingError: relation "report_buildreport" does not exist
LINE 1: SELECT 1 AS "a" FROM "report_buildreport" WHERE "report_buil...
                             ^
Creating entry for <class 'report.models.BuildReport'> 'InvenTree Build Order'
Checking plugin registry hash
Failed to create report 'InvenTree Build Order' with error 'relation "report_buildreport" does not exist
LINE 1: INSERT INTO "report_buildreport" ("metadata", "name", "templ...
                    ^'
Hash differs for 'report/inventree/bom/inventree_bill_of_materials_report.html'
Copying report template 'report/inventree/bom/inventree_bill_of_materials_report.html'
Failed to query report for 'report/inventree/bom/inventree_bill_of_materials_report.html' - you should run 'invoke update' first!
Traceback (most recent call last):
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
psycopg.errors.UndefinedTable: relation "report_billofmaterialsreport" does not exist
LINE 1: SELECT 1 AS "a" FROM "report_billofmaterialsreport" WHERE "r...
                             ^

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/inventree/src/backend/InvenTree/generic/templating/apps.py", line 118, in create_template_file
    if model.objects.filter(**{self.db: filename}).exists():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/query.py", line 1241, in exists
    return self.query.has_results(using=self.db)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/query.py", line 598, in has_results
    return compiler.has_results()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1530, in has_results
    return bool(self.execute_sql(SINGLE))
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1562, in execute_sql
    cursor.execute(sql, params)
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 102, in execute
    return super().execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
    return executor(sql, params, many, context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 84, in _execute
    with self.db.wrap_database_errors:
  File "/root/.local/lib/python3.11/site-packages/django/db/utils.py", line 91, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
django.db.utils.ProgrammingError: relation "report_billofmaterialsreport" does not exist
LINE 1: SELECT 1 AS "a" FROM "report_billofmaterialsreport" WHERE "r...
                             ^
Creating entry for <class 'report.models.BillOfMaterialsReport'> 'Bill of Materials'
Checking plugin registry hash
Failed to create report 'Bill of Materials' with error 'relation "report_billofmaterialsreport" does not exist
LINE 1: INSERT INTO "report_billofmaterialsreport" ("metadata", "nam...
                    ^'
Failed to query report for 'report/inventree/purchaseorder/inventree_po_report.html' - you should run 'invoke update' first!
Traceback (most recent call last):
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
psycopg.errors.UndefinedTable: relation "report_purchaseorderreport" does not exist
LINE 1: SELECT 1 AS "a" FROM "report_purchaseorderreport" WHERE "rep...
                             ^

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/inventree/src/backend/InvenTree/generic/templating/apps.py", line 118, in create_template_file
    if model.objects.filter(**{self.db: filename}).exists():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/query.py", line 1241, in exists
    return self.query.has_results(using=self.db)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/query.py", line 598, in has_results
    return compiler.has_results()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1530, in has_results
    return bool(self.execute_sql(SINGLE))
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1562, in execute_sql
    cursor.execute(sql, params)
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 102, in execute
    return super().execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
    return executor(sql, params, many, context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 84, in _execute
    with self.db.wrap_database_errors:
  File "/root/.local/lib/python3.11/site-packages/django/db/utils.py", line 91, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
django.db.utils.ProgrammingError: relation "report_purchaseorderreport" does not exist
LINE 1: SELECT 1 AS "a" FROM "report_purchaseorderreport" WHERE "rep...
                             ^
Creating entry for <class 'report.models.PurchaseOrderReport'> 'InvenTree Purchase Order'
Checking plugin registry hash
Failed to create report 'InvenTree Purchase Order' with error 'relation "report_purchaseorderreport" does not exist
LINE 1: INSERT INTO "report_purchaseorderreport" ("metadata", "name"...
                    ^'
Failed to query report for 'report/inventree/salesorder/inventree_so_report.html' - you should run 'invoke update' first!
Traceback (most recent call last):
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
psycopg.errors.UndefinedTable: relation "report_salesorderreport" does not exist
LINE 1: SELECT 1 AS "a" FROM "report_salesorderreport" WHERE "report...
                             ^

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/inventree/src/backend/InvenTree/generic/templating/apps.py", line 118, in create_template_file
    if model.objects.filter(**{self.db: filename}).exists():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/query.py", line 1241, in exists
    return self.query.has_results(using=self.db)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/query.py", line 598, in has_results
    return compiler.has_results()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1530, in has_results
    return bool(self.execute_sql(SINGLE))
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1562, in execute_sql
    cursor.execute(sql, params)
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 102, in execute
    return super().execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
    return executor(sql, params, many, context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 84, in _execute
    with self.db.wrap_database_errors:
  File "/root/.local/lib/python3.11/site-packages/django/db/utils.py", line 91, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
django.db.utils.ProgrammingError: relation "report_salesorderreport" does not exist
LINE 1: SELECT 1 AS "a" FROM "report_salesorderreport" WHERE "report...
                             ^
Creating entry for <class 'report.models.SalesOrderReport'> 'InvenTree Sales Order'
Checking plugin registry hash
Failed to create report 'InvenTree Sales Order' with error 'relation "report_salesorderreport" does not exist
LINE 1: INSERT INTO "report_salesorderreport" ("metadata", "name", "...
                    ^'
Failed to query report for 'report/inventree/returnorder/inventree_return_order_report.html' - you should run 'invoke update' first!
Traceback (most recent call last):
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
psycopg.errors.UndefinedTable: relation "report_returnorderreport" does not exist
LINE 1: SELECT 1 AS "a" FROM "report_returnorderreport" WHERE "repor...
                             ^

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/inventree/src/backend/InvenTree/generic/templating/apps.py", line 118, in create_template_file
    if model.objects.filter(**{self.db: filename}).exists():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/query.py", line 1241, in exists
    return self.query.has_results(using=self.db)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/query.py", line 598, in has_results
    return compiler.has_results()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1530, in has_results
    return bool(self.execute_sql(SINGLE))
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1562, in execute_sql
    cursor.execute(sql, params)
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 102, in execute
    return super().execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
    return executor(sql, params, many, context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 84, in _execute
    with self.db.wrap_database_errors:
  File "/root/.local/lib/python3.11/site-packages/django/db/utils.py", line 91, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
django.db.utils.ProgrammingError: relation "report_returnorderreport" does not exist
LINE 1: SELECT 1 AS "a" FROM "report_returnorderreport" WHERE "repor...
                             ^
Creating entry for <class 'report.models.ReturnOrderReport'> 'InvenTree Return Order'
Checking plugin registry hash
Failed to create report 'InvenTree Return Order' with error 'relation "report_returnorderreport" does not exist
LINE 1: INSERT INTO "report_returnorderreport" ("metadata", "name", ...
                    ^'
Hash differs for 'report/inventree/slr/inventree_slr_report.html'
Copying report template 'report/inventree/slr/inventree_slr_report.html'
Failed to query report for 'report/inventree/slr/inventree_slr_report.html' - you should run 'invoke update' first!
Traceback (most recent call last):
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
psycopg.errors.UndefinedTable: relation "report_stocklocationreport" does not exist
LINE 1: SELECT 1 AS "a" FROM "report_stocklocationreport" WHERE "rep...
                             ^

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/inventree/src/backend/InvenTree/generic/templating/apps.py", line 118, in create_template_file
    if model.objects.filter(**{self.db: filename}).exists():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/query.py", line 1241, in exists
    return self.query.has_results(using=self.db)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/query.py", line 598, in has_results
    return compiler.has_results()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1530, in has_results
    return bool(self.execute_sql(SINGLE))
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1562, in execute_sql
    cursor.execute(sql, params)
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 102, in execute
    return super().execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
    return executor(sql, params, many, context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 84, in _execute
    with self.db.wrap_database_errors:
  File "/root/.local/lib/python3.11/site-packages/django/db/utils.py", line 91, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/root/.local/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
django.db.utils.ProgrammingError: relation "report_stocklocationreport" does not exist
LINE 1: SELECT 1 AS "a" FROM "report_stocklocationreport" WHERE "rep...
                             ^
Creating entry for <class 'report.models.StockLocationReport'> 'InvenTree Stock Location'
Checking plugin registry hash
Failed to create report 'InvenTree Stock Location' with error 'relation "report_stocklocationreport" does not exist
LINE 1: INSERT INTO "report_stocklocationreport" ("metadata", "name"...
                    ^'
SchrodingersGat commented 2 months ago

@PrintINGU it looks like the version of code you are running is now no longer "in sync" with the state of the database.

Reverting the installation back to 0.15.x does not "undo" the database changes made in 0.16.x. It will be tricky (almost impossible) to thread the needle of adjusting the database to the correct state.

Do you have a database backup from during the update process? It should have been created automatically. I would suggest:

matmair commented 2 months ago

I think the damage is probably way lower keeping on the newer version than trying to get the database migrations reversed somehow

PrintINGU commented 2 months ago

Thank you for the anwers.

My colleague somehow managed to export the current database und imported it manually into the older Version. Right now it seems to work. I can't reproduce the error messages from before. Fingers crossed.