OpenPrinting / cups

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

Can't add Canon ipp printer after cups version 2.4.6 #1033

Open hannut opened 2 months ago

hannut commented 2 months ago

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

hannu@hannu-Standard-PC-Q35-ICH9-2009:~$ lpadmin -p canon -v ipp://192.168.20.7/ipp/print -E -m everywhere
lpadmin: Unable to create PPD: No IPP attributes.

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

ipptool -tv ipp://192.168.20.7/ get-printer-attributes.test
"get-printer-attributes.test":
    Get-Printer-Attributes:
        attributes-charset (charset) = utf-8
        attributes-natural-language (naturalLanguage) = en
        printer-uri (uri) = ipp://192.168.20.7:631/
        requested-attributes (keyword) = all
    Get printer attributes using get-printer-attributes                  [FAIL]
        RECEIVED: 0 bytes in response
        status-code = server-error-internal-error (Unable to read response.)
        IPP request failed with status server-error-internal-error (Unable to read response.)

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

Internet Printing Protocol
    [Request In: 5]
    [Response Time: 0.014304757 seconds]
    version: 2.0
    status-code: Successful (successful-ok)
    request-id: 20825
    operation-attributes-tag
        attributes-charset (charset): 'utf-8'
            name: attributes-charset
            charset value: utf-8
        attributes-natural-language (naturalLanguage): 'en-fi'
            name: attributes-natural-language
            naturalLanguage value: en-fi
    printer-attributes-tag
        printer-uri-supported (1setOf uri): 'ipp://192.168.20.7:631/ipp/print','ipp://192.168.20.7:631/ipp'
            name: printer-uri-supported
            uri value: ipp://192.168.20.7:631/ipp/print
            uri value: ipp://192.168.20.7:631/ipp
        uri-security-supported (1setOf keyword): 'none','none'
            name: uri-security-supported
            keyword value: none
            keyword value: none
        uri-authentication-supported (1setOf keyword): 'none','none'
            name: uri-authentication-supported
            keyword value: none
            keyword value: none
        printer-name (nameWithoutLanguage): 'MF645C'
            name: printer-name
            nameWithoutLanguage value: MF645C
        printer-location (textWithoutLanguage): ''
            name: printer-location
            textWithoutLanguage value: 
        printer-info (textWithoutLanguage): 'http://www.canon.com'
            name: printer-info
            textWithoutLanguage value: http://www.canon.com
        printer-more-info (uri): 'http://192.168.20.7:80/airprint.html'
            name: printer-more-info
            uri value: http://192.168.20.7:80/airprint.html
        printer-make-and-model (textWithoutLanguage): 'CNMF645C'
            name: printer-make-and-model
            textWithoutLanguage value: CNMF645C
        printer-state (enum): idle
            name: printer-state
            printer-state: idle (3)
        printer-state-reasons (keyword): 'none'
            name: printer-state-reasons
            keyword value: none
        ipp-versions-supported (1setOf keyword): '2.0','1.1','1.0'
            name: ipp-versions-supported
            keyword value: 2.0
            keyword value: 1.1
            keyword value: 1.0
        ipp-features-supported (keyword): 'airprint-1.8'
            name: ipp-features-supported
            keyword value: airprint-1.8
        operations-supported (1setOf enum): Print-Job,Validate-Job,Create-Job,Send-Document,Cancel-Job,Get-Job-Attributes,Get-Jobs,Get-Printer-Attributes,Identify-Printer
            name: operations-supported
            operations-supported: Print-Job (2)
            operations-supported: Validate-Job (4)
            operations-supported: Create-Job (5)
            operations-supported: Send-Document (6)
            operations-supported: Cancel-Job (8)
            operations-supported: Get-Job-Attributes (9)
            operations-supported: Get-Jobs (10)
            operations-supported: Get-Printer-Attributes (11)
            operations-supported: Identify-Printer (60)
        charset-configured (charset): 'utf-8'
            name: charset-configured
            charset value: utf-8
        charset-supported (charset): 'utf-8'
            name: charset-supported
            charset value: utf-8
        color-supported (boolean): true
            name: color-supported
            boolean value: True
        compression-supported (keyword): 'none'
            name: compression-supported
            keyword value: none
        copies-default (integer): 1
            name: copies-default
            integer value: 1
        copies-supported (rangeOfInteger): 1-99
            name: copies-supported
            rangeOfInteger value: 1-99
        document-format-default (mimeMediaType): 'application/octet-stream'
            name: document-format-default
            mimeMediaType value: application/octet-stream
        document-format-supported (1setOf mimeMediaType): 'application/octet-stream','image/urf','image/pwg-raster','image/jpeg','application/pdf'
            name: document-format-supported
            mimeMediaType value: application/octet-stream
            mimeMediaType value: image/urf
            mimeMediaType value: image/pwg-raster
            mimeMediaType value: image/jpeg
            mimeMediaType value: application/pdf
        generated-natural-language-supported (naturalLanguage): 'en-fi'
            name: generated-natural-language-supported
            naturalLanguage value: en-fi
        jpeg-features-supported (keyword): 'none'
            name: jpeg-features-supported
            keyword value: none
        jpeg-k-octets-supported (rangeOfInteger): 0-51200
            name: jpeg-k-octets-supported
            rangeOfInteger value: 0-51200
        jpeg-x-dimension-supported (rangeOfInteger): 0-15000
            name: jpeg-x-dimension-supported
            rangeOfInteger value: 0-15000
        jpeg-y-dimension-supported (rangeOfInteger): 1-15000
            name: jpeg-y-dimension-supported
            rangeOfInteger value: 1-15000
        media-default (keyword): 'iso_a4_210x297mm'
            name: media-default
            keyword value: iso_a4_210x297mm
        media-bottom-margin-supported (integer): 500
            name: media-bottom-margin-supported
            integer value: 500
        media-left-margin-supported (integer): 500
            name: media-left-margin-supported
            integer value: 500
        media-right-margin-supported (integer): 500
            name: media-right-margin-supported
            integer value: 500
        media-top-margin-supported (integer): 500
            name: media-top-margin-supported
            integer value: 500
        multiple-document-jobs-supported (boolean): false
            name: multiple-document-jobs-supported
            boolean value: False
        natural-language-configured (naturalLanguage): 'en-fi'
            name: natural-language-configured
            naturalLanguage value: en-fi
        orientation-requested-default (enum): portrait
            name: orientation-requested-default
            orientation: portrait (3)
        orientation-requested-supported (1setOf enum): portrait,landscape,reverse-landscape,reverse-portrait,none
            name: orientation-requested-supported
            orientation: portrait (3)
            orientation: landscape (4)
            orientation: reverse-landscape (5)
            orientation: reverse-portrait (6)
            orientation: none (7)
        pdl-override-supported (keyword): 'attempted'
            name: pdl-override-supported
            keyword value: attempted
        printer-device-id (textWithoutLanguage): 'MFG:Canon;MDL:MF645C UFR II;CLS:PRINTER;DES:Canon MF645C UFR II;CID:CA_XPS_OIP;CMD:LIPSLX,CPCA;PESP:V1;'
            name: printer-device-id
            textWithoutLanguage value: MFG:Canon;MDL:MF645C UFR II;CLS:PRINTER;DES:Canon MF645C UFR II;CID:CA_XPS_OIP;CMD:LIPSLX,CPCA;PESP:V1;
        printer-icons (1setOf uri): 'http://192.168.20.7:80/en/media/dev_icon_128x128.png','http://192.168.20.7:80/en/media/dev_icon_512x512.png'
            name: printer-icons
            uri value: http://192.168.20.7:80/en/media/dev_icon_128x128.png
            uri value: http://192.168.20.7:80/en/media/dev_icon_512x512.png
        printer-is-accepting-jobs (boolean): true
            name: printer-is-accepting-jobs
            boolean value: True
        print-quality-default (enum): normal
            name: print-quality-default
            print-quality: normal (4)
        print-quality-supported (1setOf enum): draft,normal
            name: print-quality-supported
            print-quality: draft (3)
            print-quality: normal (4)
        printer-resolution-default (resolution): 300x300dpi
            name: printer-resolution-default
            resolution value: 300x300dpi
        printer-resolution-supported (resolution): 300x300dpi
            name: printer-resolution-supported
            resolution value: 300x300dpi
        printer-up-time (integer): 56785
            name: printer-up-time
            integer value: 56785
        printer-uuid (uri): 'urn:uuid:6d4ff0ce-6b11-11d8-8020-f4a997cc5b53'
            name: printer-uuid
            uri value: urn:uuid:6d4ff0ce-6b11-11d8-8020-f4a997cc5b53
        queued-job-count (integer): 0
            name: queued-job-count
            integer value: 0
        urf-supported (1setOf keyword): 'ADOBERGB24','CP255','DM1','PQ4','RS300','SRGB24','W8-16','FN3','IS1-4','OB10-40','V1.4'
            name: urf-supported
            keyword value: ADOBERGB24
            keyword value: CP255
            keyword value: DM1
            keyword value: PQ4
            keyword value: RS300
            keyword value: SRGB24
            keyword value: W8-16
            keyword value: FN3
            keyword value: IS1-4
            keyword value: OB10-40
            keyword value: V1.4
        pdf-versions-supported (keyword): 'iso-32000-1_2008'
            name: pdf-versions-supported
            keyword value: iso-32000-1_2008
        printer-dns-sd-name (nameWithoutLanguage): 'Canon MF645C'
            name: printer-dns-sd-name
            nameWithoutLanguage value: Canon MF645C
        printer-firmware-name (nameWithoutLanguage): 'Main Controller'
            name: printer-firmware-name
            nameWithoutLanguage value: Main Controller
        printer-firmware-string-version (textWithoutLanguage): '13.01'
            name: printer-firmware-string-version
            textWithoutLanguage value: 13.01
        printer-firmware-version (octetString): '1301\000\000\000\000\000\000\000\000\000\000\000\000'
            name: printer-firmware-version
            octetString value: 1301
        media-col-supported (1setOf keyword): 'media-size','media-bottom-margin','media-left-margin','media-right-margin','media-top-margin','media-type','media-source','media-source-properties','media-auto-dimension'
            name: media-col-supported
            keyword value: media-size
            keyword value: media-bottom-margin
            keyword value: media-left-margin
            keyword value: media-right-margin
            keyword value: media-top-margin
            keyword value: media-type
            keyword value: media-source
            keyword value: media-source-properties
            keyword value: media-auto-dimension
            collection {x-dimension,y-dimension}
         [truncated]job-creation-attributes-supported (1setOf keyword): 'copies','finishings','media','orientation-requested','output-bin','print-quality','printer-resolution','sides','media-col','output-mode','print-color-mode','ipp-attribute-fid
            name: job-creation-attributes-supported
            keyword value: copies
            keyword value: finishings
            keyword value: media
            keyword value: orientation-requested
            keyword value: output-bin
            keyword value: print-quality
            keyword value: printer-resolution
            keyword value: sides
            keyword value: media-col
            keyword value: output-mode
            keyword value: print-color-mode
            keyword value: ipp-attribute-fidelity
            keyword value: job-name
            keyword value: multiple-document-handling
            keyword value: page-ranges
         [truncated]media-col-default (collection): {media-size{x-dimension,y-dimension},media-bottom-margin,media-left-margin,media-right-margin,media-top-margin,media-type,media-source,media-source-properties{media-source-feed-direction,media-so
            name: media-col-default
            collection {media-size{x-dimension,y-dimension},media-bottom-margin,media-left-margin,media-right-margin,media-top-margin,media-type,media-source,media-source-properties...}
        print-color-mode-default (keyword): 'auto'
            name: print-color-mode-default
            keyword value: auto
        print-color-mode-supported (1setOf keyword): 'auto','color','monochrome','auto-monochrome'
            name: print-color-mode-supported
            keyword value: auto
            keyword value: color
            keyword value: monochrome
            keyword value: auto-monochrome
        printer-geo-location (uri): 'geo:0.000000,0.000000'
            name: printer-geo-location
            uri value: geo:0.000000,0.000000
        page-ranges-supported (boolean): true
            name: page-ranges-supported
            boolean value: True
        multiple-operation-time-out (integer): 60
            name: multiple-operation-time-out
            integer value: 60
        print-scaling-default (keyword): 'auto'
            name: print-scaling-default
            keyword value: auto
        print-scaling-supported (1setOf keyword): 'auto','auto-fit','fill','fit','none'
            name: print-scaling-supported
            keyword value: auto
            keyword value: auto-fit
            keyword value: fill
            keyword value: fit
            keyword value: none
        print-content-optimize-default (keyword): 'auto'
            name: print-content-optimize-default
            keyword value: auto
        print-content-optimize-supported (keyword): 'auto'
            name: print-content-optimize-supported
            keyword value: auto
        multiple-document-handling-default (keyword): 'separate-documents-collated-copies'
            name: multiple-document-handling-default
            keyword value: separate-documents-collated-copies
        multiple-document-handling-supported (1setOf keyword): 'separate-documents-collated-copies','separate-documents-uncollated-copies'
            name: multiple-document-handling-supported
            keyword value: separate-documents-collated-copies
            keyword value: separate-documents-uncollated-copies
        multiple-operation-time-out-action (keyword): 'abort-job'
            name: multiple-operation-time-out-action
            keyword value: abort-job
        printer-config-change-date-time (dateTime): 2024-08-13T19:32:49.0+0300
            name: printer-config-change-date-time
            dateTime value: 2024-08-13T19:32:49.0+0300
        printer-state-change-date-time (dateTime): 2024-08-14T11:19:14.0+0300
            name: printer-state-change-date-time
            dateTime value: 2024-08-14T11:19:14.0+0300
        printer-state-change-time (integer): 1723623554
            name: printer-state-change-time
            integer value: 1723623554
        document-format-preferred (mimeMediaType): 'application/pdf'
            name: document-format-preferred
            mimeMediaType value: application/pdf
        printer-current-time (dateTime): 2024-08-14T11:19:14.0+0300
            name: printer-current-time
            dateTime value: 2024-08-14T11:19:14.0+0300
        printer-strings-languages-supported (naturalLanguage): 'en'
            name: printer-strings-languages-supported
            naturalLanguage value: en
        printer-strings-uri (no-value)
            out-of-band value: no-value (0x13)
        finishings-default (enum): none
            name: finishings-default
            finishings: none (3)
        finishings-supported (enum): none
            name: finishings-supported
            finishings: none (3)
        identify-actions-default (keyword): 'flash'
            name: identify-actions-default
            keyword value: flash
        identify-actions-supported (1setOf keyword): 'flash','sound'
            name: identify-actions-supported
            keyword value: flash
            keyword value: sound
         [truncated]media-col-ready (collection): {media-size{x-dimension,y-dimension},media-bottom-margin,media-left-margin,media-right-margin,media-top-margin,media-type,media-source,media-source-properties{media-source-feed-direction,media-sour
            name: media-col-ready
            collection {media-size{x-dimension,y-dimension},media-bottom-margin,media-left-margin,media-right-margin,media-top-margin,media-type,media-source,media-source-properties...}
        media-ready (keyword): 'iso_a4_210x297mm'
            name: media-ready
            keyword value: iso_a4_210x297mm
        output-bin-default (keyword): 'face-down'
            name: output-bin-default
            keyword value: face-down
        output-bin-supported (keyword): 'face-down'
            name: output-bin-supported
            keyword value: face-down
        pages-per-minute (integer): 21
            name: pages-per-minute
            integer value: 21
        pages-per-minute-color (integer): 21
            name: pages-per-minute-color
            integer value: 21
         [truncated]printer-input-tray (1setOf octetString): 'type=other;mediafeed=0;mediaxfeed=0;maxcapacity=1;level=0;status=3;name=auto;','type=sheetFeedAutoNonRemovableTray;mediafeed=0;mediaxfeed=0;maxcapacity=1;level=0;status=3;name=Stack Byp
            name: printer-input-tray
            octetString value: type=other;mediafeed=0;mediaxfeed=0;maxcapacity=1;level=0;status=3;name=auto;
            octetString value: type=sheetFeedAutoNonRemovableTray;mediafeed=0;mediaxfeed=0;maxcapacity=1;level=0;status=3;name=Stack Bypass;
            octetString value: type=sheetFeedAutoRemovableTray;mediafeed=29700;mediaxfeed=21000;maxcapacity=150;level=150;status=0;name=Drawer1;
        printer-output-tray (octetString): 'type=unRemovableBin;maxcapacity=100;remaining=-2;status=5;name=Tray1;stackingorder=firstToLast;pagedelivery=faceDown;'
            name: printer-output-tray
            octetString value: type=unRemovableBin;maxcapacity=100;remaining=-2;status=5;name=Tray1;stackingorder=firstToLast;pagedelivery=faceDown;
        printer-supply-info-uri (uri): 'http://192.168.20.7:80/airprint.html'
            name: printer-supply-info-uri
            uri value: http://192.168.20.7:80/airprint.html
        sides-default (keyword): 'one-sided'
            name: sides-default
            keyword value: one-sided
        sides-supported (1setOf keyword): 'one-sided','two-sided-long-edge','two-sided-short-edge'
            name: sides-supported
            keyword value: one-sided
            keyword value: two-sided-long-edge
            keyword value: two-sided-short-edge
        number-up-default (integer): 1
            name: number-up-default
            integer value: 1
        number-up-supported (1setOf integer): 1,2,4,6,8,9,16
            name: number-up-supported
            integer value: 1
            integer value: 2
            integer value: 4
            integer value: 6
            integer value: 8
            integer value: 9
            integer value: 16
        presentation-direction-number-up-default (keyword): 'toright-tobottom'
            name: presentation-direction-number-up-default
            keyword value: toright-tobottom
        presentation-direction-number-up-supported (1setOf keyword): 'toright-tobottom','toleft-tobottom'
            name: presentation-direction-number-up-supported
            keyword value: toright-tobottom
            keyword value: toleft-tobottom
        landscape-orientation-requested-preferred (enum): 4
            name: landscape-orientation-requested-preferred
            enum value: 4
        marker-colors (1setOf nameWithoutLanguage): '#000000','#00FFFF','#FF00FF','#FFFF00'
            name: marker-colors
            nameWithoutLanguage value: #000000
            nameWithoutLanguage value: #00FFFF
            nameWithoutLanguage value: #FF00FF
            nameWithoutLanguage value: #FFFF00
        marker-high-levels (1setOf integer): 100,100,100,100
            name: marker-high-levels
            integer value: 100
            integer value: 100
            integer value: 100
            integer value: 100
        marker-levels (1setOf integer): 78,98,99,96
            name: marker-levels
            integer value: 78
            integer value: 98
            integer value: 99
            integer value: 96
        marker-low-levels (1setOf integer): 7,7,7,7
            name: marker-low-levels
            integer value: 7
            integer value: 7
            integer value: 7
            integer value: 7
        marker-names (1setOf nameWithoutLanguage): 'Canon Cartridge 054 Black Toner','Canon Cartridge 054 Cyan Toner','Canon Cartridge 054 Magenta To','Canon Cartridge 054 Yellow Ton'
            name: marker-names
            nameWithoutLanguage value: Canon Cartridge 054 Black Toner
            nameWithoutLanguage value: Canon Cartridge 054 Cyan Toner
            nameWithoutLanguage value: Canon Cartridge 054 Magenta To
            nameWithoutLanguage value: Canon Cartridge 054 Yellow Ton
        marker-types (1setOf keyword): 'toner','toner','toner','toner'
            name: marker-types
            keyword value: toner
            keyword value: toner
            keyword value: toner
            keyword value: toner
        media-source-supported (1setOf keyword): 'auto','by-pass-tray','tray-1'
            name: media-source-supported
            keyword value: auto
            keyword value: by-pass-tray
            keyword value: tray-1
        media-type-supported (1setOf keyword): 'stationery','stationery-lightweight','stationery-heavyweight','envelope','labels'
            name: media-type-supported
            keyword value: stationery
            keyword value: stationery-lightweight
            keyword value: stationery-heavyweight
            keyword value: envelope
            keyword value: labels
        output-mode-default (keyword): 'auto'
            name: output-mode-default
            keyword value: auto
        output-mode-supported (1setOf keyword): 'auto','monochrome','auto-monochrome','color'
            name: output-mode-supported
            keyword value: auto
            keyword value: monochrome
            keyword value: auto-monochrome
            keyword value: color
        pdf-k-octets-supported (rangeOfInteger): 0-256000
            name: pdf-k-octets-supported
            rangeOfInteger value: 0-256000
        printer-kind (1setOf keyword): 'document','envelope','postcard'
            name: printer-kind
            keyword value: document
            keyword value: envelope
            keyword value: postcard
        finishings-col-database (collection): {finishing-template}
            name: finishings-col-database
            collection {finishing-template}
        finishings-col-default (collection): {finishing-template}
            name: finishings-col-default
            collection {finishing-template}
        finishings-col-ready (collection): {finishing-template}
            name: finishings-col-ready
            collection {finishing-template}
        finishings-col-supported (keyword): 'finishing-template'
            name: finishings-col-supported
            keyword value: finishing-template
        finishings-ready (enum): none
            name: finishings-ready
            finishings: none (3)
        finishing-template-supported (keyword): 'none'
            name: finishing-template-supported
            keyword value: none
        job-pages-per-set-supported (boolean): true
            name: job-pages-per-set-supported
            boolean value: True
        overrides-supported (1setOf keyword): 'media','media-col','document-numbers','pages'
            name: overrides-supported
            keyword value: media
            keyword value: media-col
            keyword value: document-numbers
            keyword value: pages
        pwg-raster-document-sheet-back (keyword): 'normal'
            name: pwg-raster-document-sheet-back
            keyword value: normal
        pwg-raster-document-resolution-supported (resolution): 300x300dpi
            name: pwg-raster-document-resolution-supported
            resolution value: 300x300dpi
        pwg-raster-document-type-supported (1setOf keyword): 'srgb_8','sgray_8','rgb_8'
            name: pwg-raster-document-type-supported
            keyword value: srgb_8
            keyword value: sgray_8
            keyword value: rgb_8
        mopria-certified (textWithoutLanguage): '1.3'
            name: mopria-certified
            textWithoutLanguage value: 1.3
        print_wfds (nameWithoutLanguage): 'T'
            name: print_wfds
            nameWithoutLanguage value: T
    end-of-attributes-tag

ipp-canon.zip

hannut commented 2 months ago

Also the printer has the latest firmware from Canon. I have had this printer for several years and working with cups

hannut commented 2 months ago

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

michaelrsweet commented 2 months ago

Hmm, the printer-uri is blank on the second request. Investigating...

michaelrsweet commented 2 months ago

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)

hannut commented 2 months ago

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

hannut commented 2 months ago

@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)
michaelrsweet commented 2 months ago

We can continue here…

zdohnal commented 2 months ago

@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...

michaelrsweet commented 1 month ago

@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.

michaelrsweet commented 1 month ago

@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.

tangyanli commented 1 month ago

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, 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.

After setting the queue as above:

  1. on Debian10.3 (with cups 2.2.10 and cups-filter 1.28.x), cups sends pwg-raster-format document to device, and the printing is OK.
  2. on Ubuntu24.04 (with cups 2.4.7 and cups-filter 2.0), cups sends cups-raster-format document to device, and the device returns error code client-error-document-format-error.

But I don’t know why does cups send cups-raster-format document to the device on Ubuntu24.04.

zdohnal commented 1 month ago

@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?

tangyanli commented 1 month ago

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:

  1. Add the queue by the command: #lpadmin -p canon -v deivce-uri -E -m everywhere -> Cups sends the pdf document to device and the printing is OK.
  2. On localhost:631, modify the new added queue "canon" and update its model as "Generic IPP Everywhere Printer (en)" -> Cups sends the cups-raster formant document to device and the printing is NG.
zdohnal commented 1 month ago

@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.

RodBarnes commented 4 weeks ago

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.

RodBarnes commented 1 week ago

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.