OpenPrinting / cups

OpenPrinting CUPS Sources
https://openprinting.github.io/cups
Apache License 2.0
1.05k stars 187 forks source link

Printer Blocked errors when using CUPS with Jet direct enabled printers #808

Closed ishanjain28 closed 8 months ago

ishanjain28 commented 11 months ago

Describe the bug

When I try to print a image or a PDF(Unprotected PDFs, No password or DRM on them) from my android phones, I get this message,

Printer Blocked <> Not encrypted

I can retry a few times and then it says,

This printer can no longer accepts encrypted jobs. Continue Printing?

If I click Continue, It prints perfectly every time. image

I don't know why it says downloadfile.bin. It was a an image sent to me on whatsapp. I clicked on the share button and then print. Maybe that's the name for the temporary file.

To Reproduce

I am using CUPS with a Epson M205 Printer which only supports the HP Jetdirect protocol, no native IPP.

Steps to reproduce the behavior:

  1. Try to print any image or unprotected PDF on android
  2. See Error
  3. Keep clicking retry a few times until it shows the other warning and gives the option to continue printing any way.
  4. Click continue printing
  5. every thing works!

This happens on android 12 to android 14. Please let me know if you'd like version information of some other specific component.

Expected behavior

It should not show this warning and print correctly the first time.

System Information:

Additional context

Logs from cupsd from the first moment when I tried to print this to the end till it printed it successfully. cups.log

Context:

zdohnal commented 10 months ago

Hi,

I see in the logs only two attempts for encrypted communication:

D [24/Oct/2023:15:15:09 +0530] [Client 3791] Server address is "10.0.70.7".
D [24/Oct/2023:15:15:09 +0530] [Client 3791] Accepted from 10.0.10.28:37984 (IPv4)
D [24/Oct/2023:15:15:09 +0530] [Client 3791] Waiting for request.
D [24/Oct/2023:15:15:09 +0530] [Client 3791] Connection now encrypted.
D [24/Oct/2023:15:15:09 +0530] [Client 3791] HTTP_STATE_WAITING Closing for error 32 (Broken pipe)
D [24/Oct/2023:15:15:09 +0530] [Client 3791] Closing connection.
D [24/Oct/2023:15:15:09 +0530] cupsdSetBusyState: newbusy="Not busy", busy="Active clients"
D [24/Oct/2023:15:15:09 +0530] [Client 3791] Waiting for socket close.
D [24/Oct/2023:15:15:09 +0530] [Client 3791] Closing on EOF.
D [24/Oct/2023:15:15:09 +0530] [Client 3791] Closing connection.

and

D [24/Oct/2023:15:15:09 +0530] [Client 3792] Server address is "10.0.70.7".
D [24/Oct/2023:15:15:09 +0530] [Client 3792] Accepted from 10.0.10.28:37986 (IPv4)
D [24/Oct/2023:15:15:09 +0530] [Client 3792] Waiting for request.
D [24/Oct/2023:15:15:09 +0530] [Client 3792] OPTIONS * HTTP/1.1
D [24/Oct/2023:15:15:09 +0530] cupsdSetBusyState: newbusy="Active clients", busy="Active clients"
D [24/Oct/2023:15:15:09 +0530] [Client 3792] Read: status=200, state=0
D [24/Oct/2023:15:15:09 +0530] [Client 3792] No authentication data provided.
D [24/Oct/2023:15:15:09 +0530] [Client 3792] cupsdSendHeader: code=101, type="(null)", auth_type=0
D [24/Oct/2023:15:15:09 +0530] [Client 3792] Connection now encrypted.
D [24/Oct/2023:15:15:09 +0530] [Client 3792] cupsdSendHeader: code=200, type="(null)", auth_type=0
D [24/Oct/2023:15:15:09 +0530] cupsdSetBusyState: newbusy="Not busy", busy="Active clients"
D [24/Oct/2023:15:15:09 +0530] [Client 3792] HTTP_STATE_WAITING Closing for error 32 (Broken pipe)
D [24/Oct/2023:15:15:09 +0530] [Client 3792] Closing connection.
D [24/Oct/2023:15:15:09 +0530] cupsdSetBusyState: newbusy="Not busy", busy="Not busy"
D [24/Oct/2023:15:15:09 +0530] [Client 3792] Waiting for socket close.
D [24/Oct/2023:15:15:09 +0530] [Client 3792] Closing on EOF.
D [24/Oct/2023:15:15:09 +0530] [Client 3792] Closing connection.

and both are cut from the Android side (broken pipe errors). Every other communication before and after those two clients is via plain IPP, because the uri used in requests is ipp://10.0.70.7:631/printers/EpsonM205.

Does Android see IPPS destination which is shared from CUPS? You can check it via an application for browsing mDNS communication.

It seems like Android tries to set encryption, but it does not do correctly. Here is the log when encryption works:

Nov 24 09:01:45 default-0 cupsd[1961]: [Client 3] Server address is "192.168.122.168".
Nov 24 09:01:45 default-0 cupsd[1961]: [Client 3] Accepted from 192.168.122.232:49552 (IPv4)
Nov 24 09:01:45 default-0 cupsd[1961]: [Client 3] Waiting for request.
Nov 24 09:01:45 default-0 cupsd[1961]: [Client 3] Connection now encrypted.
Nov 24 09:01:45 default-0 cupsd[1961]: [Client 3] POST /printers/test HTTP/1.1
Nov 24 09:01:45 default-0 cupsd[1961]: cupsdSetBusyState: newbusy="Active clients and dirty files", busy="Active clients and dirty files"
Nov 24 09:01:45 default-0 cupsd[1961]: [Client 3] Read: status=200, state=6
Nov 24 09:01:45 default-0 cupsd[1961]: [Client 3] No authentication data provided.
Nov 24 09:01:45 default-0 cupsd[1961]: [Client 3] 2.0 Get-Printer-Attributes 1
Nov 24 09:01:45 default-0 cupsd[1961]: Get-Printer-Attributes ipps://linux.local:631/printers/test
Nov 24 09:01:45 default-0 cupsd[1961]: [Client 3] Returning IPP successful-ok for Get-Printer-Attributes (ipps://linux.local:631/printers/test) from 192.168.122.232.

and here are the shared IPPS destination (there are other 3 - IPP IP4, IPPS IP6 and IPP IP6):

=   eth0 IPv4 test @ linux                                  _ipps._tcp           local
   hostname = [linux.local]
   address = [192.168.122.168]
   port = [631]
   txt = ["printer-type=0x80304E" "Copies=T" "Color=T" "mopria-certified=1.3" "URF=V1.4,CP1,W8,PQ4,SRGB24,RS300,FN3" "TLS=1.2" "UUID=685fa3ab-7114-3683-4b7c-bedfed537be9" "pdl=application/pdf,application/postscript,image/jpeg,image/png,image/pwg-raster,image/urf" "product=(PostScript Printer)" "priority=0" "adminurl=https://linux.local.:631/printers/test" "ty=Generic PostScript Printer" "rp=printers/test" "qtotal=1" "txtvers=1"]
zdohnal commented 8 months ago

No response for nearly two months - closing for now, feel free to reopen once you provide the requested info.