Skip to content

Bug after update PYJWT #11734

@LucLeduc

Description

@LucLeduc

Please verify that this bug has NOT been raised before.

  • I checked and didn't find a similar issue

Describe the bug*

Hi all,

I have working on invetree since a few week and everything seem ok until i update ubuntu. It update inventree at the same time a sudenly give me error message.

I try to 'invoke update' manually but still not working.

I installed inventree in bare-metal mode in Ubuntu 24.04 lts

I notice that error

inventree-report-lsp-plugin 0.1.2 requires pyjwt==2.10.1, but you have pyjwt 2.12.1 which is incompatible.

When i downgrade from 2.12.1 to 2.10.1 and invoke udpate.. i've got the same error

When i upgrade to 2.12.1 i have the same error.

When i look into requirements.txt.. it's write 2.12.1.

Wich version should i have and how to resole that conflict?

any help will be appreciate.

Thanks

Here is the result of update:

# PRI01| Running preinstall script - start - Sun Apr 12 03:49:15 PM UTC 2026
# PRI02| Clearing precompiled files
Unknown environment, not checking used invoke command
# PRI03| Running preinstall script - done - Sun Apr 12 03:49:15 PM UTC 2026
# PRI01| Running preinstall script - start - Sun Apr 12 03:49:15 PM UTC 2026
# PRI02| Clearing precompiled files
Unknown environment, not checking used invoke command
# PRI03| Running preinstall script - done - Sun Apr 12 03:49:15 PM UTC 2026
# POI01| Running postinstall script - start - Sun Apr 12 03:49:18 PM UTC 2026
# POI01| Importing functions
# POI01| Functions imported
# POI02| Loading environment variables from VERSION file
Running in a package environment build on branch '1.3.x for target 'ubuntu:24.04'
# POI06| Getting the IP address of the server via web service
# POI06| IP address is xxx.xxx.xxx.xx
# POI03| Setting base environment variables
# POI03| Using existing config file: /etc/inventree/config.yaml
# POI03| Installing requirements
WARNING: Ignoring invalid distribution ~etuptools (/opt/inventree/env/lib/python3.12/site-packages)
WARNING: Ignoring invalid distribution ~etuptools (/opt/inventree/env/lib/python3.12/site-packages)
WARNING: Ignoring invalid distribution ~etuptools (/opt/inventree/env/lib/python3.12/site-packages)
WARNING: Ignoring invalid distribution ~etuptools (/opt/inventree/env/lib/python3.12/site-packages)
WARNING: Ignoring invalid distribution ~etuptools (/opt/inventree/env/lib/python3.12/site-packages)
# POI03| Installed requirements
# POI03| Getting site URL from app config
# POI03| Collected environment variables:
# POI03|    INVENTREE_MEDIA_ROOT=/opt/inventree/data/media
# POI03|    INVENTREE_STATIC_ROOT=/opt/inventree/data/static
# POI03|    INVENTREE_BACKUP_DIR=/opt/inventree/data/backup
# POI03|    INVENTREE_PLUGINS_ENABLED=true
# POI03|    INVENTREE_PLUGIN_FILE=/etc/inventree/plugins.txt
# POI03|    INVENTREE_SECRET_KEY_FILE=null
# POI03|    INVENTREE_DB_ENGINE=postgresql
# POI03|    INVENTREE_DB_NAME=inventree
# POI03|    INVENTREE_DB_USER=inventree_user
# POI03|    INVENTREE_DB_HOST=localhost
# POI03|    INVENTREE_DB_PORT=5432
# POI03|    INVENTREE_SITE_URL=http://inventaire.xxxx.xx:11000
# POI04| Running in docker: no
# POI05| Using init command: systemctl
# POI07| Python environment already present
# POI07| Found earlier used version: /opt/inventree/env/bin/python
# POI07| Using python command: /opt/inventree/env/bin/python
# POI08| Checking if update checks are needed
# POI08| Running upgrade
# POI08| Old version is: 1.3.0-1775915321.b4223721.noble | 3 - updating to 1.3.0-1775915321.b4223721.noble | 3
# POI08| Old version is below 0.9.0 - You might be missing some configs
# POI08| Found setting for site URL - http://inventaire.xxxx.xx:11000
# POI08| Found setting for backup dir - /opt/inventree/data/backup
# POI08| All checks passed - continuing with the update
# POI09| Setting up python environment
WARNING: Ignoring invalid distribution ~etuptools (/opt/inventree/env/lib/python3.12/site-packages)
Requirement already satisfied: invoke in ./env/lib/python3.12/site-packages (2.2.1)
Requirement already satisfied: wheel in ./env/lib/python3.12/site-packages (0.46.3)
Requirement already satisfied: packaging>=24.0 in ./env/lib/python3.12/site-packages (from wheel) (26.0)
WARNING: Ignoring invalid distribution ~etuptools (/opt/inventree/env/lib/python3.12/site-packages)
WARNING: Ignoring invalid distribution ~etuptools (/opt/inventree/env/lib/python3.12/site-packages)
WARNING: Ignoring invalid distribution ~etuptools (/opt/inventree/env/lib/python3.12/site-packages)
WARNING: Ignoring invalid distribution ~etuptools (/opt/inventree/env/lib/python3.12/site-packages)
# POI09| Stopping nginx
# POI09| Stopped nginx
# POI09| Setting up nginx to /etc/nginx/sites-enabled/inventree.conf
# POI09| Starting nginx
# POI09| Started nginx
# POI09| (Re)creating init scripts
Nothing to do.
Nothing to do.
# POI09| Enabling InvenTree on boot
# POI09| Enabled InvenTree on boot
# POI10| Admin data already exists - skipping
# POI11| Stopping InvenTree
# POI11| Stopped InvenTree
# POI12| Updating InvenTree
WARNING: Ignoring invalid distribution ~etuptools (/opt/inventree/env/lib/python3.12/site-packages)
Requirement already satisfied: wheel in ./env/lib/python3.12/site-packages (0.46.3)
Requirement already satisfied: python-dotenv in ./env/lib/python3.12/site-packages (1.2.2)
Requirement already satisfied: packaging>=24.0 in ./env/lib/python3.12/site-packages (from wheel) (26.0)
WARNING: Ignoring invalid distribution ~etuptools (/opt/inventree/env/lib/python3.12/site-packages)
WARNING: Ignoring invalid distribution ~etuptools (/opt/inventree/env/lib/python3.12/site-packages)
WARNING: Ignoring invalid distribution ~etuptools (/opt/inventree/env/lib/python3.12/site-packages)
WARNING: Ignoring invalid distribution ~etuptools (/opt/inventree/env/lib/python3.12/site-packages)
WARNING: Ignoring invalid distribution ~etuptools (/opt/inventree/env/lib/python3.12/site-packages)
WARNING: Ignoring invalid distribution ~etuptools (/opt/inventree/env/lib/python3.12/site-packages)
WARNING: Ignoring invalid distribution ~etuptools (/opt/inventree/env/lib/python3.12/site-packages)
WARNING: Ignoring invalid distribution ~etuptools (/opt/inventree/env/lib/python3.12/site-packages)
WARNING: Ignoring invalid distribution ~etuptools (/opt/inventree/env/lib/python3.12/site-packages)
    WARNING: Ignoring invalid distribution ~etuptools (/opt/inventree/env/lib/python3.12/site-packages)
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
inventree-report-lsp-plugin 0.1.2 requires pyjwt==2.10.1, but you have pyjwt 2.12.1 which is incompatible.
WARNING: Ignoring invalid distribution ~etuptools (/opt/inventree/env/lib/python3.12/site-packages)
WARNING: Ignoring invalid distribution ~etuptools (/opt/inventree/env/lib/python3.12/site-packages)
WARNING: Ignoring invalid distribution ~etuptools (/opt/inventree/env/lib/python3.12/site-packages)
    WARNING: Ignoring invalid distribution ~etuptools (/opt/inventree/env/lib/python3.12/site-packages)
