inventree / InvenTree

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

Label printer plugin does not work #7245

Open HannesMorre opened 6 months ago

HannesMorre commented 6 months ago

Please verify that this bug has NOT been raised before.

Describe the bug*

We installed the inventree-zebra-plugin and it seems to have been installed correctly, but when we try to print a label we get this error:

Plugin registry has no record of plugin 'zebra'
Could not find matching plugin for 'zebra'

This is the plugins.txt file: image

And the config: image

The plugin was installed through the settings page first, but we also tried to install it with pip install.

Steps to Reproduce

  1. install the plugin from the plugin settings window with package name: inventree-zebra-plugin
  2. try to print a label

Expected behaviour

The label is printed from the zebra printer.

Deployment Method

Version Information

Version Information:

InvenTree-Version: 0.14.4 Django Version: 4.2.11 Commit Hash: 35fc954 Commit Date: 2024-03-22

Database: postgresql Debug-Mode: False Deployed using Docker: True Platform: Linux-5.10.0-28-amd64-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': 'SupplierCart', 'slug': 'suppliercart', 'version': '0.4.0'}, {'name': 'RapidocPlugin', 'slug': 'inventree-rapidoc', 'version': '1.1'}, {'name': 'Zebra', 'slug': 'zebra', 'version': '0.5.2'}]

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

Relevant log output

No response

SchrodingersGat commented 6 months ago

Are you trying to print via the web interface? Or via an external API call? Where are you seeing the error message.

HannesMorre commented 6 months ago

Yes we are trying to print from the web interface and the error message comes from the inventree worker

SergeoLacruz commented 6 months ago

Hmmm... I have seen this already some time ago but I do not exactly remember the reason.The issue was solved. May be something like https://github.com/inventree/InvenTree/issues/3878 ?

wolflu05 commented 6 months ago

It could be that the printer plugin is simply not installed on the worker, therefore the plugin cannot be found when the worker is trying to load it.

HannesMorre commented 6 months ago

I noticed however that yesterday the label was not printed, so I tried to download the label in pdf format and send this to the printer. this however did not work either. The weird thing is that today when I arrived at work, there is a label printed and no one knows how.

lqdmist commented 6 months ago

I am a co-worker of @HannesMorre. The plugin seems to be installed on the worker:


/home/inventree # pip3 install inventree-zebra-plugin
Requirement already satisfied: inventree-zebra-plugin in /usr/local/lib/python3.11/site-packages (0.5.2)
Requirement already satisfied: zpl>=0.1.11 in /usr/local/lib/python3.11/site-packages (from inventree-zebra-plugin) (0.1.11)
Requirement already satisfied: Pillow in /root/.local/lib/python3.11/site-packages (from zpl>=0.1.11->inventree-zebra-plugin) (10.2.0)```
HannesMorre commented 6 months ago

@SchrodingersGat @wolflu05 @SergeoLacruz Anything else that can be done here?

SergeoLacruz commented 6 months ago

Try to install the brother printer. This is very similar and should work. I cannot reproduce it here

HannesMorre commented 6 months ago

so the brotherprinter plugin should work with the zebra printer? Because we do not have a network connected brother printer 😅

SergeoLacruz commented 6 months ago

Of course not. But the brother plugin should at least properly start and send the print somewhere.... You will see an error in the log if the printer cannot be reached. But that is OK for this test.

HannesMorre commented 6 months ago
inventree-worker  | 2024-05-24T09:20:06.065477270Z Plugin registry has no record of plugin 'brother'
inventree-worker  | 2024-05-24T09:20:06.065638119Z Could not find matching plugin for 'brother'

Still happening

wolflu05 commented 6 months ago

Sorry, it's really hard, I cannot reproduce this. Are you sure, that:

If all of the above is true, please enable debug logs and provide the full log output from the server and the worker container (redact any sensitive values)

SchrodingersGat commented 6 months ago

This will be

A) potentially hard to track down and debug B) crucial that we do understand what is going on

Please try and provide the log / debug information as requested by @wolflu05 above. I don't have any time right now to look into this but if it is still open next week I can jump in and try to reproduce

HannesMorre commented 6 months ago

Could https://github.com/inventree/InvenTree/pull/6733 be a possible fix?

HannesMorre commented 6 months ago

@lqdmist can you provide the requested logs/debug information?

wolflu05 commented 6 months ago

Could #6733 be a possible fix?

That was already back ported to 0.14.3, and from the initial comment it seems that you are already using 0.14.4.

lqdmist commented 6 months ago

The plugins are installed in the worker container:

tcit@docker:/opt/deployment/inventree$ docker exec -it inventree-worker ash
/home/inventree # pip freeze | grep brother
brother-ql-inventree==1.1
inventree-brother-plugin==0.9.0
/home/inventree # pip freeze | grep zebra
inventree-zebra-plugin==0.5.2
HannesMorre commented 6 months ago

And the plugin is activated as well image

SchrodingersGat commented 6 months ago

@HannesMorre I have just rolled back to 0.14.4 and installed the zebra plugin. With the background worker running, I get the following error message:

image

This indicates that the plugin code is running.

Have you tried stopping and restarting the "background worker" docker container?

matmair commented 3 months ago

@HannesMorre can you please validate that this is still happening with current versions? I would like/move this issue if not so we can release 0.16.0

matmair commented 1 week ago

@HannesMorre @lqdmist can either of you please confirm this is still happening on the current release?

@SchrodingersGat I would close this with the 0.17.x release if there is no response as the last reproduction is on 0.14.4

HannesMorre commented 1 week ago

Sorry for leaving you in the dark on this @matmair. We have a lot of other things going on here. I will try to test again this week with the last update and keep you posted on the result.