Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Label Printing fails since updating to 0.16.8 and 0.16.9 #8633

Open
2 of 6 tasks
mcsys-dev opened this issue Dec 6, 2024 · 8 comments
Open
2 of 6 tasks

Label Printing fails since updating to 0.16.8 and 0.16.9 #8633

mcsys-dev opened this issue Dec 6, 2024 · 8 comments
Labels
bug Identifies a bug which needs to be addressed report Report/Label generation

Comments

@mcsys-dev
Copy link

Please verify that this bug has NOT been raised before.

  • I checked and didn't find a similar issue

Describe the bug*

The original Setup version was probably 0.15.8. My College told me they have had printed a lot of Labels in the past, and after an update it does not work any more.

We use a Brother QL-1110NWBc for label printing.

Similar-ish issues, but not the same issue:

Image proof:

Image

Image

Image

Image

Image

Steps to Reproduce

  1. Click on a Part.
  2. To the right of the part there is a qr symbol → click on it → select "Print Label".
  3. In the "Print Label" window, → select a "Template" → select the printing Plugin "InvenTreeLabelMachine" → Select the Machine.
  4. Press "Print"
  5. You get an Error message in both UI's and nothing happens. (There is no where a real error logged. (only in "Background Tasks" under "Failed Tasks"))

Expected behaviour

The Label should get printed.

Deployment Method

  • Docker
  • Package
  • Bare metal
  • Other - added info in Steps to Reproduce

Version Information

Version Information:

InvenTree-Version: 0.16.9
Django Version: 4.2.15
Commit Hash: e0756a7
Commit Date: 30/11/2024

Database: postgresql
Debug-Mode: False
Deployed using Docker: True
Platform: Linux-6.1.0-28-amd64-x86_64-with
Installer: DOC

Active plugins: [{'name': 'InvenTreeBarcode', 'slug': 'inventreebarcode', 'version': '2.1.0'}, {'name': 'InvenTreeCoreNotificationsPlugin', 'slug': 'inventreecorenotificationsplugin', 'version': '1.0.0'}, {'name': 'InvenTreeCurrencyExchange', 'slug': 'inventreecurrencyexchange', 'version': '1.0.0'}, {'name': 'InvenTreeLabel', 'slug': 'inventreelabel', 'version': '1.1.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': 'Brother Labels', 'slug': 'brother', 'version': '1.0.0'}]

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

  • I can reproduce this bug on the demo site.

Relevant log output

Error Details

invalid literal for int() with base 10: '' : Traceback (most recent call last):

File "/root/.local/lib/python3.11/site-packages/django_q/worker.py", line 97, in worker

res = f(*task["args"], **task["kwargs"])

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/home/inventree/src/backend/InvenTree/machine/machine_types/label_printer.py", line 81, in print_labels

self.print_label(machine, label, item, **kwargs)

File "/usr/local/lib/python3.11/site-packages/inventree_brother/brother_plugin.py", line 164, in print_label

rotation = int(machine.get_setting('ROTATION', 'D')) + 90

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

ValueError: invalid literal for int() with base 10: ''
@mcsys-dev mcsys-dev added bug Identifies a bug which needs to be addressed question This is a question triage:not-checked Item was not checked by the core team labels Dec 6, 2024
@SchrodingersGat
Copy link
Member

@mcsys-dev looks like this was a bug introduced into the label printer plugin

@wolflu05
Copy link
Contributor

wolflu05 commented Dec 9, 2024

Your 5) is actually #8511

Regarding the printing driver issue. Do you have a shared cache (redis) as per requirements for the machine registry feature?

@mcsys-dev
Copy link
Author

@wolflu05

Regarding the printing driver issue. Do you have a shared cache (redis) as per requirements for the machine registry feature?

No. We use the default Docker-file, but I just noticed that the has docker-file changed. I have now added the changes so that we use the "inventree-cache". But the printing issue is still present.

I couldn't find a section in the stable Docs where requirements for features are listed. (https://docs.inventree.org/en/stable) (There is Redis still listed as disabled by default)

@wolflu05
Copy link
Contributor

wolflu05 commented Dec 9, 2024

I couldn't find a section in the stable Docs where requirements for features are listed

I agree, its a bit hidden in the developer docs (extend section).

But the printing issue is still present.

Have you also updated the env file to tell inventree to also use the cache? There are 3 env vars to add for this. If it's still not working after a docker compose down + up. Try connecting to the redis container via docker compose exec -it inventree-cache redis-cli and type MONITOR. You should see keys accessed like: :1:machine:* (e.g. :1:machine:registry:hash or :1:machine:machine:<machine-uuid>:status, when doing something with the machines, e.g. load the machine table, print, ...

@mcsys-dev
Copy link
Author

@wolflu05
I have already had updated the .env to reflect the latest change: .env

# Redis cache setup
# Refer to settings.py for other cache options
INVENTREE_CACHE_ENABLED=True
INVENTREE_CACHE_HOST=inventree-cache
INVENTREE_CACHE_PORT=6379

I can see all the different :1:machine:* events that you mentioned.
It looks to me if the cache is working as intended. If you want to see some of those entries, let me know.

@matmair matmair added report Report/Label generation and removed triage:not-checked Item was not checked by the core team question This is a question labels Dec 10, 2024
@matmair
Copy link
Member

matmair commented Dec 10, 2024

Am I understanding this right to be a duplicate of #8511 @wolflu05 ?

@wolflu05
Copy link
Contributor

Not really. There is another issue happening there, but I had no time yet to look into it. It normally should work currently but somehow it doesn't for @mcsys-dev

@mcsys-dev
Copy link
Author

I have a short update for you:
My College, who uses invenTree regularly, got the Pinter to pint labels. He told me he completely reinstalled and reconfigured (over the ui) the brother plugin and the printer's settings itself. He showed it to me. But still sometimes fails until it works. (not talking about getting both messages: error and success)

Not sure how it was before, but if the printer is in sleep he needs to be turned on manually, and you have to wait a couple of minutes before trying to print. He could not tell me if he changed anything on the printer side.

I hope this somehow helps you. My College is right now happy that he can print some labels again. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Identifies a bug which needs to be addressed report Report/Label generation
Projects
None yet
Development

No branches or pull requests

4 participants