Skip to content
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

Error import-records #8942

Closed
3 of 6 tasks
Noscopes063 opened this issue Jan 22, 2025 · 6 comments · Fixed by #8952
Closed
3 of 6 tasks

Error import-records #8942

Noscopes063 opened this issue Jan 22, 2025 · 6 comments · Fixed by #8952
Labels
question This is a question setup Relates to the InvenTree setup / installation process

Comments

@Noscopes063
Copy link

Noscopes063 commented Jan 22, 2025

Please verify that this bug has NOT been raised before.

  • I checked and didn't find a similar issue

Describe the bug*

Hello!

I had installed Inventree via docker on Ubuntu 24.04. After that I needed to create a separate OS (I install Ubuntu 20.04). I copied the database from docker, moved it to another VM and an error occurs during import.

Database on docker and Ubuntu are differents.
Docker - postgresql. Ubuntu - sqlite3.

Version Python too.
Docker - 3.11.9. Ubuntu - 3.9.5.

I update version Python on Ubuntu on 3.11.11, but in web I see old version.

Could you please tell me what the problem?

Steps to Reproduce

root@auxo-server:/opt/inventree/data# invoke import-records -c -f data-auxo.json
Traceback (most recent call last):
File "/usr/bin/invoke", line 11, in
load_entry_point('invoke==1.3.0', 'console_scripts', 'invoke')()
File "/usr/lib/python3/dist-packages/invoke/program.py", line 373, in run
self.parse_collection()
File "/usr/lib/python3/dist-packages/invoke/program.py", line 465, in parse_collection
self.load_collection()
File "/usr/lib/python3/dist-packages/invoke/program.py", line 696, in load_collection
module, parent = loader.load(coll_name)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/invoke/loader.py", line 76, in load
module = imp.load_module(name, fd, path, desc)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/imp.py", line 235, in load_module
return load_source(name, filename, file)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/imp.py", line 172, in load_source
module = _load(spec)
^^^^^^^^^^^
File "", line 721, in _load
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/opt/inventree/tasks.py", line 261, in
@task(help={'uv': 'Use UV (experimental package manager)'})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/invoke/tasks.py", line 338, in inner
obj = klass(
^^^^^^
File "/usr/lib/python3/dist-packages/invoke/tasks.py", line 76, in init
self.positional = self.fill_implicit_positionals(positional)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/invoke/tasks.py", line 167, in fill_implicit_positionals
args, spec_dict = self.argspec(self.body)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/invoke/tasks.py", line 153, in argspec
spec = inspect.getargspec(func)
^^^^^^^^^^^^^^^^^^
AttributeError: module 'inspect' has no attribute 'getargspec'. Did you mean: 'getargs'?

Expected behaviour

Import data from docker in new database on ubuntu.

Deployment Method

  • Docker
  • Package
  • Bare metal
  • Other - added info in Steps to Reproduce

Version Information

Docker:

Version Information:

InvenTree-Version: 0.17.2
Django Version: 4.2.17
Commit Hash: 4b56492
Commit Date: 2025-01-07

Database: postgresql
Debug-Mode: False
Deployed using Docker: True
Platform: Linux-6.8.0-51-generic-x86_64-with
Installer: DOC

Active plugins: [{'name': 'InvenTreeBarcode', 'slug': 'inventreebarcode', 'version': '2.1.0'}, {'name': 'InvenTreeCoreNotificationsPlugin', 'slug': 'inventreecorenotificationsplugin', 'version': '1.0.0'}, {'name': 'InvenTreeCurrencyExchange', 'slug': 'inventreecurrencyexchange', 'version': '1.0.0'}, {'name': 'InvenTreeLabel', 'slug': 'inventreelabel', 'version': '1.1.0'}, {'name': 'InvenTreeLabelMachine', 'slug': 'inventreelabelmachine', 'version': '1.0.0'}, {'name': 'InvenTreeLabelSheet', 'slug': 'inventreelabelsheet', 'version': '1.0.0'}, {'name': 'DigiKeyPlugin', 'slug': 'digikeyplugin', 'version': '1.0.0'}, {'name': 'LCSCPlugin', 'slug': 'lcscplugin', 'version': '1.0.0'}, {'name': 'MouserPlugin', 'slug': 'mouserplugin', 'version': '1.0.0'}, {'name': 'TMEPlugin', 'slug': 'tmeplugin', 'version': '1.0.0'}]

Ubuntu 20.04:

Version Information:

InvenTree-Version: 0.17.2
Django Version: 4.2.17

Database: sqlite3
Debug-Mode: False
Deployed using Docker: False
Platform: Linux-5.4.0-204-generic-x86_64-with-glibc2.31
Installer: None

Active plugins: [{'name': 'InvenTreeBarcode', 'slug': 'inventreebarcode', 'version': '2.1.0'}, {'name': 'InvenTreeCoreNotificationsPlugin', 'slug': 'inventreecorenotificationsplugin', 'version': '1.0.0'}, {'name': 'InvenTreeCurrencyExchange', 'slug': 'inventreecurrencyexchange', 'version': '1.0.0'}, {'name': 'InvenTreeLabel', 'slug': 'inventreelabel', 'version': '1.1.0'}, {'name': 'InvenTreeLabelMachine', 'slug': 'inventreelabelmachine', 'version': '1.0.0'}, {'name': 'InvenTreeLabelSheet', 'slug': 'inventreelabelsheet', 'version': '1.0.0'}, {'name': 'DigiKeyPlugin', 'slug': 'digikeyplugin', 'version': '1.0.0'}, {'name': 'LCSCPlugin', 'slug': 'lcscplugin', 'version': '1.0.0'}, {'name': 'MouserPlugin', 'slug': 'mouserplugin', 'version': '1.0.0'}, {'name': 'TMEPlugin', 'slug': 'tmeplugin', 'version': '1.0.0'}]

Please verify if you can reproduce this bug on the demo site.

  • I can reproduce this bug on the demo site.

Relevant log output

@Noscopes063 Noscopes063 added bug Identifies a bug which needs to be addressed question This is a question triage:not-checked Item was not checked by the core team labels Jan 22, 2025
@matmair matmair added setup Relates to the InvenTree setup / installation process and removed bug Identifies a bug which needs to be addressed triage:not-checked Item was not checked by the core team labels Jan 22, 2025
@matmair
Copy link
Member

matmair commented Jan 22, 2025

Hi there! Switching between Python versions in the os is not really supported. Your virtual environment will probably point to old references and not work anymore.
What deployment method are you using on the new instance? You will have to either fully uninstall inventree and install again or rebuild the venv - which is probably more involved.

@Noscopes063
Copy link
Author

On the new VM I used package installer:
wget -qO install.sh https://get.inventree.org && bash install.sh

After that, Inventree was installed and I tried to import the database from the old VM (which was installed via Docker).
I can install it again, no problem)

