Open hannut opened 2 months ago
Also the printer has the latest firmware from Canon. I have had this printer for several years and working with cups
I had bad filter on the original wireshark capture. I did a new one and now I can also see the error canon-part2.zip
Frame 39: 188 bytes on wire (1504 bits), 188 bytes captured (1504 bits) on interface enp59s0u1u1u2, id 0
Ethernet II, Src: 52:54:00:99:eb:51 (52:54:00:99:eb:51), Dst: Canon_cc:5b:53 (f4:a9:97:cc:5b:53)
Internet Protocol Version 4, Src: 192.168.20.171, Dst: 192.168.20.7
Transmission Control Protocol, Src Port: 45114, Dst Port: 631, Seq: 229, Ack: 1, Len: 134
[2 Reassembled TCP Segments (362 bytes): #37(228), #39(134)]
Hypertext Transfer Protocol
POST /ipp/print HTTP/1.1\r\n
Content-Length: 134\r\n
Content-Type: application/ipp\r\n
Date: Wed, 14 Aug 2024 09:04:06 GMT\r\n
Host: 192.168.20.7:631\r\n
User-Agent: CUPS/2.4.7 (Linux 6.8.0-40-generic; x86_64) IPP/2.0\r\n
Expect: 100-continue\r\n
\r\n
[Full request URI: http://192.168.20.7:631/ipp/print]
[HTTP request 1/1]
[Response in frame: 46]
File Data: 134 bytes
Internet Printing Protocol
[Response In: 46]
version: 2.0
operation-id: Get-Printer-Attributes (0x000b)
request-id: 4
operation-attributes-tag
attributes-charset (charset): 'utf-8'
name: attributes-charset
charset value: utf-8
attributes-natural-language (naturalLanguage): 'en-us'
name: attributes-natural-language
naturalLanguage value: en-us
printer-uri (uri): ''
name: printer-uri
uri value:
requested-attributes (keyword): 'media-col-database'
name: requested-attributes
keyword value: media-col-database
end-of-attributes-tag
Hmm, the printer-uri is blank on the second request. Investigating...
The wrong URI was being sent in all of the cases:
[master 4bada6c6c] Fix IPP everywhere printer setup (Issue #1033)
[2.4.x 313c388db] Fix IPP everywhere printer setup (Issue #1033)
Hi, compiled this commit as Fedora RPMs. Now I can add the printer but there is still different problem.
There is an error when adding but i get the printer added
lpadmin -p canon -v ipp://192.168.20.7/ipp/print -E -m everywhere
lpadmin: Unable to create PPD: No IPP attributes.
The printer is added as RAW and I'm able to change the driver to the "Generic IPP Everywhere Printer" (drv:///cupsfilters.drv/pwgrast.ppd). This flow works with the "old" versions which I tested earlier.
However printing test page does not work. Printer cancels the job after receiving it.
Log:
elo 15 12:01:34 hannu-xps cupsd[223334]: REQUEST localhost - - "POST /printers/canon HTTP/1.1" 200 352 Create-Job successful-ok
elo 15 12:01:34 hannu-xps cupsd[223334]: REQUEST localhost - - "POST /printers/canon HTTP/1.1" 200 494 Send-Document successful-ok
elo 15 12:01:49 hannu-xps cupsd[223334]: [Job 7] Print job canceled at printer.
elo 15 12:01:49 hannu-xps cupsd[223334]: canon hannu 7 [15/Aug/2024:12:01:49 +0300] total 1 - localhost Testisivu - -
elo 15 12:01:49 hannu-xps cupsd[223334]: [Job 7] Backend ipp returned status 5 (cancel job)
I'm not sure if I test this properly. First I compiled RPMs from latest fedora package and only adding the new patch. Then I downloaded cups from this excact commit (2.4.x branch) and replaced the Fedora provided tgz with it. Compiled and installed both variants. Might the other cups related other default fedora packages cause issues with this?
I can try to capture what happens if it's helpful. During printing the whole test page is sent via network and wireshark gets very slow and unresponsive when capturing so much traffic. thsark command line works fast but reading the captures with wireshark takes veeeeery long time because of the payload of the page
@michaelrsweet Should I open a new issue or can we continue with this?
I printed a smaller document and captured that. captures.zip
Same as before. Add printer with lpadmin -p canon -v ipp://192.168.20.7/ipp/print -E -m everywhere
, change printer type from RAW to Generic IPP, print
I assume that -e everywhere
should do the right thing. However with this printer the manually changing the Generic IPP has been the only way to get it working with older versions of cups.
➜ ~ rpm -qa | grep -i -e cups -e ghostscript
python3-cups-2.0.4-1.fc40.x86_64
cups-pk-helper-0.2.7-7.fc40.x86_64
ghostscript-tools-fonts-10.02.1-12.fc40.noarch
ghostscript-tools-printing-10.02.1-12.fc40.noarch
ghostscript-10.02.1-12.fc40.x86_64
libcupsfilters-2.0.0-7.fc40.x86_64
cups-browsed-2.0.0-6.fc40.x86_64
cups-filters-driverless-2.0.0-6.fc40.x86_64
cups-filters-2.0.0-6.fc40.x86_64
bluez-cups-5.77-1.fc40.x86_64
gutenprint-cups-5.3.4-16.fc40.x86_64
cups-libs-313c388dbc023bbcb75d1efed800d0cfc992a6cc-0.fc40.x86_64
cups-client-313c388dbc023bbcb75d1efed800d0cfc992a6cc-0.fc40.x86_64
cups-filesystem-313c388dbc023bbcb75d1efed800d0cfc992a6cc-0.fc40.noarch
cups-313c388dbc023bbcb75d1efed800d0cfc992a6cc-0.fc40.x86_64
cnrdrvcups-ufr2-uk-6.00-1.00.x86_64
cups-ipptool-313c388dbc023bbcb75d1efed800d0cfc992a6cc-0.fc40.x86_64
➜ ~ lpadmin -p canon -v ipp://192.168.20.7/ipp/print -E -m everywhere
lpadmin: Unable to create PPD: No IPP attributes.
➜ ~ avahi-browse -rt _ipp._tcp
+ wlp0s20f3 IPv4 Canon MF645C _ipp._tcp local
= wlp0s20f3 IPv4 Canon MF645C _ipp._tcp local
hostname = [Canoncc5b53.local]
address = [192.168.20.7]
port = [631]
txt = ["mopria-certified=1.3" "print_wfds=T" "rfo=ipp/faxout" "kind=document,envelope,postcard" "URF=ADOBERGB24,CP255,DM1,PQ4,RS300,SRGB24,W8-16,FN3,IS1-4,OB10-40,V1.4" "Fax=T" "Scan=T" "TLS=1.2" "usb_CMD=LIPSLX,CPCA" "UUID=6d4ff0ce-6b11-11d8-8020-f4a997cc5b53" "PaperMax=legal-A4" "Punch=0" "Staple=F" "Sort=F" "Collate=F" "Bind=F" "PaperCustom=T" "Duplex=T" "Copies=T" "Color=T" "TBCP=F" "Binary=F" "Transparent=F" "usb_MDL=MF645C" "usb_MFG=Canon" "adminurl=http://Canoncc5b53.local:80/airprint.html" "pdl=application/octet-stream,image/urf,image/pwg-raster,image/jpeg,application/pdf" "product=(CNMF645C)" "ty=Canon MF645C" "priority=10" "qtotal=1" "note=" "rp=ipp/print" "txtvers=1"]
elo 16 08:47:26 hannu-xps cupsd[5704]: canon: PPD creation failed: No IPP attributes.
elo 16 08:47:26 hannu-xps cupsd[5704]: [Client 28] Returning IPP server-error-device-error for CUPS-Add-Modify-Printer (ipp://localhost:631/print>
elo 16 08:47:26 hannu-xps cupsd[5704]: REQUEST localhost - hannu "POST /admin/ HTTP/1.1" 200 275 CUPS-Add-Modify-Printer server-error-device-error
elo 16 08:47:59 hannu-xps cupsd[5704]: REQUEST localhost - - "POST / HTTP/1.1" 200 345 Create-Printer-Subscriptions successful-ok
elo 16 08:48:01 hannu-xps cupsd[5704]: REQUEST localhost - - "POST / HTTP/1.1" 200 3979414 CUPS-Get-PPDs -
elo 16 08:48:21 hannu-xps cupsd[5704]: REQUEST localhost - - "POST / HTTP/1.1" 200 3979414 CUPS-Get-PPDs -
elo 16 08:48:33 hannu-xps cupsd[5704]: REQUEST localhost - - "POST /admin/ HTTP/1.1" 401 0 - -
elo 16 08:48:33 hannu-xps cupsd[5704]: CreateProfile failed: org.freedesktop.ColorManager.AlreadyExists:profile id 'canon-Gray..' already exists
elo 16 08:48:33 hannu-xps cupsd[5704]: CreateProfile failed: org.freedesktop.ColorManager.AlreadyExists:profile id 'canon-RGB..' already exists
elo 16 08:48:33 hannu-xps cupsd[5704]: REQUEST localhost - root "POST /admin/ HTTP/1.1" 200 220 CUPS-Add-Modify-Printer successful-ok
elo 16 08:49:33 hannu-xps cupsd[5704]: REQUEST localhost - - "POST /printers/canon HTTP/1.1" 200 212 Create-Job successful-ok
elo 16 08:49:33 hannu-xps cupsd[5704]: REQUEST localhost - - "POST /printers/canon HTTP/1.1" 200 8277 Send-Document successful-ok
elo 16 08:49:34 hannu-xps cupsd[5704]: [Job 13] Print job canceled at printer.
elo 16 08:49:34 hannu-xps cupsd[5704]: canon hannu 13 [16/Aug/2024:08:49:34 +0300] total 1 - localhost Nimetön 1 - -
elo 16 08:49:34 hannu-xps cupsd[5704]: [Job 13] Backend ipp returned status 5 (cancel job)
We can continue here…
@hannut another problem is that your printer does not provide "media-col-database" attribute on request (at least wireshark does not show it or ), which is required for IPP Everywhere and AirPrint. This is something which manufacturer has to fix to be AirPrint certified. Please report the issue to Canon - you probably can find some instructions on their webpage.
The reason why it works when you set the driver manually is because the driver contains the generic pregenerated data, which would be generated on the fly if the printer provided all requested data.
@michaelrsweet I was interested how IPP should work if an unsupported attribute is requested from the destination, and found out the attributes which were requested but are not on the destination are ignored and we return successful-ok...
@zdohnal If the Printer ignores one or more attributes or values but is otherwise successful, it is supposed to return 'successful-ok-ignored-or-substituted-attributes' with the ignored attributes or values in the unsupported attributes group in the response (so you know what was ignored). Some printers return 'successful-ok' without the requested attributes (wrong), some return a 'client-error-bad-request' status code (also wrong), but we try to work around those issues by querying the "media-col-database" attribute separately if we don't get it the first time. This was the original issue (the second request had a blank "printer-uri"), but it looks like that printer just doesn't support "media-col-database" at all and the cupsd code needs to tolerate that because the PPD generator can still work with "media-supported" and default margins.
@hannut
OK, so I'm looking at the capture more closely and am seeing errors in the printer's response - look at the media-col-supported attribute, where in the middle of the list of member attribute names we see a collection value that looks like it is for the media-size-supported attribute? There should be an error before the "PPD creation failed" message for Get-Printer-Attributes.
I can reproduce the printing issue.
Same as before. Add printer with
lpadmin -p canon -v ipp://192.168.20.7/ipp/print -E -m everywhere
, change printer type from RAW to Generic IPP, printI assume that
-e everywhere
should do the right thing. However with this printer the manually changing the Generic IPP has been the only way to get it working with older versions of cups.
After setting the queue as above:
client-error-document-format-error
.But I don’t know why does cups send cups-raster-format document to the device on Ubuntu24.04.
@tangyanli is the installed printer on Debian still raw, or does it have a PPD file generated by IPP Everywhere model?
EDIT: scratch that, now I see "After setting as above", so you did the magic by setting existing Generic IPP PPD into existing raw queue, am I correct?
The printer is added as RAW and I'm able to change the driver to the "Generic IPP Everywhere Printer" (drv:///cupsfilters.drv/pwgrast.ppd).
My reproduce steps on Unbunt24.04:
#lpadmin -p canon -v deivce-uri -E -m everywhere
-> Cups sends the pdf document to device and the printing is OK.cups-raster
formant document to device and the printing is NG.@tangyanli can you provide the PPD files for the printer from Debian and Ubuntu, debug logs from both machines (enable debug logs by cupsctl LogLevel=debug2
and print the job) and network capture when you install the printer and print?
I don't know if you have the same model as @hannut , but his model claims to support image/urf, so raster format should work (Generic IPP Everywhere Printer PPD enforces raster format). If the printer installation does not work with "everywhere" model, the queue stays raw and sending PDF prints ok, then the model supports plain PDF at least.
I am experiencing this same issue with my Canon MF743C running LinuxMint 22 (based upon Ubuntu 24.04) . I also tested when booting live images of both Fedora Cinnamon 40 and LinuxMint Edge (based upon Debian 12) with the same results.
The printer just stopped working where it had been working fine the day before. If there is info I can provide to help identify the issues, direct me. Would providing the output of the same commands that @hannut provided be helpful?
BTW: I can still access this printer from my Android 14 mobile and from a Windows 11 system. Nothing changed with them so it definitely appears to be limited to CUPS.
UPDATE I just did a firmware update and I was successful adding and printing a test page. I also noticed some CUPS updates (I'd been gone a week). So, between the two, it seems to be working now.
Before you write the report Read the REPORTING_ISSUES.md file in the main repository and prepare data mentioned there which looks relevant to you issue.
Describe the bug Can't add Canon ipp printer after cups version 2.4.6. Tested with all ubuntu versions one by one from 22.04 to 24.04. Mantic is the last one that works. I use Fedora 40 as the daily driver which also does not work.
To Reproduce
Expected behavior Printer was added
Screenshots If applicable, add screenshots to help explain your problem.
System Information:
Additional context I tested with ipptool. this does not work even on older cups versions, however the printer can be added and works when adding with lpadmin and manually changing the driver to generic IPP driver via Gnome printer settings on older versions.
ipptool
I captured traffic with wireshark during the above command. Printer responds and gives IPP parameters, however the ipptool says it did not get any. I will attach the wireshark capture to this report. Same behaviour with older or newer versions of the tested operating systems and cups versions
Text representation of the reply from printer, whole capture as an attachment
ipp-canon.zip