Closed TomKyblik closed 2 years ago
@TomKyblik Those messages indicate issues in the PDF file you are printing. As for the printer attributes, it certainly looks like the printer has most of everything needed for AirPrint - might just be a testing issue they haven't gone through?
Have you checked for a firmware update for the printer?
@michaelrsweet
Those messages indicate issues in the PDF file you are printing.
It happens while printing mail from Outlook, picture from gallery or web page from Safari, but other systems like Win or Android can print via same CUPS server with no errors reported, so might be after all an issue in iOS itself. If you think it's not a CUPS problem, please feel free to close the issue
Have you checked for a firmware update for the printer?
Firmware is the most recent one. As native AirPrint support is concerned, situation is a bit shady -- some sellers are (were) advertising it with AirPrint support, some don't. I've contancted Brother support and they confirmed to me that this model is not AirPrint capable... Maybe with some future firmware? Anyway thanks...
@TomKyblik It would be useful to have a few example PDF files from your Raspberry Pi - the printer itself doesn't support PDF or Apple Raster, so the filter error is coming from the 'Pi.
@michaelrsweet I'm not sure what PDF you mean? If I print e.g. an e-mail from iPhone via CUPS, does it get converted to PDF first? I can only see some control files (e.g. c00023) and data files (d00023-001) in /var/spool/cups.
cat c00023
Gattributes-charsetutf-8Httributes-natural-languagecs-czE
printer-uri9ipps://osmc-loznice.local.:631/printers/Brother_DCP-T425WBjob-originating-user-namemobilejob-nameOutlook!copies4 media-colJ
media-size4J
x-dimension!J
print-qualityDsides one-sided!ion!t7Jmedia-right-margin!,Jmedia-left-margin!,Jmedia-top-margin!�Jmedia-bottom-margin!�7#
192.168.2.1411date-time-at-completed-priority2job-uuid-urn:uuid:bcbf0ab4-3d11-3fd3-77c9-443d33b9c809Bjob-originating-host-name
+!+1date-time-at-creation �
++1date-time-at-processing
++!time-at-completeda��!time-at-creationa���!time-at-processinga���!job-id# job-stateDjob-state-reasonsjob-canceled-by-user!job-impressions-completed!job-media-sheets-completedEjob-printer-uri1ipp://osmc-loznice:631/printers/Brother_DCP-T425W!
job-k-octets/Djob-hold-untilno-holdB
job-sheetsnoneBnoneIdocument-format-suppliedapplication/pdfIdocument-formatapplication/pdfAjob-printer-state-message=/var/spool/cups/d00023-001 (object 14 0): object has offset 0Djob-printer-state-reasonsnone
Edit: holy s**t, the data file is in fact a PDF -- should I upload one or two directly here?
The warning in iPhone appears always, even when printing a picture from gallery, however offset warning is written to logs only when printing text/mail/web page that gets converted to PDF, but when printing pictures, no warning in error_log, but still warning on iPhone... I'm confused now.
@TomKyblik
object has offset 0 originates from qpdf
, wich is used by cups-filters. It is a warning.
Please give (as root) the results of
grep cupsFilter2 /etc/cups/ppd/EVERYWHERE_PPD_FOR_DCP-T425W
and
cupsfilter -p /etc/cups/ppd/EVERYWHERE_PPD_FOR_DCP-T425W -m printer/foo -e --list-filters PPD
PPD could be the previous data file.
@debiantriage
sudo grep cupsFilter2 /etc/cups/ppd/Brother_DCP-T425W.ppd
*cupsFilter2: "image/pwg-raster image/pwg-raster 100 -"
sudo cupsfilter -p /etc/cups/ppd/Brother_DCP-T425W.ppd -m printer/foo -e --list-filters /var/spool/cups/d00026-001
pdftopdf
gstoraster
same issue here, one more thing is that i think driver was added to Airprint only recently BC as i remember few moths ago i wasn't able to add printer at all. now it went smoothly.
@TomKyblik The PDF file would be the "d" file in the spool directory. Since the CUPS server can't take the HEIF image files from an iOS device directly (and given the patent minefield for HEVC that seems unlikely to change for the foreseeable future) the iOS device will send PDF instead.
No response from the reporter for almost 2 months, closing the issue.
same problem, I think it's a new bug in latest 2.3
can confirm, i can print perfectly fine from windows etc, but the ipad just doesn't print.
Same problem here!
@prnake , @Wqrld , @kmorber - the current OpenPrinting CUPS version is 2.4.2 - do you use OpenPrinting CUPS or Apple CUPS?
@zdohnal On RasPi it's Apple version 2.2.10 but I also tried the OpenPrinting 2.4.2 on Ubuntu via snap (as official package is 2.4.1) and the result is still the same...
Ok, IIUC correctly your setup:
You have some client machine, RaspPi acting as print server and printer.
So it would be great if you tried the following (all with OpenPrinting CUPS):
$ cupsctl --debug-logging
$ lp -d <queue_name_on_raspi> <file>
$ lp -d <local_queue> <file>
Then please take your /var/log/cups/error_log from both machines, add .txt suffix and upload them here as files in comment.
Does one of them or both trigger the same issue you have when you print from the application on MacOS?
If it doesn't, then there will a trigger in the file which is copied from Apple application, and we will need the d
file from /var/spool/cups
for the job you've sent via MacOS application to OpenPrinting CUPS client on your local machine.
Let me clarify: My main print server is running on RaspberryPi with OSMC (which is based on Debian Buster at the moment) and CUPS 2.1.10 (the Apple version). As you asked guys having similar issue like I do whether the problem still exists with OpenPrinting CUPS 2.4.2, I've setup a testing print server on Ubuntu 22.04 using CUPS 2.4.2 provided via snap package (as classic Ubuntu package is still 2.4.1) and the warning/error is still the same on iOS/iPadOS... The document gets printed just fine if you say Continue ("Pokračovat" -- "Zrušit" is for Cancel)
Now my main printing clients are iOS/iPadOS devices -- my phone, my daughters phones or iPad (all updated to the most recent stable versions available). So I don't use any traditional CUPS client as such (no idea how Apple handles that under the hood).
So only thing I can do is start CUPS 2.4.2 print server with debug logging on Ubuntu and provide the debug logs from server, but I can't do so for clients on iOS/iPadOS.
@TomKyblik would you be able to copy the pdf into RasberryPi, log into it and print it from there? I don't have any MacOS device so first I would like to find out whether the issue can be triggered only with OpenPRinting CUPS, or do I have to have MacOS devices for this...
Having same issue all of a sudden, was working fine previously tho, happened after reinstalling cups. Any way to downgrade?
/var/spool/cups/d00002-001 (object 12 0): object has offset 0
@Babyyoda777 do you have the same network topology as @TomKyblik , MacOS clients + Linux server sharing the printer? Are you using OpenPrinting CUPS?
@TomKyblik any luck trying to log into RasPI, copying the pdf there and printing directly from the server, without Mac clients?
In any case, it would be great if any of you enabled CUPS debug logging on both machines by cupsctl --debug-logging
, tried to print the file you have problems with and attached the original PDF which you want to print from Mac, the dXXXXX-XXX
file from /var/spool/cups
on the server and /var/log/cups/error_log
from both machines.
Any file can be attached to a github comment once it has .txt suffix.
@Babyyoda777 do you have the same network topology as @TomKyblik , MacOS clients + Linux server sharing the printer? Are you using OpenPrinting CUPS?
@TomKyblik any luck trying to log into RasPI, copying the pdf there and printing directly from the server, without Mac clients?
In any case, it would be great if any of you enabled CUPS debug logging on both machines by
cupsctl --debug-logging
, tried to print the file you have problems with and attached the original PDF which you want to print from Mac, thedXXXXX-XXX
file from/var/spool/cups
on the server and/var/log/cups/error_log
from both machines.
Yes to everything basically, the pdf prints fine when connected directly via usb to the printer but then using AirPrint via Cups on a rpi this error come up on both iPhones and Macs. Printing via usb on a Mac is fine. The AirPrint is being shared over network via a rpi, yes. I will try upload a log soon.
@Babyyoda777 and printing via USB on RPi? Meaning send pdf to RPi via scp or similar tool, log into RPi and do lp -d <printer> <pdf>
?
@Babyyoda777 and printing via USB on RPi? Meaning send pdf to RPi via scp or similar tool, log into RPi and do
lp -d <printer> <pdf>
?
USB printing is also fine from RPI. I didn't do the log tho.
@Babyyoda777 ok, so the issue is really triggered only by PDF coming from Mac.
It would be great if you attached:
dXXXX-XXX
file from /var/spool/cups
on your RasPI, where `XXXXX-XXX
is job id and sequence number of file in the job which you experience the issue. f.e. the first file in the job 12 has a job file called d00012-001
Thank you in advance!
I have a very similar setup (Debian CUPS server, connected to a non-AirPrint printer, permitting AirPrint to work).
I get a similar message from IOS devices, "check printer for errors" however if I don't touch anything the message disappears after 2-3 seconds, and the document prints successfully.
This is the error from the Debian CUPS 2.3.3op2:
W [09/Sep/2022:21:32:29 +0000] [Job 5] /var/spool/cups/d00005-001 (object 6 0): object has offset 0
D [09/Sep/2022:21:32:29 +0000] [Job 5] Set job-printer-state-message to "/var/spool/cups/d00005-001 (object 6 0): object has offset 0", current level=WARN
W [09/Sep/2022:21:32:29 +0000] [Job 5] /var/spool/cups/d00005-001 (object 9 0): object has offset 0
D [09/Sep/2022:21:32:29 +0000] [Job 5] Set job-printer-state-message to "/var/spool/cups/d00005-001 (object 9 0): object has offset 0", current level=WAR
The Apple CUPS log has the same offset 0 message in the log, and you can see it on the printer dialog window while the job is printing.
Attached are 2 CUPS debug logs and the generated PDF: Apple CUPS client from a Macbook Pro Debian CUPS server Apple-CUPS.log.txt Debian-CUPS.log.txt d00005-001.pdf
Hi @cvandesande ,
thank you for the files! Now I can see the warning (object 6 0): object has offset 0
in the logs if I print via lp
even on Linux (any other PDF viewer generates a copy of the file which does not generate the warnings - lp
sends the file as it is), but it does not generate any pop up window or the warning from server is not propagated to the client.
Ad logs - are there different time zones on Mac and Debian? I see a job on Mac at 17:32:31, but Debian has the first log at 21:32:29. Either way, Apple log does not show the start of the job (even if timezones are different), can you provide the full log for the job from Mac?
My guess the window is shown based on notification which cupsd generates (it happens during update_job()
once state message is updated to /var/spool/cups/d00005-001 (object 9 0): object has offset 0
), however the application receiving the notify evaluates this as an error (AFAIK we don't pass any information about how serious notification is...) - WDYT, @michaelrsweet ?
Yes, different time zones. I'm visiting family overseas and setting up their printer :) It also might be the server is GMT and the Macbook is local.
Here's some fresh logs, new document, same error. Like before it does print successfully, so it's a very minor error. Also managed to catch a screenshot of the offset message on the printer dialog window before the job completed.
Ok, so based on the logs and PDF file you've provided I see two issues:
1) PDF d00001-001.pdf
produced by macOS Version 12.5.1 (Build 21G83) Quartz PDFContext
has an incorrect reference table - it shows null references to non-existing objects in PDF. QPDF (via pdftopdf
filter) on Debian complains about the sixth and ninth objects in PDF:
/usr/lib/cups/filter/pdftopdf 1 zdohnal '' 1 '' d00001-001.pdf > out.pdf
...
WARNING: d00001-001.pdf (object 6 0): object has offset 0
WARNING: d00001-001.pdf (object 9 0): object has offset 0
If you check it in xref table in PDF, you see the following records (I've added object numbers to make it more readable):
xref
0 44
0000000000 65535 f
0000003432 00000 n - object 1 0
0000011806 00000 n - object 2 0
0000000022 00000 n - object 3 0
0000003551 00000 n - object 4 0
0000007811 00000 n - object 5 0
0000000000 00000 n - object 6 0
0000018480 00000 n - object 7 0
0000010560 00000 n - object 8 0
0000000000 00000 n - object 9 0
...
as you can see the objects exist in the xref table, but their addresses are 0 and there are no such objects in the PDF at all. According the PDF tutorials I've read the xref table must contain only objects which are in the PDF, so IMHO it is a bug in Quartz PDFContent
(maybe it is PDF generator as cairo
is in Linux?), especially since the same objects are missing and are defined empty in xref table in the other PDF file you've supplied - looks like MacOS PDF generator is putting the same empty references to all PDFs sent for printing...
2) There is an IPP client called PrinterProxy
, which interprets the message /var/spool/cups/d00005-001 (object 9 0): object has offset 0
incorrectly as an error instead of warning (that's the level of importance on Debian) or info (the level of importance when the message got from Debian to Mac).
Here you can see the beginning of the connection (proof it is some PrinterProxy
on Mac):
D [12/Sep/2022:15:14:39 -0400] [Client 22] Server address is "/private/var/run/cupsd".
D [12/Sep/2022:15:14:39 -0400] [Client 22] Accepted from localhost (Domain PrinterProxy[1659])
D [12/Sep/2022:15:14:39 -0400] [Client 22] Waiting for request.
D [12/Sep/2022:15:14:39 -0400] [Client 22] POST / HTTP/1.1
Then this PrinterProxy
sends IPP Get-Printer-Attributes (for the printer where the job was sent) and Get-Jobs requests to cupsd
every several seconds (this looks random - once it sends both requests several times in a second, then it waits for a second or 4, then sends both requests, wait 1s, then it sends only Get-Printer-Attributes...), f.e.:
...
D [12/Sep/2022:15:14:50 -0400] [Client 22] No authentication data provided.
D [12/Sep/2022:15:14:50 -0400] [Client 22] 2.0 Get-Printer-Attributes 14
D [12/Sep/2022:15:14:50 -0400] Get-Printer-Attributes ipp://localhost:631/printers/Brother_MFC_7460DN___yul_bing
D [12/Sep/2022:15:14:50 -0400] [Client 22] Returning IPP successful-ok for Get-Printer-Attributes (ipp://localhost:631/printers/Brother_MFC_7460DN___yul_bing) from localhost.
...
D [12/Sep/2022:15:14:50 -0400] [Client 22] No authentication data provided.
D [12/Sep/2022:15:14:50 -0400] [Client 22] 2.0 Get-Jobs 15
D [12/Sep/2022:15:14:50 -0400] Get-Jobs ipp://localhost:631/printers/Brother_MFC_7460DN___yul_bing
...
With this cadence of requests, PrinterProxy
is able to catch the changed printer's state message for the local printer, which contains the message /var/spool/cups/d00005-001 (object 9 0): object has offset 0
. The message gets there from the server via the following steps:
job->printer->state_message
and from there to job->printer_message (which is part of job object) and to printer->state_message
(because job->printer
is the same pointer as the one from Printers
array, which saves all currently installed printers)PrinterProxy
asks about this local queue==============================================================
To sum it up, neither of those two issues are CUPS fault - PDF generator from Mac generates incorrect xref table and fixing it would solve both issues, PrinterProxy
should verify whether the state message it receives is really an error and report it accordingly (in this case only as info pop-up...)
Since there was a misunderstanding in #618 about this issue, I'll comment it plainly here as well:
Those two issues mentioned in summary are (IMHO) bugs in MacOS, which would be great if Apple fixed. In case someone hits the issue, do contact your Apple support and ask them to fix those issues.
I opened an issue with Apple, but I'm not sure how high the probability is that it'll be fixed soon.
Is there maybe an approach to silence these misinterpreted warnings/errors until Apple fixes it? What code portions should I look into to do that?
The warning comes from libqpdf from QPDF project https://github.com/qpdf/qpdf/ , which is used during implementation of pdftopdf
filter. You can try contacting its upstream.
Or try to change a PrinterProxy configuration - it might have some settings which can turn off those notifications, but idk - I don't have Mac.
Wanted to chime in here. While I understand it's not CUPS' fault and a violation of the PDFs standards by Apple, it still renders CUPS useless for me as I am 100% running on apple devices.
FYI, I'm running CUPS on docker, so this is a minimal-invasive operation.
1) Check out qlib source code 2) modify $codeDir/libqpdf/QPDF.cc and look for the "offset 0" line. Comment out the three lines:
//warn(QPDFExc(qpdf_e_damaged_pdf, this->m->file->getName(), // this->m->last_object_description, 0, // "MY object has offset 0"));
Run ./configure && make && make install
Finally, you need to figure out where the libqpdf.so.28* files are originally located and symlink into these destinations.
After I did it, everything works nicely. Since it's only a warning, I believe it's fair to ignore it until Apple decides to stick to the standards. I'm also looking into the cupersfilter pdftopdf to understand if the warning can be switched off, since I believe it would be the cleanest approach, but I've tried to tamper around with the cups filters and build a wrapper, yada yada yada... Nothing worked.
Was having same object offset 0 error, but unlike OP I did not get dialogue box and was unable to print effected documents. Stumbled across this post installed qpdf and while I still get the error, at least I'm printing :
https://github.com/pdewacht/brlaser/issues/49#issuecomment-898800199 # # #
I recently bought Brother DCP-T425W which is Mopria certified, but is not AirPrint certified (unfortunately). I have some RaspberryPis with OSMC at home so I decided to try it via CUPS
Printing via CUPS to this printer works OK from Android and Windows -- no errors in /var/log/cups/error_log, but when printing from any iOS device (15.x) there's always a message "Check printer for errors" | Cancel / Continue However when selecting Continue, the printer prints the document/photo just fine
and /var/log/cups/error_log has entries like this:
OSMC system is based on Debian Buster with CUPS version 2.2.10, however I tried the same with the most recent version on VirtualBox with Ubuntu (CUPS 2.3.3op2-7ubuntu2) and the result is always the same: object has offset 0 is written to logs...
If ipptool output could help:
ipptool -tv ipp://Brother-DCP-T425W.local:631/ipp/print get-printer-attributes.test