PrintService is no longer available

29 views
Skip to first unread message

Be the Change

unread,
Apr 6, 2024, 9:39:53 PMApr 6
to qz-print
Hi,

Is anyone aware why do I keep getting this message often ? " PrintService is no longer available".

Initially when I used to get this, I was basically restarting my computer and that used to fix this issue. Later on I tried to exist QZ tray and then open it again and it started working again. But it happens quite often when I try to use the demo page related code locally using XAMPP.

Thanks

Tres Finocchiaro

unread,
Apr 7, 2024, 10:57:38 AMApr 7
to Be the Change, qz-print
Hi,

Can you please share the logs?  You may email them directly to sup...@qz.io.

QZ Tray menu, Advanced, Diagnostic, Zip Logs to Desktop.

--
You received this message because you are subscribed to the Google Groups "qz-print" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qz-print/3a4d844c-e575-4cb2-82e3-560c78f6c618n%40googlegroups.com.

Be the Change

unread,
Apr 8, 2024, 1:48:37 PMApr 8
to Tres Finocchiaro, qz-print
OK. It happens sometimes so I will make sure to grab the logs when it happens again and sent them to the support email.

Be the Change

unread,
Apr 9, 2024, 12:39:53 PMApr 9
to Tres Finocchiaro, qz-print
So it happened again. Question - Would you like me to remove the signature content from the logs before sending it to support email?

Lite Finocchiaro

unread,
Apr 10, 2024, 1:13:59 PMApr 10
to Be the Change, Tres Finocchiaro, qz-print
Would you like me to remove the signature content from the logs before sending it to support email?

That's not necessary. We simply recommend sending sensitive information like customer data and personal addresses to us off-list so it doesn't become public.

Regards,

Lite Finocchiaro
VP, QZ Industries

Be the Change

unread,
Apr 25, 2024, 11:21:37 PMApr 25
to qz-print
I've emailed the zip file  of the logs on the support email mentioned in this thread,which is showing the following error:

java.awt.print.PrinterException: PrintService is no longer available.
at sun.print.RasterPrinterJob.setPrintService(Unknown Source) ~[?:?]
at sun.awt.windows.WPrinterJob.setPrintService(Unknown Source) ~[?:?]
at qz.printer.action.PrintPDF.print(PrintPDF.java:184) ~[qz-tray.jar:?]
at qz.utils.PrintingUtilities.processPrintRequest(PrintingUtilities.java:204) ~[qz-tray.jar:?]
at qz.ws.PrintSocketClient.processMessage(PrintSocketClient.java:311) ~[qz-tray.jar:?]
at qz.ws.PrintSocketClient.lambda$onMessage$0(PrintSocketClient.java:169) ~[qz-tray.jar:?]
at java.lang.Thread.run(Unknown Source) [?:?]


Edited the zipped file and added a fake certificate name and company name as that's irrelevant to above issue.

Tres Finocchiaro

unread,
Apr 26, 2024, 11:42:26 AMApr 26
to Be the Change, qz-print
Thanks for emailing the logs.

What's particularly interesting about them:. 
  1. The printer name, which is missing from the above copy/paste:

    Adobe PDF (redirected 3)

    Since this is a redirected printer, the queue management is usually managed by a service such as Remote Desktop, so the message may actually be accurate... a printer by that name may no longer be available on the system. 

  2. Later in the logs, the printer works, suggesting that Java may have lost reference to the PrintService.  If this is the case, we should be able to add a "retry" function.  I've filed an enhancement here:

    Add retry for when "PrintService is no longer available" #1259
    https://github.com/qzind/tray/issues/1259

  3. Last, the logs show "raw" API being used, which is unsupported for "pixel" printers such as Adobe PDF, etc.  The logs seem to suggest that you already know this, since the job data says:

    This is Box#1 description test for label printing on ZD420 printer.

    ... I don't know if this would cause the print service to restart, but I wanted to mention this, since sending data to an Adobe printer that's intended for a ZPL-capable printer is undefined behavior.  I'm sure you already know this, but just wanted to mention it.
As I'm sure you can understand, I have no way to test a code workaround, but the logs provided should be adequate to write a "retry" patch to this behavior.

I'll share a URL to the build once the patch is ready for testing.


Be the Change

unread,
Apr 26, 2024, 12:32:40 PMApr 26
to Tres Finocchiaro, qz-print
Thank you. Is it like I will have to download and install the new QZ Tray software once the patch is ready?

Tres Finocchiaro

unread,
Apr 26, 2024, 12:37:57 PMApr 26
to Be the Change, qz-print
Yes!  We'll send you the link to the new installer once the patch is ready for testing.




--
You received this message because you are subscribed to the Google Groups "qz-print" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+u...@googlegroups.com.

Tres Finocchiaro

unread,
Apr 26, 2024, 4:01:11 PMApr 26
to Be the Change, qz-print
Ok, we've managed to create a scenario that reproduces the symptom on our end.  This means we should be able to test our patch before sending the software.  Here's the bug report with exact steps to reproduce:


We'll keep you posted as to our progress.

Tres Finocchiaro

unread,
Apr 29, 2024, 10:53:18 AMApr 29
to Be the Change, qz-print
Hi,

I'd like to thank you for bringing this bug to our attention.  To our surprise, the way that Java does equality comparisons of PrintService are done using the printer's name, causing a bug in our code.
  • We cache the printers for performance reasons, but this cache was getting outdated because of a bad "equals" deep inside the Java programming language.
We have created a workaround here: https://github.com/qzind/tray/pull/1261/files.  In our tests, this fixes the scenario where a printer is removed and re-added while QZ Tray is running.

If this solution does not fix your problem, we do have one other technique that we can try which gracefully tries to find the printer again when this exception is raised.

Here's an installer that you may test:


Please let us know if this resolves your problem (I understand this issue was sporadic and that this may take several days).


Reply all
Reply to author
Forward
0 new messages