WARNING: Ignoring invalid distribution ~etuptools (/opt/inventree/env/lib/python3.12/site-packages)
Traceback (most recent call last):
  File "/opt/inventree/src/backend/InvenTree/manage.py", line 26, in <module>
    main()
  File "/opt/inventree/src/backend/InvenTree/manage.py", line 21, in main
    execute_from_command_line(sys.argv)
  File "/opt/inventree/env/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/opt/inventree/env/lib/python3.12/site-packages/django/core/management/__init__.py", line 382, in execute
    settings.INSTALLED_APPS
  File "/opt/inventree/env/lib/python3.12/site-packages/django/conf/__init__.py", line 81, in __getattr__
    self._setup(name)
  File "/opt/inventree/env/lib/python3.12/site-packages/django/conf/__init__.py", line 68, in _setup
    self._wrapped = Settings(settings_module)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/inventree/env/lib/python3.12/site-packages/django/conf/__init__.py", line 166, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/opt/inventree/src/backend/InvenTree/InvenTree/settings.py", line 27, in <module>
    import InvenTree.backup
  File "/opt/inventree/src/backend/InvenTree/InvenTree/backup.py", line 15, in <module>
    import InvenTree.version
  File "/opt/inventree/src/backend/InvenTree/InvenTree/version.py", line 17, in <module>
    from .api_version import INVENTREE_API_TEXT, INVENTREE_API_VERSION
SyntaxError: source code string cannot contain null bytes
# POI12| u | Unknown environment, not checking used invoke command
# POI12| u | Updating InvenTree installation...
# POI12| u | Installing required python packages...
# POI12| u | Installing required python packages from '/opt/inventree/src/backend/requirements.txt'
# POI12| u | Installed package manager
# POI12| u | Installing required python packages from '/etc/inventree/plugins.txt'
# POI12| u | ERROR: InvenTree command failed: 'python3 manage.py collectplugins -v 0'
# POI12| u | - Refer to the error messages in the log above for more information
# POI12| u | Task 'plugins' failed with an error.
# POI12| u | Task 'install' failed with an error.
# POI12| u | Task 'update' failed with an error.
# POI12| Set permissions for data dir and media: /opt/inventree/data
# POI14| Site URL already set to 'http://inventaire.xxxx.xx:11000' - skipping
# POI15| Starting InvenTree
# POI15| Started InvenTree
# POI16| Printing Final message
####################################################################################
This InvenTree install uses nginx, the settings for the webserver can be found in
/etc/nginx/sites-enabled/inventree.conf
Try opening InvenTree with any of
http://inventaire.xxxx.xx:11000 , http://localhost/ or http://xxx.xxx.xx.xx/

/opt/inventree/contrib/packager.io/functions.sh: line 416: /etc/inventree/admin_password.txt: Permission denied
No admin set during this operation - depending on the deployment method a admin user might have been created with an initial password saved in
#################################################################################

Steps to Reproduce

source ./env/bin/activate
invoke update

Expected behaviour

Expect invoke update

Deployment Method

Bare metal

Version Information

version 1.3

Try to reproduce on the demo site

I did not try to reproduce

Is the bug reproducible on the demo site?

Not reproducible

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    pluginPlugin ecosystemquestionThis is a question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions