OpenPrinting / cups

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

Airprint missing paper size and finishing options on iPadOS 16 #738

Closed csfjeff closed 7 months ago

csfjeff commented 1 year ago

Describe the bug On iPadOS when I call up a print dialog and select a CUPS Airprint queue the dialog would present options for choosing paper size and finishing options. These no longer appear in iPadOS 16. They do appear no problem if I choose a real Airprint printer, so there seems to be 2 parts to this - Apple has changed something about how they parse those options and CUPS seems likely to be missing something that a real Airprint queue does have.

To Reproduce Steps to reproduce the behavior:

  1. On iPad with OS 16 installed choose to print a document, select a printer that is a CUPS Airprint queue 2 The print dialog does not contain the Paper size selector, or the Finishing Options selector.

Expected behavior On iOS 15 the missing options are presented, and on iOS 16 pointed at a real Airprint printer shows the expected options. It's only the combination of iPadOS 16 and a CUPS queue.

Screenshots Added screenshot of iPadOS 15 vs 16 print dialog, with missing options circled in red. Our devices are in French so screen shot is in French, but the missing dialogs would be Paper size and Finishing options.

System Information:

Additional context

Results of IPP get-printer-attributes.test command I have attached text files that are the result of running a get-printer-attributes.test command to compare the differences between a CUPS queue response and an Airprint printer response.

I did spend a bunch of time pouring over the differences, and white there are quite a few differences, there are a couple that jumped out to me:

DNS-SD records to compare Results of a dns-sd -Z _ipp._tcp,_universal command to browse the Airprint record. TEST-Techno-B8155 is the CUPS 2.4.5 queue and BUR-Techo-Direct is the direct Airprint printer queue.

_ipps._tcp                                      PTR     TEST-Techno-B8155._ipps._tcp
TEST-Techno-B8155._ipps._tcp                    SRV     0 0 631 cups-tester.airprint.csf.bc.ca. ; Replace with unicast FQDN of target host
TEST-Techno-B8155._ipps._tcp                    TXT     "txtvers=1" "qtotal=1" "rp=/printers/TEST-Techno-B8155" "note=TEST-Techno-B8155" "pdl=application/pdf,application/postscript,image/jpeg,image/png,image/pwg-raster,image/tiff,image/urf" "product=(AltaLink B8155 - IPP Everywhere)" "ty=AltaLink B8155 - IPP Everywhere" "priority=0" "adminurl=http://cups-tester.airprint.csf.bc.ca:631/printers/TEST-Techno-B8155" "UUID=3f10235a-ec4d-32cc-673b-09bbbfc4fab6" "TLS=1.2" "URF=CP255,DM1,FN3-4-5-14-20-21-22-23-28-29-30-31-74-75-76-77-78-79-80-81,IFU1-2-3-4-5,IS1-2-3-4-5,MT2-3-4-5-6,OB1-2-3-4,PQ3-4-5,RS600-1200,V1.4,W8" "Binary=T" "Transparent=T" "TBCP=F" "kind=document,envelope,label" "Bind=F" "Collate=T" "Color=F" "Copies=T" "Duplex=T" "Punch=3" "PaperCustom=T" "PaperMax=>isoC-A2" "Sort=T" "Staple=T" "AIR=username,password" "usb_MFG=Xerox" "usb_MDL=AltaLink B8155" "Scan=F" "Fax=F" "print_wfds=T" "mopria-certified=2.1"

_ipp._tcp                                       PTR     BUR-Techno-Direct._ipp._tcp
BUR-Techno-Direct._ipp._tcp                     SRV     0 0 631 BUR-B8155-Techno.local. ; Replace with unicast FQDN of target host
BUR-Techno-Direct._ipp._tcp                     TXT     "txtvers=1" "qtotal=1" "rp=ipp/print" "note=Bureau CSF - Richmond" "pdl=application/postscript,application/vnd.hp-PCL,application/pdf,image/tiff,image/jpeg,application/PCLm,image/pwg-raster,image/urf" "product=(Xerox AltaLink B8155)" "ty=Xerox AltaLink B8155" "priority=8" "adminurl=http://BUR-B8155-Techno.csf.bc.ca.local./protocols/airprint.php" "UUID=223527f4-11f6-11ec-aba3-e649401e6b30" "TLS=1.2" "URF=CP255,DM1,FN3-4-5-14-20-21-22-23-28-29-30-31-74-75-76-77-78-79-80-81,IFU1-2-3-4-5,IS1-2-3-4-5,MT2-3-4-5-6,OB1-2-3-4,PQ3-4-5,RS600-1200,V1.4,W8" "rfo=ipp/faxout" "usb_MFG=Xerox" "usb_MDL=AltaLink B8155" "Binary=T" "Transparent=T" "TBCP=F" "kind=document,envelope,label" "Bind=F" "Color=F" "Collate=T" "Copies=T" "Duplex=T" "Punch=3" "PaperCustom=T" "PaperMax=>isoC-A2" "Sort=T" "Staple=T" "Scan=T" "Fax=T" "print_wfds=T" "mopria-certified=2.1"

iPadPrintDialogs

ipp-attributes-cups.txt ipp-attributes-printer.txt

zdohnal commented 1 year ago

Hi @michaelrsweet ,

can you look into it once you have a time? I don't have iPad to properly play with this...

