DB broken after update #4889
-
Yesterday @SchrodingersGat helped me discover a bug in my installation of 0.11.0. The installation of 0.11.0 was done with Ubuntu 22.04 LTS and the quick install is outlined on this page. https://docs.inventree.org/en/latest/start/installer/ and the install worked great and was using a sqlite3 database. Since I was told that the latest version had the bug fix I decided to try updating the install. The website https://inventree.org/ was down so I tried the master install for Ubuntu 20.04 as shown here. https://packager.io/gh/inventree/InvenTree/builds/498/install/ubuntu-20.04 I am getting a large number of Server errors. I am copying one of these errors at the end of this post. I had not finished a step to get the database Migrated correctly. I am unsure what since I that with the quick install, this happened automatically after 0.11.0. I have tried rerunning the quick install today since the site is back up, and it works; however, it says that inventree is already at the latest version regardless if I try to install stable or latest or master versions. Since I have a daily backup set, I tried to restore the last backup using the invoke restore, as shown here, https://docs.inventree.org/en/latest/start/backup/. I ran this from within the virtual environment and the /opt/inventree folder. I also can't get it to work. I am at a loss as to what to do next. Any suggestions would be very helpful. Here is an example of one Server error. Type: OperationalError File "/opt/inventree/env/lib/python3.10/site-packages/django/db/backends/utils.py", line 84, in _execute File "/opt/inventree/env/lib/python3.10/site-packages/django/db/backends/sqlite3/base.py", line 423, in execute sqlite3.OperationalError: no such column: stock_stockitem.consumed_by_id The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/opt/inventree/env/lib/python3.10/site-packages/django/core/handlers/base.py", line 181, in _get_response File "/opt/inventree/env/lib/python3.10/site-packages/django/views/generic/base.py", line 70, in view File "/opt/inventree/env/lib/python3.10/site-packages/django/contrib/auth/mixins.py", line 104, in dispatch File "/opt/inventree/env/lib/python3.10/site-packages/django/views/generic/base.py", line 98, in dispatch File "/opt/inventree/env/lib/python3.10/site-packages/django/views/generic/detail.py", line 106, in get File "/opt/inventree/env/lib/python3.10/site-packages/django/views/generic/detail.py", line 52, in get_object File "/opt/inventree/env/lib/python3.10/site-packages/django/db/models/query.py", line 431, in get File "/opt/inventree/env/lib/python3.10/site-packages/django/db/models/query.py", line 262, in len File "/opt/inventree/env/lib/python3.10/site-packages/django/db/models/query.py", line 1326, in _fetch_all File "/opt/inventree/env/lib/python3.10/site-packages/django/db/models/query.py", line 813, in _prefetch_related_objects File "/opt/inventree/env/lib/python3.10/site-packages/django/db/models/query.py", line 1730, in prefetch_related_objects File "/opt/inventree/env/lib/python3.10/site-packages/django/db/models/query.py", line 1872, in prefetch_one_level File "/opt/inventree/env/lib/python3.10/site-packages/django/db/models/query.py", line 280, in iter File "/opt/inventree/env/lib/python3.10/site-packages/django/db/models/query.py", line 1324, in _fetch_all File "/opt/inventree/env/lib/python3.10/site-packages/django/db/models/query.py", line 51, in iter File "/opt/inventree/env/lib/python3.10/site-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql File "/opt/inventree/env/lib/python3.10/site-packages/django/db/backends/utils.py", line 66, in execute File "/opt/inventree/env/lib/python3.10/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers File "/opt/inventree/env/lib/python3.10/site-packages/django/db/backends/utils.py", line 79, in _execute File "/opt/inventree/env/lib/python3.10/site-packages/django/db/utils.py", line 90, in exit File "/opt/inventree/env/lib/python3.10/site-packages/django/db/backends/utils.py", line 84, in _execute File "/opt/inventree/env/lib/python3.10/site-packages/django/db/backends/sqlite3/base.py", line 423, in execute django.db.utils.OperationalError: no such column: stock_stockitem.consumed_by_id |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
I was able to fix this finally. Steps taken. https://docs.inventree.org/en/latest/start/installer/. I followed the steps for "Manual Install" Step 1) wget -qO- https://dl.packager.io/srv/inventree/InvenTree/key | sudo apt-key add - Next, I removed inventree I was able to then able to install inventree using the Quick Script I tried removing it, and it did not work because the key was invalid. But when I followed the above steps in this order, it worked, and reindexed the database, and all is well with the world. I am back to V0.11.0. I am unsure when V0.11.1 or V0.11.2 (which has the bug fix) will be available for a stable install. I am assuming that running the quick script will update to the most recent stable version. Is this assumption correct? |
Beta Was this translation helpful? Give feedback.
I was able to fix this finally. Steps taken. https://docs.inventree.org/en/latest/start/installer/. I followed the steps for "Manual Install"
Step 1) wget -qO- https://dl.packager.io/srv/inventree/InvenTree/key | sudo apt-key add -
Step 2) sudo wget -O /etc/apt/sources.list.d/inventree.list https://dl.packager.io/srv/inventree/InvenTree/stable/installer/ubuntu/20.04.repo
Step 3) sudo apt-get update
Next, I removed inventree
Step 4) sudo apt remove inventree
I was able to then able to install inventree using the Quick Script
Step 5) wget -qO install.sh https://get.inventree.org && bash install.sh
I tried removing it, and it did not work because the key was invalid. But when I followed the …