-
-
Notifications
You must be signed in to change notification settings - Fork 671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating Inventree to 0.12.8. fails at datatbase migration #5804
Comments
@MatjazSi have not seen this one before! Can you provide a list of the migrations that have been run against your database: > docker compose run inventree-server sh
...
$ cd InvenTree
$ python ./manage.py show migrations |
Hi @SchrodingersGat |
@MatjazSi good to hear that you could restore from backup. Please do let us know when you have some further information, so we can fix whatever is going on here |
@SchrodingersGat I created a copy of my server on Digital Ocean, try to update it got the same error as above.
|
@MatjazSi those secondary error message would indicate that the database tables have not been created at all - are you running an update on an existing database? Or perhaps the virtual environment is not set correctly? Regarding the Try: This is certainly an odd one, would like to get to the bottom of it |
@SchrodingersGat Yes, I belive I am running the update on the existing database. How do I check if the virtual environment is correct? When I try to run migrate multiple times, that doesn't help, all I get is that the record ID in the error gets increased:
|
@MatjazSi so you were updating from
If you can run these steps at least we can potentially focus in on where the migration issue is ocurring |
@SchrodingersGat Thanks for the advice. I tried to update to
|
@MatjazSi did you ever get anywhere with this one? I have opened a PR which may address some of these issues, but I do not think it is the whole picture. Some references which may be helpful if more work is needed: |
@SchrodingersGat I am still not able to update to any version. I will try the fix in the first link, but I am quite a noob when it comes to Docker, so can you please tell me how to login to dDango shell in Docker? |
Try |
I had a similar experience. From |
@Sundypha can you provide a full error log please? |
Ran from docker-compose: user@host:/usr/docker/composes/inventree$ sudo docker-compose run inventree-server invoke update
[+] Running 1/0
✔ Container inventree-db Running 0.0s
Loading config file : /home/inventree/data/config.yaml
Installing required python packages from 'requirements.txt'
Traceback (most recent call last):
File "/usr/local/bin/invoke", line 8, in <module>
sys.exit(program.run())
File "/usr/local/lib/python3.9/site-packages/invoke/program.py", line 398, in run
self.execute()
File "/usr/local/lib/python3.9/site-packages/invoke/program.py", line 583, in execute
executor.execute(*self.tasks)
File "/usr/local/lib/python3.9/site-packages/invoke/executor.py", line 140, in execute
result = call.task(*args, **call.kwargs)
File "/usr/local/lib/python3.9/site-packages/invoke/tasks.py", line 138, in __call__
result = self.body(*args, **kwargs)
File "/home/inventree/tasks.py", line 285, in update
install(c)
File "/usr/local/lib/python3.9/site-packages/invoke/tasks.py", line 138, in __call__
result = self.body(*args, **kwargs)
File "/home/inventree/tasks.py", line 128, in install
c.run('pip3 install --upgrade pip')
File "/usr/local/lib/python3.9/site-packages/invoke/context.py", line 104, in run
return self._run(runner, command, **kwargs)
File "/usr/local/lib/python3.9/site-packages/invoke/context.py", line 113, in _run
return runner.run(command, **kwargs)
File "/usr/local/lib/python3.9/site-packages/invoke/runners.py", line 395, in run
return self._run_body(command, **kwargs)
File "/usr/local/lib/python3.9/site-packages/invoke/runners.py", line 449, in _run_body
thread.start()
File "/usr/local/lib/python3.9/threading.py", line 899, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread
root@6d9deea2707b:/home/inventree# ulimit
unlimited OS: Ubuntu server 20.04.6 LTS |
@Sundypha this seems like a different error, perhaps related to docker itself. Can you try updating docker maybe? I am running:
|
@SchrodingersGat I can confirm. I migrated the data to a host with a newer docker runtime and there it worked flawlessly. Even migrating from But this covers only the |
- If provided, do not load custom app ready code - Ref: #5804 (comment)
- If provided, do not load custom app ready code - Ref: #5804 (comment)
@SchrodingersGat sorry for the late response, was pretty busy the last few weeks. I followed your advice and tried to reset the id as suggested in this post: Link Then I tried to update (directly to 0.13.0) and got this:
|
I have a similar problem from upgrade from 0.12.10 to -> 0.13.0
|
I ran into this yesterday for an upgrade from 0.12.10 --> 0.13.1 as well. |
@opajonk can you please share your full error trace also. We are getting different errors being reported here. |
@ChristianSchindler it looks like you have missed the |
@SchrodingersGat the update gives me the following error:
But without a backup, it works. Maybe you could implement that you support more PostgreSQL versions because I use the db for several things. |
D'oh, nevermind. I missed the To be honest, this happens quite easily - is it not somehow possible to "update if required" when the server container starts? |
I do not think that enforcing It is not too much of a burden to run a single command which handles the database update, especially when the admin has already made a decision to update. |
Well, of course some kind of "am I already on the current version?" check would be a good idea :-) but yeah, an |
@opajonk superusers can access this in the version info screen already. In 0.14.0 there will also be an email to superusers if a new version is detected. |
I mean of course an automated check on container boot, checking for "is my persistency on the current version of the container that is being booted?". If not, run "invoke update". If yes, just skip that and boot the container immediately. |
I have created an issue for improving the docker deployment #6303 |
@matmair @opajonk can we update pg_dump to 16, or is there something that would not work? |
@ChristianSchindler are you running a "standard" docker setup? We pin postgres to version 13 - so why are you seeing postgres 16? |
No not really. I use only one db for all my services and that’s at the moment postgrsql 16. |
InvenTree will not work with Postgres 16 currently |
Deployment Method
Steps to Reproduce
Describe the problem*
Hi,
When trying to update Inventree to the latest version (0.12.8) I get an error in the database migration step (see log output section)
Steps to Reproduce
Followed instructions on this page
Stop server:
sudo docker-compose down
Backup DB:
sudo docker-compose run inventree-server invoke backup
Download new version:
sudo docker-compose pull
Migtrate DB to new version:
sudo docker-compose run inventree-server invoke update
This is whwere error happens
Relevant log output
The text was updated successfully, but these errors were encountered: