InvenTree icon indicating copy to clipboard operation
InvenTree copied to clipboard

Label printer plugin does not work

Open HannesMorre opened this issue 1 year ago • 20 comments

Please verify that this bug has NOT been raised before.

  • [X] I checked and didn't find a similar issue

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

  • [X] Docker
  • [ ] Package
  • [ ] Bare metal
  • [x] Other - added info in Steps to Reproduce

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.

  • [ ] I can reproduce this bug on the demo site.

Relevant log output

No response

HannesMorre avatar May 16 '24 14:05 HannesMorre

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

SchrodingersGat avatar May 16 '24 23:05 SchrodingersGat

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

HannesMorre avatar May 17 '24 07:05 HannesMorre

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 ?

SergeoLacruz avatar May 17 '24 07:05 SergeoLacruz

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.

wolflu05 avatar May 17 '24 07:05 wolflu05

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.

HannesMorre avatar May 17 '24 07:05 HannesMorre

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)```

lqdmist avatar May 17 '24 07:05 lqdmist

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

HannesMorre avatar May 24 '24 07:05 HannesMorre

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

SergeoLacruz avatar May 24 '24 07:05 SergeoLacruz

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

HannesMorre avatar May 24 '24 08:05 HannesMorre

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.

SergeoLacruz avatar May 24 '24 08:05 SergeoLacruz

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

HannesMorre avatar May 24 '24 09:05 HannesMorre

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

  • the plugin is really installed in the inventree-worker container (exec into it via docker compose exec -it bash inventree-worker and then check via pip freeze | grep brother (and also for zebra)
  • the plugin is activated on the inventree instance (goto the settings > plugins, or into the Admin Center of Platform UI)

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)

wolflu05 avatar May 24 '24 11:05 wolflu05

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

SchrodingersGat avatar May 24 '24 11:05 SchrodingersGat

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

HannesMorre avatar May 24 '24 12:05 HannesMorre

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

HannesMorre avatar May 24 '24 12:05 HannesMorre

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.

wolflu05 avatar May 24 '24 12:05 wolflu05

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

lqdmist avatar May 24 '24 12:05 lqdmist

And the plugin is activated as well image

HannesMorre avatar May 24 '24 12:05 HannesMorre

@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?

SchrodingersGat avatar May 27 '24 09:05 SchrodingersGat

@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 avatar Aug 11 '24 18:08 matmair

@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

matmair avatar Nov 12 '24 11:11 matmair

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.

HannesMorre avatar Nov 12 '24 12:11 HannesMorre

Closing this out due to lack of activity

SchrodingersGat avatar Oct 31 '25 21:10 SchrodingersGat