Repository navigation
Closed
Description
Please verify that this bug has NOT been raised before.
- I checked and didn't find a similar issue
Describe the bug*
Following blogpost, https://inventree.org/blog/2026/02/12/db-update on updating from old db.
Following error on "Step 4"
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
inven@inven:~/Downloads/InvenTree-master/docker/production$ docker compose pull
[+] Running 18/18
⠿ inventree-worker Skipped - Image is already being pulled by inventree-server 0.0s
⠿ inventree-db Pulled 10.7s
⠿ 0c8d55a45c0d Already exists 0.0s
⠿ 03cf9c337134 Already exists 0.0s
⠿ d64dbdf800a2 Already exists 0.0s
⠿ 2710e764d89a Already exists 0.0s
⠿ c50a02fe2f5f Already exists 0.0s
⠿ 0ace4c983c3e Already exists 0.0s
⠿ b64f280cfa2b Already exists 0.0s
⠿ ea5e741a30ce Already exists 0.0s
⠿ 9dbecdc32213 Pull complete 8.6s
⠿ d76758f883b9 Pull complete 8.7s
⠿ 6596dc1aad70 Pull complete 8.7s
⠿ 56c3f259691b Pull complete 8.7s
⠿ 07a1bc62b3b0 Pull complete 8.8s
⠿ 8cced4a98c7e Pull complete 8.8s
⠿ inventree-server Pulled 1.1s
⠿ inventree-proxy Pulled 1.0s
inven@inven:~/Downloads/InvenTree-master/docker/production$ docker compose run --rm inventree-server invoke migrate
[+] Running 1/1
⠿ Container inventree-db Recreated 0.1s
[+] Running 1/1
⠿ Container inventree-db Started 0.2s
Loading config file : /home/inventree/data/config.yaml
Running InvenTree database migrations...
INVE-W3: Could not detect git information.
Python version 3.11.13 - /usr/local/bin/python3
/root/.local/lib/python3.11/site-packages/django/core/management/commands/makemigrations.py:160: RuntimeWarning: Got an error checking a consistent migration history performed for database connection 'default': [Errno -3] Temporary failure in name resolution
warnings.warn(
No changes detected
INVE-W3: Could not detect git information.
Python version 3.11.13 - /usr/local/bin/python3
INVE-W3: Could not detect git information.
Python version 3.11.13 - /usr/local/bin/python3
Traceback (most recent call last):
File "/root/.local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 288, in ensure_connection
self.connect()
File "/root/.local/lib/python3.11/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 269, in connect
self.connection = self.get_new_connection(conn_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/django/db/backends/postgresql/base.py", line 275, in get_new_connection
connection = self.Database.connect(**conn_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/psycopg/connection.py", line 98, in connect
attempts = conninfo_attempts(params)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/psycopg/_conninfo_attempts.py", line 53, in conninfo_attempts
raise e.OperationalError(str(last_exc))
psycopg.OperationalError: [Errno -3] Temporary failure in name resolution
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/inventree/src/backend/InvenTree/manage.py", line 24, in <module>
main()
File "/home/inventree/src/backend/InvenTree/manage.py", line 20, in main
execute_from_command_line(sys.argv)
File "/root/.local/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
utility.execute()
File "/root/.local/lib/python3.11/site-packages/django/core/management/__init__.py", line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/root/.local/lib/python3.11/site-packages/django/core/management/base.py", line 412, in run_from_argv
self.execute(*args, **cmd_options)
File "/root/.local/lib/python3.11/site-packages/django/core/management/base.py", line 458, in execute
output = self.handle(*args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/django/core/management/base.py", line 106, in wrapper
res = handle_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/django/core/management/commands/migrate.py", line 117, in handle
executor = MigrationExecutor(connection, self.migration_progress_callback)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/django/db/migrations/executor.py", line 18, in __init__
self.loader = MigrationLoader(self.connection)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/django/db/migrations/loader.py", line 58, in __init__
self.build_graph()
File "/root/.local/lib/python3.11/site-packages/django/db/migrations/loader.py", line 235, in build_graph
self.applied_migrations = recorder.applied_migrations()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/django/db/migrations/recorder.py", line 81, in applied_migrations
if self.has_table():
^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/django/db/migrations/recorder.py", line 57, in has_table
with self.connection.cursor() as cursor:
^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 329, in cursor
return self._cursor()
^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 305, in _cursor
self.ensure_connection()
File "/root/.local/lib/python3.11/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 287, in ensure_connection
with self.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/base/base.py", line 288, in ensure_connection
self.connect()
File "/root/.local/lib/python3.11/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 269, in connect
self.connection = self.get_new_connection(conn_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/django/db/backends/postgresql/base.py", line 275, in get_new_connection
connection = self.Database.connect(**conn_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/psycopg/connection.py", line 98, in connect
attempts = conninfo_attempts(params)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/psycopg/_conninfo_attempts.py", line 53, in conninfo_attempts
raise e.OperationalError(str(last_exc))
django.db.utils.OperationalError: [Errno -3] Temporary failure in name resolution
ERROR: InvenTree command failed: 'python3 manage.py migrate --run-syncdb'
- Refer to the error messages in the log above for more information
Steps to Reproduce
Run docker compose run --rm inventree-server invoke migrate
Expected behaviour
No error on db migrate
Deployment Method
None
Version Information
[+] Running 1/0
⠿ Container inventree-db Started 0.0s
Loading config file : /home/inventree/data/config.yaml
INVE-W3: Could not detect git information.
InvenTree - inventree.org
The Open-Source Inventory Management System
Python paths:
Executable /usr/local/bin/python
Environment /usr/local
Invoke Tool /usr/local/lib/python3.11/site-packages/invoke/__init__.py
Installation paths:
Base /home/inventree
Config /home/inventree/data/config.yaml
Plugin File /home/inventree/data/plugins.txt
Media /home/inventree/data/media
Static /home/inventree/data/static
Backup /home/inventree/data/backup
Versions:
InvenTree 1.1.12
API 421
Python 3.11.13
Django 4.2.28
Node N/A
Yarn N/A
Environment:
Platform Docker
Debug False
Commit hash: aa93421
Commit date: 2026-02-12
Try to reproduce on the demo site
I did not try to reproduce
Is the bug reproducible on the demo site?
Not reproducible
Activity
SchrodingersGat commentedon Feb 16, 2026
This looks like the database container simply has not had time to boot up before the InvenTree container tries to access it.
Can you try the following:
docker compose up inventree-db -ddocker compose run --rm inventree-server invoke migratemartin323232 commentedon Feb 16, 2026
got and error message on "migrate"
Tried to continue with
docker compose run --rm inventree-server invoke restoreSchrodingersGat commentedon Feb 16, 2026
This looks to be hitting the same error as #11315
SchrodingersGat commentedon Feb 16, 2026
@martin323232 the message "Failed to set maintenance mode state after 5 retries [inventree]" is not an error, you can ignore this message.
Can you please run through the restore procedure again (starting from the blank database point) and provide a full log output including:
martin323232 commentedon Feb 16, 2026
I followed the blogpost guide, but I can do it again.
How to I get the full log output, or is it just all data in terminal?
apohh commentedon Feb 16, 2026
I don’t want to hijack the thread, but I’m encountering exactly the same error, so I’m sharing my steps in case it helps.
docker compose up -dto verify the update was successful :docker compose run --rm inventree-server invoke backup:mv data/pgdb data/pgdb_backupdocker compose pulldocker compose run --rm inventree-server invoke migrateMigration result
docker compose run --rm inventree-server invoke restorewhich fails with :pg_restore: error: could not execute query: ERROR: column "id" of relation "users_ruleset" is an identity columnRestore result
docker compose run --rm inventree-server invoke versionoutputs:.env file
docker-compose.eml
SchrodingersGat commentedon Feb 16, 2026
@apohh can you please try the process again, but without the "invoke migrate" command after you move
pgdbdirectory:docker compose downpgdbdirectorydocker compose up inventree-db -ddocker compose run --rm inventree-server invoke restorePlease let me know how that goes
Kamaar commentedon Feb 17, 2026
I've also the same problem, tried the last method but still the same error:
here the logs, hope to help.
17 remaining items
martin323232 commentedon Feb 20, 2026
I waited 10 minutes, downgraded to 1.1.12 again
This is the only output from inventree-server
inven@inven:~/Downloads/InvenTree-master/docker/production$ docker compose logs inventree-server inventree-server | Loading config file : /home/inventree/data/config.yaml inventree-server | INVE-W3: Could not detect git information. inven@inven:~/Downloads/InvenTree-master/docker/production$SchrodingersGat commentedon Feb 20, 2026
There was a typo in my command sorry
docker compose run --rm inventree-server pip install -U inventree-kiacd-pluginshould be
docker compose run --rm inventree-server pip install -U inventree-kicad-pluginmartin323232 commentedon Feb 20, 2026
tried again to upgrade to latest, 1.2.2, same issue that server will not start. 502 error.
1.1.12 does not work 100% either, cant open parameters tab.
error when printin label,
column part_partparameter.part_id does not exist LINE 1: ...T(*) AS "__count" FROM "part_partparameter" WHERE "part_part... ^SchrodingersGat commentedon Feb 20, 2026
If you have reverted to the old version (1.1.12) with the new database setup (after migrating to 1.2.x) then the database will be out of sync with the code - this is a bad situation to be in.
You need to get your 1.2.0 server running.
There should be some logs from the inventree-server container when you hit the 502 error running in 1.2.x.
With the server running in 1.2.x please provide the full output of:
martin323232 commentedon Feb 22, 2026
Nothing is happning on server logs
SchrodingersGat commentedon Feb 23, 2026
And you get absolutely nothing in your browser?
https://docs.inventree.org/en/stable/troubleshooting/
In particular, what does your browser console say?
https://docs.inventree.org/en/stable/troubleshooting/#web-browser-console
martin323232 commentedon Feb 23, 2026
Browser only show bad gateway.
I do not know what web console is and how to get there.
If I would have guessed it looks like there is someting wrong with the .yaml file for server since it does not start?
My .yaml file is from 2022 when I first installed InvenTree.
martin323232 commentedon Feb 23, 2026
inventree-worker | /root/.local/lib/python3.11/site-packages/picklefield/fields.py:78: RuntimeWarning: Pickled model instance's Django version 4.2.28 does not match the current version 5.2.11.is there anything I can do to sort out this issue?
ChatGPT has a lot of suggestions but i don\t want to break anything
SchrodingersGat commentedon Feb 23, 2026
That would have been very helpful information to include at the start. Your docker compose file is not aligned with the current docker installation instructions, and this has likely caused this issue.
In particular, you are using nginx image, which is probably why none of your web traffic is getting to the webserver (
inventree-server) and thus no logs showing for that container.martin323232 commentedon Feb 23, 2026
sorry about that, thought I posted my .yaml files together with the .env files a few days ago.
Is there an easy way to get inventree to work again?
We would really appreciate any help to get our server running again
SchrodingersGat commentedon Feb 23, 2026
We use Caddy as the default proxy in our docker stack now.
What I would suggest is that you start from the fresh docker compose file (unless you have a particular reason you want to stick with nginx, in which case we'll need to debug three years of compatibility drift...)
0. Backup your data
Ensure your data is well backed up first!
1. docker compose down
docker compose down2. backup docker-compose file
i.e. move it to
docker-compose.yml.backup3. Download new file
docker-compose.yml (latest stable version)
4. Update
martin323232 commentedon Feb 23, 2026
Thanks for all the help @SchrodingersGat
Tired to copy new .yml file but was trying with wrong one.
I've copied the new you linked to and have updated.
First there was an error with the Caddyfile, it was created as a folder, I copied this from git and containers start.
Still there is nothing when trying to reach webpage, no more logs on inventree-server than before
martin323232 commentedon Feb 23, 2026
It looks now to be up and running, thanks again for all the help.
Had to update .env file to get it working.
apohh commentedon Mar 6, 2026
@SchrodingersGat I'm not sure whether this is related to the PostgreSQL issue we encountered previously, but I ran into several errors on version 1.2.2 when completing a build order while leaving two build lines unallocated.
Appears 11 times in error reports in admin center:

Alternating with another error, also appearing 11 times:

The sequence ends with these two errors:

Traceback
And :

Traceback
I’m not sure how to access the server logs, so I couldn’t provide additional details from there.
I updated to 1.2.3 in an attempt to remedy to this. However, I encountered a similar error when deleting a stock item:

Regarding this issue:
I’m particularly worried that some data may not have been correctly written or updated in the database.
Thank you.