inventree / InvenTree

Open Source Inventory Management System
https://docs.inventree.org
MIT License
4.32k stars 781 forks source link

Inventree Server API version (196) is older than minimum supported API version (206) #7935

Closed superbeppe98 closed 2 months ago

superbeppe98 commented 2 months ago

Deployment Method

Describe the problem*

Hello, i have a problem running my usual script for checking some inventory, with this error: "Server API version (196) is older than minimum supported API version (206)"

How can i update the API version?

Steps to Reproduce

Hello, i have a problem running my usual script for checking some inventory, with this error: "Server API version (196) is older than minimum supported API version (206)"

How can i update the API version?

Relevant log output

fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/aarch64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/aarch64/APKINDEX.tar.gz
OK: 231 MiB in 103 packages
Requirement already satisfied: ebaysdk==2.2.0 in ./ebay-listing-matches/lib/python3.11/site-packages (from -r requirements.txt (line 1)) (2.2.0)
Requirement already satisfied: beautifulsoup4==4.12.3 in ./ebay-listing-matches/lib/python3.11/site-packages (from -r requirements.txt (line 2)) (4.12.3)
Requirement already satisfied: bs4==0.0.2 in ./ebay-listing-matches/lib/python3.11/site-packages (from -r requirements.txt (line 3)) (0.0.2)
Requirement already satisfied: python-dotenv==1.0.1 in ./ebay-listing-matches/lib/python3.11/site-packages (from -r requirements.txt (line 4)) (1.0.1)
Requirement already satisfied: requests==2.32.3 in ./ebay-listing-matches/lib/python3.11/site-packages (from -r requirements.txt (line 5)) (2.32.3)
Requirement already satisfied: inventree==0.16.1 in ./ebay-listing-matches/lib/python3.11/site-packages (from -r requirements.txt (line 6)) (0.16.1)
Requirement already satisfied: lxml in ./ebay-listing-matches/lib/python3.11/site-packages (from ebaysdk==2.2.0->-r requirements.txt (line 1)) (4.9.3)
Requirement already satisfied: soupsieve>1.2 in ./ebay-listing-matches/lib/python3.11/site-packages (from beautifulsoup4==4.12.3->-r requirements.txt (line 2)) (2.5)
Requirement already satisfied: charset-normalizer<4,>=2 in ./ebay-listing-matches/lib/python3.11/site-packages (from requests==2.32.3->-r requirements.txt (line 5)) (3.3.0)
Requirement already satisfied: idna<4,>=2.5 in ./ebay-listing-matches/lib/python3.11/site-packages (from requests==2.32.3->-r requirements.txt (line 5)) (3.4)
Requirement already satisfied: urllib3<3,>=1.21.1 in ./ebay-listing-matches/lib/python3.11/site-packages (from requests==2.32.3->-r requirements.txt (line 5)) (2.0.5)
Requirement already satisfied: certifi>=2017.4.17 in ./ebay-listing-matches/lib/python3.11/site-packages (from requests==2.32.3->-r requirements.txt (line 5)) (2023.7.22)

[notice] A new release of pip is available: 23.2.1 -> 24.2
[notice] To update, run: pip install --upgrade pip
Traceback (most recent call last):
  File "/opt/cronicle/plugins/ebay-listing-matches/ebay-listing-matches/lib/python3.11/site-packages/inventree/api.py", line 120, in connect
    self.connected = self.testServer()
                     ^^^^^^^^^^^^^^^^^
  File "/opt/cronicle/plugins/ebay-listing-matches/ebay-listing-matches/lib/python3.11/site-packages/inventree/api.py", line 228, in testServer
    raise ValueError(f"Server API version ({api_version}) is older than minimum supported API version ({InvenTreeAPI.getMinApiVersion()})")
ValueError: Server API version (196) is older than minimum supported API version (206)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/cronicle/plugins/ebay-listing-matches/ebay-listing-matches.py", line 35, in <module>
    inventree_api = InvenTreeAPI(SERVER_ADDRESS, username=MY_USERNAME, password=MY_PASSWORD, timeout=3600)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/cronicle/plugins/ebay-listing-matches/ebay-listing-matches/lib/python3.11/site-packages/inventree/api.py", line 77, in __init__
    self.connect()
  File "/opt/cronicle/plugins/ebay-listing-matches/ebay-listing-matches/lib/python3.11/site-packages/inventree/api.py", line 125, in connect
    raise ConnectionRefusedError("Could not connect to InvenTree server")
ConnectionRefusedError: Could not connect to InvenTree server

# Job failed at 2024/08/20 16:47:34 (GMT+2).
# Error: Script exited with code: 1: [notice] A new release of pip is available: 23.2.1 -> 24.2
# End of log.
matmair commented 2 months ago

Sounds like your inventree python library was updated. You can either pin it lower or update your inventree server.

superbeppe98 commented 2 months ago

How can i do it? My inventree server version is 0.15.8

matmair commented 2 months ago

That depends on how you deployed and is documented on the according docs pages. installer https://docs.inventree.org/en/stable/start/installer/?h=upgrade#updating-inventree docker https://docs.inventree.org/en/stable/start/docker_install/#updating-inventree

superbeppe98 commented 2 months ago

i'm on the last version but i have api version set on 196 instead of 242.

image

matmair commented 2 months ago

you are not on latest, latest has a version number of 0.17.0dev. Have you restarted the server after upgrading?

superbeppe98 commented 2 months ago

yes i restarted the server and the containers

SchrodingersGat commented 2 months ago

You should downgrade your inventree-python version to 0.14.0 - the latest release is targetting a much newer API:

pip install inventree==0.14.0