dkosovic commented 1 year ago

I can confirm I have the same behavior with iOS/iPadOS 16.5.1.

I've attached Wiresharp IPP filtering between iOS 16.5.1 and CUPS 2.4.5 involving two Get-Printer-Attributes requests and the corresponding responses.

iOS-16.5.1-Wireshark.txt

csfjeff commented 1 year ago

Kinda getting stressed out here - our 3000+ school iPads were just updated over the summer so now it looks like all my users are going to be coming back to printers that have lost functionality over the summer - my poor help desk is going to be overwhelmed :(. Has there been any research to see what's going on here? Or advice on ways we might be able to mitigate?

michaelrsweet commented 1 year ago

@csfjeff Sorry, I've been neck-deep in a bunch of projects and haven't had a chance to properly look at this, although it could end up being an issue with iOS since the change in behavior happened with the new iOS version... Everything in the provided attribute dumps looks correct, with the only significant difference being that the CUPS media-col-ready attribute doesn't show media-source or media-type values, but that is common for AirPrint servers so iOS shouldn't care.

csfjeff commented 1 year ago

Yeah, the issue definitely starts with iOS 16 for sure (haven't had a chance to test iOS 17 yet), so Apple is definitely doing something different. I've tested it against a couple of real Airprint printers I have access to (Brother personal and Xerox multifunction copiers) and seeing no issues with the real printers. I'm guessing here, but seems likely Apple decided to be very strict about how they are parsing the Airprint queues, and CUPS isn't quite matching what Apple wants to see.

michaelrsweet commented 1 year ago

OK, so I've done some initial testing - CUPS 2.4.1 from Ubuntu 22.04 LTS seems to work just fine with iOS 16. There are some minor differences between the attributes reported by 2.4.1 and current 2.4.6, so I'm going to bisect things until I find the change that caused this regression.

michaelrsweet commented 1 year ago

OK, so my issue with CUPS 2.4.6 seemed to be missing (input) filters for "image/urf". I've fixed that for my test server and now I am able to choose paper sizes as expected.

What driver are you using on the CUPS side of things?

csfjeff commented 1 year ago

Sorry for slow reply - in about 95% of my cases, CUPS is setup direct to IPP Everywhere queues. We're mostly using Xerox Altalink copiers and a few other misc HP and Xerox printers that are also IPP Everywhere. We do a have a very few number of older printers that require drivers but I'm trying to phase those out to standardize on IPP Everywhere.

michaelrsweet commented 1 year ago

OK, so are you forcing everyone to go through the CUPS server for accounting, access control, etc? If they are IPP Everywhere then they are almost certainly AirPrint already, so unless you need accounting or access control you are better off using DNS to provide addresses and SRV/TXT records...

csfjeff commented 1 year ago

That's correct, we're using PaperCut to track printing and do accounting.

csfjeff commented 1 year ago

I'm trying to test CUPS 2.4.1 on Ubuntu 22.04 myself, and sadly not having any success with Paper Sizes. When I first select "Print" the dialog that pops up has a paper size option shown, but once I select one of the actual CUPS Airprint queues it goes away :(.

dkosovic commented 1 year ago

I have the issue with iOS 16.6 and CUPS 2.4.5 when using static-DNS to provide addresses and SRV/TXT records.

When using CUPS 2.4.6 and multicast DNS, I'm not able to reproduce the issue with iOS 16.6.

I've got to update the former to CUPS 2.4.6 and also check if I've missed something with the static-DNS.

csfjeff commented 1 year ago

@dkosovic - Were you able to dig anymore into that? I also am using static-DNS SRV/TXT records so would definitely be curious if I'm missing something.

dkosovic commented 1 year ago

I used the macOS rvictl utility that comes with Xcode to do a tcpdump on my home network of my iPhone USB connected to a MacBook where iOS 16.6 is doing the right thing with CUPS 2.4.6.

Find iPhone-Wireshark.txt attached of the interesting mDNS packets. Ideally, I should have toggled the iPhone AirPlane mode first to flush the DNS cache before doing the tcpdump, but nonetheless don't think anything useful was lost. Note: the print queue is called print01 and linux is the hostname of the VM I used for CUPS 2.4.6.

From that output, looks like the following are used with iOS 16.6:

Interesting how _printer._tcp is used, but _print._sub._ipp._tcp and _cups._sub._ipp._tcp (along with *._ipps.* counterparts) aren't with iOS 16.6. I haven't been providing _printer._tcp in my Wide Area Bonjour SRV/TXT records.

Here is an extract from macOS dns-sd utility :

_printer._tcp                                   PTR     print01\032@\032linux._printer._tcp
print01\032@\032linux._printer._tcp             SRV     0 0 0 linux.local. ; Replace with unicast FQDN of target host
print01\032@\032linux._printer._tcp             TXT     ""

Extract from Bonjour Printing Specification Version 1.2.1 :

If the printer only supports IPP it MUST register the IPP service type and then assert that LPD is not supported by registering the LPD service type (_printer._tcp) with a port number of 0.

I haven't done any testing yet with modified Wide Area Bonjour SRV/TXT records, but will be trying _printer._tcp with port number of 0.

dkosovic commented 1 year ago

I upgraded to CUPS 2.4.6 and added _printer._tcp SRV/TXT DNS records, but still no luck with iOS 16.6. It didn't even appear to be querying _printer._tcp SRV/TXT records like it does with mDNS.

I'm going to try and force CUPS 2.4.6 on my home network to use ipp instead of ipps, which will help with the wireshark debugging and compare it to my workplace that is using Wide Area Bonjour.

michaelrsweet commented 1 year ago

@dkosovic Does your cupsd.conf file have any BrowseDNSSDSubTypes lines in it?

You can try adding:

BrowseDNSSDSubTypes _cups,_universal,_print

This is the default value with stock CUPS but the "_universal" part is critical for iOS to see your printer.

dkosovic commented 1 year ago

On my home network where iOS 16.6 works correctly with CUPS 2.4.6 (I just created a dummy print queue and used the same IPP Everywhere generated PPD file from work that I've been testing against), although cupsd.conf doesn't explicitly have a BrowseDNSSDSubTypes line, I can confirm _cups, _universal, and _print subtypes are being advertised.

On my home network, I rebuilt the Fedora 38 cups-2.4.6 RPM by replacing --with-tls=gnutls with --without-tls to force it to use ipp instead of ipps. iOS 16.6 still works correctly, I couldn't see anything obviously different in the wireshark analysis when comparing to my workplace (apart from mDNS packets being replaced with DNS).

At my workplace, I forgot to add the _print subtype in the DNS zone file, anyway, here is the latest iteration of what I am using (to simplify debugging, I don't have corresponding _ipps records for this queue) :

_ipp._tcp                    PTR     lpHC301._ipp._tcp
_cups._sub._ipp._tcp         PTR     lpHC301._ipp._tcp
_universal._sub._ipp._tcp    PTR     lpHC301._ipp._tcp
_print._sub._ipp._tcp        PTR     lpHC301._ipp._tcp
lpHC301._ipp._tcp            SRV     0 0 631 cups-test.eait.uq.edu.au.
lpHC301._ipp._tcp            TXT     "rp=printers/lpHC301" "note=Hawken room C301" "pdl=application/pdf,application/postscript,image/jpeg,image/png,image/pwg-raster,image/urf" "air=none" "UUID=07595a3b-3d15-3f64-6664-f43c4e8f10da" "TLS=1.2" "Color=F" "Duplex=T" "Staple=T" "PaperMax=tabloid-A3" "printer-type=0xB076" "URF=V1.4,CP1,W8,PQ4,RS600,DM1,FN30-29-28-22-20"

In my last attempt, I removed any key/value pairs that are described as not mandatory for IPP or IPPS in the Bonjour Printing Specification Version 1.2.1 I also added PaperMax=tabloid-A3, but none had any effect.

I don't have any iOS or iPadOS users that need to print on anything other than A4 or use the finishing options. Fortunately, macOS is fine and doesn't have the same issue.

csfjeff commented 1 year ago

I don't have any iOS or iPadOS users that need to print on anything other than A4 or use the finishing options. Fortunately, macOS is fine and doesn't have the same issue.

Sadly I have about 4000 of them that are about to all fire up for the new school year - starting to feel a bit desperate here. Anything I can do to help test?

dkosovic commented 1 year ago

I've finally got paper size and finishing working correctly with iOS 16.6 and static DNS SRV/TXT records. The trick is to use the exact same order for the key/value pairs in the TXT record as what CUPS 2.4.6 is advertising over mDNS.

To simplify things, I removed key/value pairs that the Bonjour Printing Specification Version 1.2.1 says are deprecated for IPP and IPPS, my final TXT record in DNS has:

"rp=printers/lpHC301" "adminurl=https://cups-test.eait.uq.edu.au:631/printers/lpHC301" "note=Hawken room C301" "pdl=application/pdf,application/postscript,image/jpeg,image/png,image/pwg-raster,image/urf" "UUID =4a7d03f3-1d39-3846-57de-36f84592787d" "TLS=1.2" "URF=V1.4,CP1,W8,PQ3-4,RS600,DM1,FN30-29-28-22-20" "mopria-certified=1.3" "Duplex=T" "Staple=T" "Copies=T" "printer-type=0xB076"

csfjeff commented 1 year ago

Good find @dkosovic, that almost gets me going...

I can confirm that iOS 16.5 & 16.6 now presents the paper sizes and finishing options after matching my static DNS records to what CUPS advertises by default...

Except (and this is a big one) as soon as I turn the print authentication options on it breaks again...

The only difference I can see is that CUPS adds an entry for "air=username,password" to the mdns advertisement, and that single extra entry seems to be enough to break the iOS printing again. Ugh :(.

"txtvers=1" "qtotal=1" "rp=printers/CUPS-Techno-Test" "ty=AltaLink B8155 - IPP Everywhere" "adminurl=https://cups-test.local.:631/printers/CUPS-Techno-Test" "note=CUPS-Techno-Test" "priority=0" "product=(AltaLink B8155)" "pdl=application/pdf,application/postscript,image/jpeg,image/png,image/pwg-raster,image/urf" "air=username,password" "UUID=2f678fb7-5060-3bb1-681c-146b6f0e1e0c" "TLS=1.2" "URF=V1.4,CP1,W8,PQ3-4-5,RS600,DM1,FN81-80-79-78-77-76-75-74-31-30-29-28-23-22-21-20" "mopria-certified=1.3" "Duplex=T" "Staple=T" "Copies=T" "Punch=T" "printer-type=0x40B176"

csfjeff commented 1 year ago

In fact, I reverted to my original static DNS entry and then just removed the air=username,password entry and everything works (except accounting of course)... Starting to think this is specifically a bug on Apple's part with dealing with Airprint printers that require authentication.

csfjeff commented 1 year ago

I'm not 100% confident I did it correctly, but I also tried enabling authentication on a direct Airprint queue from our Xerox Altalink, and as soon as that air=username,password option comes up, the paper size and finishing options disappear.

dkosovic commented 1 year ago

I was using air=none in my earlier iterations (when I disabled authentication and removed ipps DNS records) and it wasn't working properly with iOS 16, so looks like it only works properly when the air attribute isn't advertised at all.

I agree, looks like an Apple bug.

csfjeff commented 1 year ago

Ugh, sadly I haven't had tonnes of luck getting Apple to fix bugs that I've reported, but here goes.

michaelrsweet commented 1 year ago

@csfjeff You might be running into a limit on the size of the TXT record - try removing "printer-type" and limit "pdl" to "pdl=application/pdf,image/jpeg,image/urf,image/pwg-raster" (the common AirPrint/IPP Everywhere/Mopria formats). You also don't need the "Copies=T".

dkosovic commented 1 year ago

Using the printer-type and pdl suggestions, the following 289 byte TXT record (which is well within the recommended 512 byte limit) and putting air=username,password at the front unfortunately still doesn't work correctly with iOS 16 :

"air=username,password" "rp=printers/lpHC301" "note=Hawken Building room C301" "pdl=application/pdf,image/jpeg,image/urf,image/pwg-raster" "UUID=4a7d03f3-1d39-3846-57de-36f84592787d" "TLS=1.2" "URF=V1.4,CP1,W8,PQ3-4,RS600,DM1,FN30-29-28-22-20" "mopria-certified=1.3" "Duplex=T" "Staple=T"

dkosovic commented 1 year ago

iOS 17 seems to have fixed the paper size and finishing options not appearing when air=username,password is in the mDNS advertisement (in my case when using CUPS 2.4.6).

I'm not able to find any printers with iOS 17 when using Wide Area Bonjour, but think that is more likely an eduVPN issue with iOS 17, tcpdump indicates none of the necessary (unicast) DNS queries for Wide Area Bonjour are occurring on my iPhone.

csfjeff commented 1 year ago

@dkosovic - Just installed iPad OS 17.0 to test, and can confirm that Airprint is generally messed up - I do have 2 of our office copiers set to broadcast Airprint/mDNS and they are sometimes, intermittently showing up. But none of our DNS-SD based Airprint printers are appearing - these are ones that are discovered via a DHCP provided DNS search scope. So I don't think it's just you're eduVPN environment.

csfjeff commented 1 year ago

Sadly iPadOS 17.0.1 also does not find DNS-SD based Airprint printers. It sometimes finds my mDNS queues, but it takes a long time for them to show up, and they seem to appear and disappear randomly.

csfjeff commented 1 year ago

@dkosovic - Just curious if you were able to find any more details about the iPadOS 17 not browsing dns-sd print records? I've filed a bug with Apple on that and have been faithfully testing very iPadOS 17 beta to come out and so far no luck on my end. But I'm not sure how to debug that at the network / tcpdump level.

dkosovic commented 1 year ago

On my iPhone with iOS 17, it appeared it wasn't doing any DNS queries for b._dns-sd._udp or lb._dns-sd._udp, I haven't looked at the issue further.

I guess a workaround to sidestep the wide-area AirPrint not working issue with iOS 17 could be, either pushing the AirPrint MDM payload settings with JAMF or similar, or use Apple Configurator to add the print queues to the iPhone/iPad, see:

It's not that difficult to use Wireshark to analyze the network packets from an iPad or iPhone. just need a USB cable and a mac with Xcode and Wireshark installed, see:

To make things easier to read, the Wireshark filer I used was:

ip.addr==224.0.0.251 or dns or http

where 224.0.0.251 is the mDNS traffic, dns is obvious and http because IPP is an extension of the HTTP protocol and Wireshark will provide both the HTTP and IPP analysis.

As ipps packets are encrypted, Wireshark isn't able to do much analysis for those packets, so when debugging, I usually only advertise the ipp SRV records and not the ipps. But that is a moot point for this wide-area AirPrint not working issue as it doesn't get far enough to produce any ipp or ipps packets.

Between tcpdump captures, you can toggle the airplane mode button to flush the DNS cache.

csfjeff commented 1 year ago

Just 2 notes as an update to this - iPad OS 17.2 beta seems to resolve not being able to browse DNS-SD advertised queues, so hopefully once that's released the worst of this will be behind us.

Sadly, as far as iPad OS 16 goes (which is what we have on our 4000+ iPads) I've filed bugs with Apple and updated it numerous times with more details and testing against new versions of iPad OS 16 but I'm about 98% certain nobody at Apple ever reads any of the bug reports - ugh. We mostly have Xerox multifunction copiers, and our iPads are all in French - so the default paper size the iPads send is A6, which our copiers won't print, so the poor things get overloaded with queued jobs 'waiting for resources', and frustrated users wondering why their print jobs never come out of the printer.

Hopefully Apple will get their act together soon!

dkosovic commented 1 year ago

We mostly have Xerox multifunction copiers, and our iPads are all in French - so the default paper size the iPads send is A6, which our copiers won't print,

Oh wow, I didn't know about that A6 bug, in my case with en_AU language on iOS 16, it would default to A4 and print on A4 printers no problem.

With issue https://github.com/apple/cups/issues/6009 iOS users have reported that A6 was incorrectly being selected instead of the default PageSize.

I wonder in this case with fr_CAiPadOS 16 wide-area AirPrint, if Lettre is incorrectly being supplied for the print job instead of na_letter_8.5x11in (or even the older PPD Letter value), resulting in the CUPS server not knowing what to select and falling back to A6. Do you see Lettre being used in the CUPS error log for the print jobs?

csfjeff commented 1 year ago

Yeah, I'm definitely pulling out my hair on this - so frustrating. I dug around in some job logs and looks like the iPad is definitely requesting A6, which seems like a really wierd size to be requesting. This is from an iPad on 16.3 I think, printing an 8.5x11" document from Pages, so seems very odd to default to A6.

D [07/Nov/2023:13:14:10 -0800] [Job 96925] argv[5]="print-scaling=auto-fit print-color-mode=monochrome print-quality=4 sides=one-sided job-uuid=urn:uuid:e71562f3-76de-3b2c-7f55-23bb4f7a7926 job-originating-host-name=172.18.0.2 date-time-at-creation= date-time-at-processing= time-at-creation=1699391649 time-at-processing=1699391650 ColorModel=Gray cupsPrintQuality=Normal Duplex=None InputSlot=Auto media=A6 PageSize=A6"

michaelrsweet commented 1 year ago

@csfjeff The "media" value of "A6" would never be sent by an iOS client, which will always send media-col. Can you look at the corresponding Create-Job logging to see what is in the request? I wonder if some default on the CUPS side is overriding what the iOS client sends?

csfjeff commented 1 year ago

Hmmm, I'm not 100% certain how to look at the Create-Job logging, but I do see a section further on the logs that shows the create-job IPP command that I've included below:

[Job 96925] Create-Job IPP/2.0
[Job 96925] printer-uri=\"ipp://10.5.8.60:631/ipp/print\"
[Job 96925] requesting-user-name=\"jeff_dyck\"
[Job 96925] job-name=\"Print-test-template-MacOS\"
[Job 96925] Adding standard IPP operation/job attributes.
[Job 96925] IPP/2.0 Create-Job #4
[Job 96925] ---- operation-attributes-tag ----
[Job 96925] attributes-charset charset utf-8
[Job 96925] attributes-natural-language naturalLanguage en-us
[Job 96925] printer-uri uri ipp://10.5.8.60:631/ipp/print
[Job 96925] requesting-user-name nameWithoutLanguage jeff_dyck
[Job 96925] job-name nameWithoutLanguage Print-test-template-MacOS
[Job 96925] ---- job-attributes-tag ----
[Job 96925] job-accounting-user-id nameWithoutLanguage jeff_dyck
[Job 96925] media-col collection {media-size={x-dimension=10500 y-dimension=14800} media-source=auto media-left-margin=200 media-right-margin=200 media-top-margin=400 media-bottom-margin=200}
[Job 96925] output-bin keyword auto
[Job 96925] print-color-mode keyword auto-monochrome
[Job 96925] print-quality enum normal
[Job 96925] sides keyword one-sided
[Job 96925] multiple-document-handling keyword separate-documents-collated-copies
[Job 96925] finishings enum none
[Job 96925] ---- end-of-attributes-tag ----
[Job 96925] Queued job needs resources.
[Job 96925] update_reasons(attr=1(media-needed), s=\"(null)\")
[Job 96925] Get-Printer-Attributes: successful-ok-ignored-or-substituted-attributes (successful-ok-ignored-or-substituted-attributes)
[Job 96925] ---- operation-attributes-tag ----
[Job 96925] attributes-charset charset utf-8
[Job 96925] attributes-natural-language naturalLanguage en
[Job 96925] ---- unsupported-attributes-tag ----
[Job 96925] cups-version unsupported unsupported
[Job 96925] marker-message unsupported unsupported
[Job 96925] ---- printer-attributes-tag ----
[Job 96925] compression-supported keyword none
[Job 96925] copies-supported rangeOfInteger 1-9999
[Job 96925] document-format-supported 1setOf mimeMediaType application/octet-stream,application/vnd.hp-PCL,text/plain,image/urf,image/pwg-raster,application/postscript,application/pdf,application/PCLm,image/jpeg,image/tiff
[Job 96925] job-password-encryption-supported keyword none
[Job 96925] marker-colors 1setOf nameWithoutLanguage #000000,#00FFFF,#FF00FF,#FFFF00,#000000,#00FFFF,#FF00FF,#FFFF00,none,none,none
[Job 96925] marker-high-levels 1setOf integer 100,100,100,100,100,100,100,100,90,100,100
[Job 96925] marker-levels 1setOf integer 47,60,12,57,63,19,19,19,0,82,49
[Job 96925] marker-low-levels 1setOf integer 10,10,10,10,10,10,10,10,0,10,10
[Job 96925] marker-names 1setOf nameWithoutLanguage Black Toner,Cyan Toner,Magenta Toner,Yellow Toner,Drum Cartridge (R1),Drum Cartridge (R2),Drum Cartridge (R3),Drum Cartridge (R4),Waste Toner Container,Transfer Belt Cleaner,Second Bias Transfer Roll
[Job 96925] marker-types 1setOf keyword toner,toner,toner,toner,opc,opc,opc,opc,waste-toner,transfer-unit,transfer-unit
[Job 96925] media-col-supported 1setOf keyword media-size,media-size-name,media-source,media-type,media-color,media-left-margin,media-right-margin,media-top-margin,media-bottom-margin
[Job 96925] multiple-document-handling-supported 1setOf keyword single-document-new-sheet,separate-documents-uncollated-copies,separate-documents-collated-copies
[Job 96925] operations-supported 1setOf enum Print-Job,Validate-Job,Create-Job,Send-Document,Cancel-Job,Get-Job-Attributes,Get-Jobs,Get-Printer-Attributes,Identify-Printer,Cancel-My-Jobs,Close-Job,Acknowledge-Document,Acknowledge-Job,Fetch-Document,Fetch-Job,Update-Active-Jobs,Update-Document-Status,Update-Job-Status,Update-Output-Device-Attributes
[Job 96925] print-color-mode-supported 1setOf keyword color,monochrome,auto,auto-monochrome
[Job 96925] printer-alert 1setOf octetString code=mediaEmpty;index=2;severity=warningBinaryChangeEvent;training=untrained;group=input;groupindex=5;location=753500;time=1699299069,code=mediaNeeded;index=16;severity=warningBinaryChangeEvent;training=untrained;group=input;groupindex=-1;location=2251304;time=1699305995
[Job 96925] printer-alert-description 1setOf textWithoutLanguage Tray 5 (Bypass) is empty. User intervention is required to add paper to Tray 5. Print and Copy services can continue if the correct paper is available in other trays.,Queued job needs resources. User intervention is required to supply resources required for one or more queued jobs; jobs will be held until resources are available. Device services are unaffected.
[Job 96925] printer-is-accepting-jobs boolean true
[Job 96925] printer-mandatory-job-attributes 1setOf keyword attributes-charset,attributes-natural-language,printer-uri
[Job 96925] printer-state enum idle
[Job 96925] printer-state-message textWithoutLanguage Queued job needs resources.
[Job 96925] printer-state-reasons keyword media-needed
[Job 96925] ---- end-of-attributes-tag ----
[Job 96925] Create-Job: successful-ok (successful-ok)
[Job 96925] ---- operation-attributes-tag ----
[Job 96925] attributes-charset charset utf-8
[Job 96925] attributes-natural-language naturalLanguage en
[Job 96925] ---- job-attributes-tag ----
[Job 96925] job-uri uri ipp://10.5.8.60/5060
[Job 96925] job-id integer 5060
[Job 96925] job-state enum pending
[Job 96925] job-state-reasons keyword job-incoming
[Job 96925] job-state-message textWithoutLanguage Receiving Job.
[Job 96925] number-of-intervening-jobs integer 12
[Job 96925] ---- end-of-attributes-tag ----
[Job 96925] Print job accepted - job ID 5060.
[Job 96925] Sending file 1 using chunking...
[Job 96925] IPP/2.0 Send-Document #5
[Job 96925] ---- operation-attributes-tag ----
[Job 96925] attributes-charset charset utf-8
[Job 96925] attributes-natural-language naturalLanguage en-us
[Job 96925] printer-uri uri ipp://10.5.8.60:631/ipp/print
[Job 96925] job-id integer 5060
[Job 96925] requesting-user-name nameWithoutLanguage jeff_dyck
[Job 96925] last-document boolean true
[Job 96925] document-format mimeMediaType application/pdf
[Job 96925] ---- end-of-attributes-tag ----
[Job 96925] Send-Document: successful-ok (successful-ok)
[Job 96925] ---- operation-attributes-tag ----
[Job 96925] attributes-charset charset utf-8
[Job 96925] attributes-natural-language naturalLanguage en
[Job 96925] ---- job-attributes-tag ----
[Job 96925] job-uri uri ipp://10.5.8.60/5060
[Job 96925] job-id integer 5060
[Job 96925] job-state enum pending
[Job 96925] job-state-reasons keyword job-incoming
[Job 96925] job-state-message textWithoutLanguage Receiving Job.
[Job 96925] number-of-intervening-jobs integer 12
[Job 96925] ---- end-of-attributes-tag ----
[Job 96925] PAGE: 1 1
[Job 96925] IPP/2.0 Get-Printer-Attributes #6
[Job 96925] ---- operation-attributes-tag ----
[Job 96925] attributes-charset charset utf-8
[Job 96925] attributes-natural-language naturalLanguage en-us
[Job 96925] printer-uri uri ipp://10.5.8.60:631/ipp/print
[Job 96925] requesting-user-name nameWithoutLanguage jeff_dyck
[Job 96925] requested-attributes 1setOf keyword compression-supported,copies-supported,cups-version,document-format-supported,job-password-encryption-supported,marker-colors,marker-high-levels,marker-levels,marker-low-levels,marker-message,marker-names,marker-types,media-col-supported,multiple-document-handling-supported,operations-supported,print-color-mode-supported,printer-alert,printer-alert-description,printer-is-accepting-jobs,printer-mandatory-job-attributes,printer-state,printer-state-message,printer-state-reasons
[Job 96925] ---- end-of-attributes-tag ----
[Job 96925] Queued job needs resources.
[Job 96925] update_reasons(attr=1(media-needed), s=\"(null)\")
[Job 96925] Get-Printer-Attributes: successful-ok-ignored-or-substituted-attributes (successful-ok-ignored-or-substituted-attributes)
[Job 96925] ---- operation-attributes-tag ----
[Job 96925] attributes-charset charset utf-8
[Job 96925] attributes-natural-language naturalLanguage en
[Job 96925] ---- unsupported-attributes-tag ----
[Job 96925] cups-version unsupported unsupported
[Job 96925] marker-message unsupported unsupported
[Job 96925] ---- printer-attributes-tag ----
[Job 96925] compression-supported keyword none
[Job 96925] copies-supported rangeOfInteger 1-9999
[Job 96925] document-format-supported 1setOf mimeMediaType application/octet-stream,application/vnd.hp-PCL,text/plain,image/urf,image/pwg-raster,application/postscript,application/pdf,application/PCLm,image/jpeg,image/tiff
[Job 96925] job-password-encryption-supported keyword none
[Job 96925] marker-colors 1setOf nameWithoutLanguage #000000,#00FFFF,#FF00FF,#FFFF00,#000000,#00FFFF,#FF00FF,#FFFF00,none,none,none
[Job 96925] marker-high-levels 1setOf integer 100,100,100,100,100,100,100,100,90,100,100
[Job 96925] marker-levels 1setOf integer 47,60,12,57,63,19,19,19,0,82,49
[Job 96925] marker-low-levels 1setOf integer 10,10,10,10,10,10,10,10,0,10,10
[Job 96925] marker-names 1setOf nameWithoutLanguage Black Toner,Cyan Toner,Magenta Toner,Yellow Toner,Drum Cartridge (R1),Drum Cartridge (R2),Drum Cartridge (R3),Drum Cartridge (R4),Waste Toner Container,Transfer Belt Cleaner,Second Bias Transfer Roll
[Job 96925] marker-types 1setOf keyword toner,toner,toner,toner,opc,opc,opc,opc,waste-toner,transfer-unit,transfer-unit
[Job 96925] media-col-supported 1setOf keyword media-size,media-size-name,media-source,media-type,media-color,media-left-margin,media-right-margin,media-top-margin,media-bottom-margin
[Job 96925] multiple-document-handling-supported 1setOf keyword single-document-new-sheet,separate-documents-uncollated-copies,separate-documents-collated-copies
[Job 96925] operations-supported 1setOf enum Print-Job,Validate-Job,Create-Job,Send-Document,Cancel-Job,Get-Job-Attributes,Get-Jobs,Get-Printer-Attributes,Identify-Printer,Cancel-My-Jobs,Close-Job,Acknowledge-Document,Acknowledge-Job,Fetch-Document,Fetch-Job,Update-Active-Jobs,Update-Document-Status,Update-Job-Status,Update-Output-Device-Attributes
[Job 96925] print-color-mode-supported 1setOf keyword color,monochrome,auto,auto-monochrome
[Job 96925] printer-alert 1setOf octetString code=mediaEmpty;index=2;severity=warningBinaryChangeEvent;training=untrained;group=input;groupindex=5;location=753500;time=1699299069,code=mediaNeeded;index=16;severity=warningBinaryChangeEvent;training=untrained;group=input;groupindex=-1;location=2251304;time=1699305995
[Job 96925] printer-alert-description 1setOf textWithoutLanguage Tray 5 (Bypass) is empty. User intervention is required to add paper to Tray 5. Print and Copy services can continue if the correct paper is available in other trays.,Queued job needs resources. User intervention is required to supply resources required for one or more queued jobs; jobs will be held until resources are available. Device services are unaffected.
[Job 96925] printer-is-accepting-jobs boolean true
[Job 96925] printer-mandatory-job-attributes 1setOf keyword attributes-charset,attributes-natural-language,printer-uri
[Job 96925] printer-state enum idle
[Job 96925] printer-state-message textWithoutLanguage Queued job needs resources.
[Job 96925] printer-state-reasons keyword media-needed
[Job 96925] ---- end-of-attributes-tag ----

If I do a get-attributes command direct to the print queue, I see that media-default = na_letter_8.5x11in, if I look in the web UI for the CUPS server and check printer defaults it also says the print queue default is Letter.

I do think this is some kind of strange knock off affect from the iPad OS 16 bug where it doesn't present the page size pick list for a printer that requires authentication.

michaelrsweet commented 1 year ago

This shows the client sending an A6 (105x146mm) print request:

[Job 96925] media-col collection {media-size={x-dimension=10500 y-dimension=14800} media-source=auto media-left-margin=200 media-right-margin=200 media-top-margin=400 media-bottom-margin=200}

Can you do the following command and report the output:

ipptool -tv ipp://10.5.8.60:631/ipp/print get-printer-attributes.test | grep media-col-ready
csfjeff commented 1 year ago

That command returns:

media-col-ready (1setOf collection) = {media-size={x-dimension=27940 y-dimension=43180} media-source-properties={media-source-feed-direction=short-edge-first media-source-feed-orientation=3} media-source=tray-1 media-type=auto media-color=white media-left-margin=200 media-right-margin=200 media-top-margin=400 media-bottom-margin=200},{media-size={x-dimension=21590 y-dimension=35560} media-source-properties={media-source-feed-direction=short-edge-first media-source-feed-orientation=3} media-source=tray-2 media-type=auto media-color=white media-left-margin=200 media-right-margin=200 media-top-margin=400 media-bottom-margin=200},{media-size={x-dimension=21590 y-dimension=27940} media-source-properties={media-source-feed-direction=long-edge-first media-source-feed-orientation=3} media-source=tray-3 media-type=auto media-color=white media-left-margin=200 media-right-margin=200 media-top-margin=400 media-bottom-margin=200},{media-size={x-dimension=21590 y-dimension=27940} media-source-properties={media-source-feed-direction=long-edge-first media-source-feed-orientation=3} media-source=tray-4 media-type=auto media-color=white media-left-margin=200 media-right-margin=200 media-top-margin=400 media-bottom-margin=200},{media-size={x-dimension=21590 y-dimension=27940} media-source-properties={media-source-feed-direction=long-edge-first media-source-feed-orientation=3} media-source=tray-5 media-type=auto media-color=white media-left-margin=200 media-right-margin=200 media-top-margin=400 media-bottom-margin=200}

If I do the same thing to the CUPS queue for that printer I get slightly different results:

media-col-ready (1setOf collection) = {media-size={x-dimension=29700 y-dimension=42000} media-bottom-margin=200 media-left-margin=200 media-right-margin=200 media-top-margin=400},{media-size={x-dimension=21000 y-dimension=29700} media-bottom-margin=200 media-left-margin=200 media-right-margin=200 media-top-margin=400},{media-size={x-dimension=14800 y-dimension=21000} media-bottom-margin=200 media-left-margin=200 media-right-margin=200 media-top-margin=400},{media-size={x-dimension=10500 y-dimension=14800} media-bottom-margin=200 media-left-margin=200 media-right-margin=200 media-top-margin=400},{media-size={x-dimension=11000 y-dimension=22000} media-bottom-margin=200 media-left-margin=200 media-right-margin=200 media-top-margin=400}
michaelrsweet commented 1 year ago

I wonder if iPadOS is confused due to multiple sizes being reported for the same media source (auto)? You can try changing the ReadyPaperSizes to just be "A4" or "Letter" (depending on what you use) so that it only has a single size to choose.

If this is indeed the issue we can just update cupsd to synthesize different media-source's for each of the ready sizes (auto.1, auto.2, etc.) and ignore the source when it starts with the "auto." prefix.

csfjeff commented 1 year ago

Hmmm, wasn't aware of that ReadyPaperSizes option - that's in the cupsd.conf file, correct? I'll try that tomorrow (just ending my work day). Not really understanding anything on the second paragraph though.

michaelrsweet commented 1 year ago

Yes, in cupsd.conf so you can just do:

cupsctl ReadyPaperSizes=A4

to set the list of media sizes the iOS devices will see to just "A4".

The second paragraph is more to remind me of a potential fix - basically, right now "media-col-ready" (the list of loaded/available media that iOS sees) is reporting that a paper tray called "auto" has A3, A4, A5, and A6 sizes loaded, and it might be getting confused about a single tray having multiple sizes. A potential fix would be to list each of the sizes in a different tray, e.g., "auto.1" has A3, "auto.2" has A4, etc.

csfjeff commented 1 year ago

So played around with this for a while this morning - added the following to my cupsd.conf file:

DefaultPaperSize Letter
DefaultLanguage English
ReadyPaperSize Letter

Also added a /etc/papersize file with letter as the value.

This did improve one thing, before the ipp get-attributes query would show media-default and media-ready as the European versions (A4, A3, etc) and now it's showing the proper (for us) North American Letter, Legal, etc.

Unfortunately the iPad (which is still set to French) is still defaulting to A6 :(. I do think this is far more on Apple than CUPS - these iPads are also not showing the paper size selector in the Print dialog due to the issue around airprint printers with the AIR attribute, requiring authentication. I suspect that this is somehow related.

Strangely, after a print attempt that chokes due to the A6 issue, if I try to print again shortly after without changing printers, I do see the paper size menu and can choose the paper size I want. That may be a quirk of my testing setup right now though, I'm working from home today so using the iPad simulator in xCode piggy backed off my Mac's VPN connection to the office network.

csfjeff commented 1 year ago

Hmmm, testing that IPP command above I'm noting that the CUPS server is still responding with a list of media-col-ready results... and looking closer I mistyped ReadyPaperSize to miss the plural Sizes... just tweaked and testing again...

csfjeff commented 1 year ago

OK, that looks like it may be helping - seems the iPads are defaulting to Letter now... Waiting for more confirmations from the school but hopefully this will get us through till whenever Apple fixes the core fault on iPad OS.

michaelrsweet commented 1 year ago

OK, so this tells me that iOS doesn't like a single tray to report multiple sizes... Will look at implementing my proposed "auto.N" solution when ReadyPaperSizes has more than one size that is supported by the printer.

michaelrsweet commented 10 months ago

Pushed the following to hopefully fix this issue (I will attempt to test, but others should as well):

[master 49e662dd2] Add media-source to media-col-ready for iOS 17+ (Issue #738)

michaelrsweet commented 7 months ago

Closing - will reopen if people are still having trouble...