@SchrodingersGat
Copy link
Member

@Noscopes063 it looks like you have the wrong version of invoke installed on your new system.

https://docs.inventree.org/en/stable/start/invoke/?h=invoke

We need at least 2.0.0 - run invoke --version to see what version you have!

@matmair
Copy link
Member

matmair commented Jan 26, 2025

@SchrodingersGat not sure this was the issue from the traceback. @Noscopes063 can you confirm this fixed your issue?

@Noscopes063
Copy link
Author

In new VM Invoke was less then 2.0, it's true.

So, I install the new VM Ubuntu 20.04. Update and upgrade it.
After install Invoke 2.2.0.

$ invoke --version
Invoke 2.2.0

Use this command from manual:
wget -qO install.sh https://get.inventree.org && bash install.sh

Installation completed successfully.
After that try to import my data from another VM (intalled via docker):
$ invoke import-records -c -f data.json
The installed python version (3.8.10) is not supported!
InvenTree requires Python 3.9 or above.

$ python3 --version
Python 3.8.10

If I update Python version I have another many errors.
How I could update Python version correctly?

@SchrodingersGat
Copy link
Member

If I update Python version I have another many errors.

You need to solve these errors first - our installation guide assumes that you have the required packages installed..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This is a question setup Relates to the InvenTree setup / installation process
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants