invenhost / inventree-wled-locator

Locate StockLocations with a WLED instance
MIT License
5 stars 2 forks source link

0.4.0 locator issue #12

Open matmair opened 4 months ago

matmair commented 4 months ago
          ok that works!  
File "/home/inventree/src/backend/InvenTree/InvenTree/tasks.py", line 212, in offload_task
task.run()

File "/root/.local/lib/python3.11/site-packages/django_q/tasks.py", line 727, in run
self.id = async_task(self.func, *self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/root/.local/lib/python3.11/site-packages/django_q/tasks.py", line 70, in async_task
pack = SignedPackage.dumps(task)
^^^^^^^^^^^^^^^^^^^^^^^^^

File "/root/.local/lib/python3.11/site-packages/django_q/signing.py", line 15, in dumps
return signing.dumps(
^^^^^^^^^^^^^^

File "/root/.local/lib/python3.11/site-packages/django/core/signing.py", line 152, in dumps
return TimestampSigner(key=key, salt=salt).sign_object(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/root/.local/lib/python3.11/site-packages/django/core/signing.py", line 250, in sign_object
data = serializer().dumps(obj)
^^^^^^^^^^^^^^^^^^^^^^^

File "/root/.local/lib/python3.11/site-packages/django_q/signing.py", line 35, in dumps
return pickle.dumps(obj, protocol=pickle.HIGHEST_PROTOCOL)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

AttributeError: Can't pickle local object 'View.as_view.<locals>.view'

Originally posted by @PricelessToolkit in https://github.com/invenhost/inventree-wled-locator/issues/7#issuecomment-2207346165

matmair commented 4 months ago

@PricelessToolkit are you sure this is the error that is triggered? I am asking because the locator function is not calling any offliading

grafik
PricelessToolkit commented 4 months ago

Yes, I tried several times.

err

matmair commented 4 months ago

Ok, I will have to dig into this then. I can not reproduce it on my docker dev setup. Could you post your version information? It is provided in the upper right corner of the UI in the dropdown (there is a "copy version information" button - that provides a bit more info than is shown in the UI)

PricelessToolkit commented 4 months ago

Version Information:

InvenTree-Version: 0.15.4 Django Version: 4.2.12 Commit Hash: fa1a9da Commit Date: 16-06-2024

Database: postgresql Debug-Mode: False Deployed using Docker: True Platform: Linux-6.8.4-2-pve-x86_64-with Installer: DOC

Active plugins: [{'name': 'InvenTreeBarcode', 'slug': 'inventreebarcode', 'version': '2.0.0'}, {'name': 'InvenTreeCoreNotificationsPlugin', 'slug': 'inventreecorenotificationsplugin', 'version': '1.0.0'}, {'name': 'InvenTreeCurrencyExchange', 'slug': 'inventreecurrencyexchange', 'version': '1.0.0'}, {'name': 'InvenTreeLabel', 'slug': 'inventreelabel', 'version': '1.0.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'}, {'name': 'Wireviz', 'slug': 'wireviz', 'version': '0.6.0'}, {'name': 'WledPlugin', 'slug': 'inventree-wled-locator', 'version': '0.4.0'}, {'name': 'SupplierCart', 'slug': 'suppliercart', 'version': '0.3.1'}, {'name': 'KiCadLibraryPlugin', 'slug': 'kicad-library-plugin', 'version': '1.4.0'}]

philipp2310 commented 3 months ago

This was posted on the official InvenTree tracker as well: https://github.com/inventree/InvenTree/issues/7489

Same issue for me as well (non docker, running with 4 workers)

philipp2310 commented 3 months ago

quick fix, and dirty:

I locally modified

/opt/inventree/src/backend/InvenTree/plugin/base/locate/api.py

in lines 63 and 81 to include

force_sync=True

Surely not the perfect solution (even if done centrally by InvenTree) as locating should be done asynchronously, but it works for now

PricelessToolkit commented 3 months ago

I hope this will be fixed in the next version.

rieders commented 1 month ago

Hello

I have installed wled v 0.2.2 on my Inventree instance.

How can I upgrade it to 0.4.0?

Greetings