我刚刚在工作站上安装了 Debian Bookworm (12),但无法通过网络打印京瓷 M2040dn不再。它在 Debian Bullseye (11) 上运行良好,但我记不清当时是否需要安装 PPD。(我有旧系统的完整磁盘映像备份,但不知道如何从旧文件系统中提取此信息。)
- http://localhost:631/jobs/ 显示打印作业未被接受。对于任何打印作业(页面似乎每次打印尝试都会增加)
- 日志
/var/log/cups/error_log
完成作业client-error-bad-request
我经常在不同的办公室使用不同的 IPP 网络打印机,并且非常希望无人驱动打印可以正常工作。CUPS 可以正常检测打印机,并且似乎可以将我的打印作业发送到该设备。
- 我不太明白错误信息。到底哪里出错了?哪一步失败了?
- 什么可以解决这个问题?
以下是我所拥有的和我所做的:
- 打印机和工作站均通过同一子网上的 LAN 连接
- 我可以 ping 打印机的 IP 地址 192.168.1.219(通过 DHCP 获取)及其别名 M2040dn.local
- 我尝试按照https://superuser.com/a/1563718/56756
- 我不知道我在打印机上启用了什么限制。同一子网上的任何人都可以正常打印。以前它工作正常,从那时起我绝对没有更改打印机配置。
- 据我了解,日志 CUPS 可以建立 TCP 连接,并且它们成功交换有关打印机的设备信息并打印我的文档的数据
- 我已经启用了调试日志记录
$ sudo cupsctl --debug-logging
$ sudo cupsctl LogLevel=debug2
- 除了自动发现的打印机外,我还尝试手动添加具有明确主机名的打印机https://askubuntu.com/a/1422434/465184使用以下命令,但出现相同的错误打印作业未被接受。在 http://localhost:631/jobs/
$ sudo lpadmin -p Kyocera_ECOSYS_M2040dn -v "ipps://Kyocera%20ECOSYS%20M2040dn._ipps._tcp.local/" -E -m everywhere
以下是示例作业日志。当 CUPS 尝试完成作业时,最后一部分会不断重复。
D [22/Feb/2024:12:29:41 +0100] [Job 10] Applying default options...
D [22/Feb/2024:12:29:41 +0100] [Job 10] Adding default copies=1
D [22/Feb/2024:12:29:41 +0100] [Job 10] Adding default cups-browsed-dest-printer=\"8 ipps://Kyocera%20ECOSYS%20M2040dn._ipps._tcp.local/ pdf 600dpi\"
D [22/Feb/2024:12:29:41 +0100] [Job 10] Adding default finishings=0
D [22/Feb/2024:12:29:41 +0100] [Job 10] Adding default job-cancel-after=10800
D [22/Feb/2024:12:29:41 +0100] [Job 10] Adding default job-hold-until=no-hold
D [22/Feb/2024:12:29:41 +0100] [Job 10] Adding default media=iso_a4_210x297mm
D [22/Feb/2024:12:29:41 +0100] [Job 10] Adding default notify-events=job-completed
D [22/Feb/2024:12:29:41 +0100] [Job 10] Adding default notify-lease-duration=86400
D [22/Feb/2024:12:29:41 +0100] [Job 10] Adding default number-up=1
D [22/Feb/2024:12:29:41 +0100] [Job 10] Adding default orientation-requested=0
D [22/Feb/2024:12:29:41 +0100] [Job 10] Adding default output-bin=top
D [22/Feb/2024:12:29:41 +0100] [Job 10] Adding default print-quality=0
D [22/Feb/2024:12:29:41 +0100] [Job 10] Adding default printer-resolution=600x600dpi
D [22/Feb/2024:12:29:41 +0100] [Job 10] Adding default sides=two-sided-long-edge
I [22/Feb/2024:12:29:41 +0100] [Job 10] Adding start banner page "none".
I [22/Feb/2024:12:29:41 +0100] [Job 10] Adding end banner page "none".
I [22/Feb/2024:12:29:41 +0100] [Job 10] File of type application/pdf queued by "daniel".
D [22/Feb/2024:12:29:41 +0100] [Job 10] hold_until=0
I [22/Feb/2024:12:29:41 +0100] [Job 10] Queued on "Kyocera_ECOSYS_M2040dn" by "daniel".
d [22/Feb/2024:12:29:41 +0100] cupsdCheckJobs: Job 10 - dest="Kyocera_ECOSYS_M2040dn", printer=(nil), state=3, cancel_time=0, hold_until=0, kill_time=0, pending_cost=0, pending_timeout=0
D [22/Feb/2024:12:29:41 +0100] [Job 10] time-at-processing=1708601381
D [22/Feb/2024:12:29:41 +0100] [Job 10] 3 filters for job:
D [22/Feb/2024:12:29:41 +0100] [Job 10] pdftopdf (application/pdf to application/vnd.cups-pdf, cost 66)
D [22/Feb/2024:12:29:41 +0100] [Job 10] - (application/vnd.cups-pdf to printer/Kyocera_ECOSYS_M2040dn/application/pdf, cost 10)
D [22/Feb/2024:12:29:41 +0100] [Job 10] - (printer/Kyocera_ECOSYS_M2040dn/application/pdf to printer/Kyocera_ECOSYS_M2040dn, cost 0)
D [22/Feb/2024:12:29:41 +0100] [Job 10] job-sheets=none,none
d [22/Feb/2024:12:29:41 +0100] [Job 10] Mapping output-bin to OutputBin=Top
d [22/Feb/2024:12:29:41 +0100] [Job 10] After mapping finishings OutputBin=Top
D [22/Feb/2024:12:29:41 +0100] [Job 10] argv[0]="Kyocera_ECOSYS_M2040dn"
D [22/Feb/2024:12:29:41 +0100] [Job 10] argv[1]="10"
D [22/Feb/2024:12:29:41 +0100] [Job 10] argv[2]="daniel"
D [22/Feb/2024:12:29:41 +0100] [Job 10] argv[3]="MyPDF.pdf"
D [22/Feb/2024:12:29:41 +0100] [Job 10] argv[4]="1"
D [22/Feb/2024:12:29:41 +0100] [Job 10] argv[5]="PageSize=A4 EPRendering=None XRXColor=BW INK=MONO SelectColor=Grayscale HPColorMode=GrayscalePrint ProcessColorModel=Mono BRMonoColor=Mono CNGrayscale PrintoutMode=Normal.Gray BRPrintQuality=Black Collate Duplex=DuplexNoTumble ColorMode=Mono CNIJGrayScale=1 ARCMode=CMBW ColorModel=Gray OKControl=Gray XROutputColor=PrintAsGrayscale BLW=TrueM job-uuid=urn:uuid:436a9578-62ae-3e55-55fe-2ba2e49b136a cups-browsed-dest-printer=\\\"8\\ ipps://Kyocera%20ECOSYS%20M2040dn._ipps._tcp.local/\\ pdf\\ 600dpi\\\" finishings=0 media=iso_a4_210x297mm number-up=1 orientation-requested=0 output-bin=top print-quality=0 printer-resolution=600x600dpi sides=two-sided-long-edge job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1708601381 time-at-processing=1708601381 OutputBin=Top"
D [22/Feb/2024:12:29:41 +0100] [Job 10] argv[6]="/var/spool/cups/d00010-001"
D [22/Feb/2024:12:29:41 +0100] [Job 10] envp[0]="CUPS_CACHEDIR=/var/cache/cups"
D [22/Feb/2024:12:29:41 +0100] [Job 10] envp[1]="CUPS_DATADIR=/usr/share/cups"
D [22/Feb/2024:12:29:41 +0100] [Job 10] envp[2]="CUPS_DOCROOT=/usr/share/cups/doc-root"
D [22/Feb/2024:12:29:41 +0100] [Job 10] envp[3]="CUPS_REQUESTROOT=/var/spool/cups"
D [22/Feb/2024:12:29:41 +0100] [Job 10] envp[4]="CUPS_SERVERBIN=/usr/lib/cups"
D [22/Feb/2024:12:29:41 +0100] [Job 10] envp[5]="CUPS_SERVERROOT=/etc/cups"
D [22/Feb/2024:12:29:41 +0100] [Job 10] envp[6]="CUPS_STATEDIR=/run/cups"
D [22/Feb/2024:12:29:41 +0100] [Job 10] envp[7]="HOME=/var/spool/cups/tmp"
D [22/Feb/2024:12:29:41 +0100] [Job 10] envp[8]="PATH=/usr/lib/cups/filter:/usr/bin:/usr/sbin:/bin:/usr/bin"
D [22/Feb/2024:12:29:41 +0100] [Job 10] envp[9]="SERVER_ADMIN=root@my-workstation"
D [22/Feb/2024:12:29:41 +0100] [Job 10] envp[10]="SOFTWARE=CUPS/2.4.2"
D [22/Feb/2024:12:29:41 +0100] [Job 10] envp[11]="TMPDIR=/var/spool/cups/tmp"
D [22/Feb/2024:12:29:41 +0100] [Job 10] envp[12]="USER=root"
D [22/Feb/2024:12:29:41 +0100] [Job 10] envp[13]="CUPS_MAX_MESSAGE=2047"
D [22/Feb/2024:12:29:41 +0100] [Job 10] envp[14]="CUPS_SERVER=/run/cups/cups.sock"
D [22/Feb/2024:12:29:41 +0100] [Job 10] envp[15]="CUPS_ENCRYPTION=IfRequested"
D [22/Feb/2024:12:29:41 +0100] [Job 10] envp[16]="IPP_PORT=631"
D [22/Feb/2024:12:29:41 +0100] [Job 10] envp[17]="CHARSET=utf-8"
D [22/Feb/2024:12:29:41 +0100] [Job 10] envp[18]="LANG=en_US.UTF-8"
D [22/Feb/2024:12:29:41 +0100] [Job 10] envp[19]="PPD=/etc/cups/ppd/Kyocera_ECOSYS_M2040dn.ppd"
D [22/Feb/2024:12:29:41 +0100] [Job 10] envp[20]="CONTENT_TYPE=application/pdf"
D [22/Feb/2024:12:29:41 +0100] [Job 10] envp[21]="DEVICE_URI=ipps://M2040dn.local:443/ipp/print"
D [22/Feb/2024:12:29:41 +0100] [Job 10] envp[22]="PRINTER_INFO=Kyocera_ECOSYS_M2040dn"
D [22/Feb/2024:12:29:41 +0100] [Job 10] envp[23]="PRINTER_LOCATION="
D [22/Feb/2024:12:29:41 +0100] [Job 10] envp[24]="PRINTER=Kyocera_ECOSYS_M2040dn"
D [22/Feb/2024:12:29:41 +0100] [Job 10] envp[25]="PRINTER_STATE_REASONS=media-empty-report"
D [22/Feb/2024:12:29:41 +0100] [Job 10] envp[26]="CUPS_FILETYPE=document"
D [22/Feb/2024:12:29:41 +0100] [Job 10] envp[27]="FINAL_CONTENT_TYPE=application/pdf"
D [22/Feb/2024:12:29:41 +0100] [Job 10] envp[28]="AUTH_I****"
I [22/Feb/2024:12:29:41 +0100] [Job 10] Started filter /usr/lib/cups/filter/pdftopdf (PID 768747)
I [22/Feb/2024:12:29:41 +0100] [Job 10] Started backend /usr/lib/cups/backend/ipps (PID 768748)
D [22/Feb/2024:12:29:41 +0100] [Job 10] Sending stdin for job...
D [22/Feb/2024:12:29:41 +0100] [Job 10] STATE: +connecting-to-device
D [22/Feb/2024:12:29:41 +0100] [Job 10] Looking up \"M2040dn.local\"...
D [22/Feb/2024:12:29:41 +0100] [Job 10] pdftopdf: Last filter determined by the PPD: -; FINAL_CONTENT_TYPE: application/pdf => pdftopdf will log pages in page_log.
D [22/Feb/2024:12:29:41 +0100] [Job 10] STATE: -connecting-to-device
D [22/Feb/2024:12:29:41 +0100] [Job 10] M2040dn.local=192.168.1.219
D [22/Feb/2024:12:29:41 +0100] [Job 10] backendWaitLoop(snmp_fd=5, addr=0x5566b3764b68, side_cb=0x5566b35cb070)
D [22/Feb/2024:12:29:41 +0100] [Job 10] PDF interactive form and annotation flattening done via QPDF
D [22/Feb/2024:12:29:41 +0100] [Job 10] pdftopdf: \"print-scaling\" IPP attribute: auto
D [22/Feb/2024:12:29:41 +0100] [Job 10] pdftopdf: Print scaling mode: Do not scale, center, crop if needed
D [22/Feb/2024:12:29:41 +0100] [Job 10] After Cropping: 596.000000 842.000000 595.275574 841.889771
D [22/Feb/2024:12:29:41 +0100] [Job 10] After Cropping: 596.000000 842.000000 595.275574 841.889771
D [22/Feb/2024:12:29:41 +0100] [Job 10] PAGE: 1 1
D [22/Feb/2024:12:29:41 +0100] [Job 10] PAGE: 2 1
D [22/Feb/2024:12:29:41 +0100] [Job 10] Connecting to M2040dn.local:443
D [22/Feb/2024:12:29:41 +0100] [Job 10] PID 768747 (/usr/lib/cups/filter/pdftopdf) exited with no errors.
D [22/Feb/2024:12:29:41 +0100] [Job 10] Connecting to printer.
D [22/Feb/2024:12:29:41 +0100] [Job 10] Set job-printer-state-message to "Connecting to printer.", current level=INFO
D [22/Feb/2024:12:29:42 +0100] [Job 10] update_reasons(attr=0(), s=\"-cups-certificate-error\")
d [22/Feb/2024:12:29:42 +0100] [Job 10] op=\'-\', new_reasons=1, state_reasons=1
D [22/Feb/2024:12:29:42 +0100] [Job 10] Connection is encrypted.
d [22/Feb/2024:12:29:42 +0100] cupsdCheckJobs: Job 10 - dest="Kyocera_ECOSYS_M2040dn", printer=0x55c8fce1ba70, state=5, cancel_time=1708612181, hold_until=0, kill_time=0, pending_cost=0, pending_timeout=0
D [22/Feb/2024:12:29:42 +0100] [Job 10] Credentials are OK/trusted ((null))
D [22/Feb/2024:12:29:42 +0100] [Job 10] Printer credentials: M2040dn (issued by unknown) / Mon, 05 Jul 2027 01:34:03 GMT / RSA-SHA256 / 46297C9BE8AF66337FFCC8495A017A1D
D [22/Feb/2024:12:29:42 +0100] [Job 10] Stored credentials: M2040dn (issued by unknown) / Mon, 05 Jul 2027 01:34:03 GMT / RSA-SHA256 / 46297C9BE8AF66337FFCC8495A017A1D
D [22/Feb/2024:12:29:42 +0100] [Job 10] update_reasons(attr=0(), s=\"-cups-pki-invalid,cups-pki-changed,cups-pki-expired,cups-pki-unknown\")
d [22/Feb/2024:12:29:42 +0100] [Job 10] op=\'-\', new_reasons=4, state_reasons=1
D [22/Feb/2024:12:29:42 +0100] [Job 10] update_reasons(attr=0(), s=\"-connecting-to-device\")
d [22/Feb/2024:12:29:42 +0100] [Job 10] op=\'-\', new_reasons=1, state_reasons=1
D [22/Feb/2024:12:29:42 +0100] [Job 10] Connected to printer.
D [22/Feb/2024:12:29:42 +0100] [Job 10] Set job-printer-state-message to "Connected to printer.", current level=INFO
D [22/Feb/2024:12:29:42 +0100] [Job 10] Connected to 192.168.1.219:443...
D [22/Feb/2024:12:29:42 +0100] [Job 10] Getting supported attributes...
D [22/Feb/2024:12:29:42 +0100] [Job 10] Get-Printer-Attributes: successful-ok-ignored-or-substituted-attributes (successful-ok-ignored-or-substituted-attributes)
D [22/Feb/2024:12:29:42 +0100] [Job 10] copies-supported=1-999
D [22/Feb/2024:12:29:42 +0100] [Job 10] document-format-supported (10 values)
D [22/Feb/2024:12:29:42 +0100] [Job 10] [0] = \"application/octet-stream\"
D [22/Feb/2024:12:29:42 +0100] [Job 10] [1] = \"application/pdf\"
D [22/Feb/2024:12:29:42 +0100] [Job 10] [2] = \"image/tiff\"
D [22/Feb/2024:12:29:42 +0100] [Job 10] [3] = \"image/jpeg\"
D [22/Feb/2024:12:29:42 +0100] [Job 10] [4] = \"image/urf\"
D [22/Feb/2024:12:29:42 +0100] [Job 10] [5] = \"application/postscript\"
D [22/Feb/2024:12:29:42 +0100] [Job 10] [6] = \"application/vnd.hp-PCL\"
D [22/Feb/2024:12:29:42 +0100] [Job 10] [7] = \"application/vnd.hp-PCLXL\"
D [22/Feb/2024:12:29:42 +0100] [Job 10] [8] = \"application/vnd.xpsdocument\"
D [22/Feb/2024:12:29:42 +0100] [Job 10] [9] = \"image/pwg-raster\"
D [22/Feb/2024:12:29:42 +0100] [Job 10] media-col-supported (7 values)
D [22/Feb/2024:12:29:42 +0100] [Job 10] [0] = \"media-size\"
D [22/Feb/2024:12:29:42 +0100] [Job 10] [1] = \"media-bottom-margin\"
D [22/Feb/2024:12:29:42 +0100] [Job 10] [2] = \"media-left-margin\"
D [22/Feb/2024:12:29:42 +0100] [Job 10] [3] = \"media-right-margin\"
D [22/Feb/2024:12:29:42 +0100] [Job 10] [4] = \"media-top-margin\"
D [22/Feb/2024:12:29:42 +0100] [Job 10] [5] = \"media-source\"
D [22/Feb/2024:12:29:42 +0100] [Job 10] [6] = \"media-type\"
D [22/Feb/2024:12:29:42 +0100] [Job 10] operations-supported (9 values)
D [22/Feb/2024:12:29:42 +0100] [Job 10] [0] = Print-Job
D [22/Feb/2024:12:29:42 +0100] [Job 10] [1] = Validate-Job
D [22/Feb/2024:12:29:42 +0100] [Job 10] [2] = Cancel-Job
D [22/Feb/2024:12:29:42 +0100] [Job 10] [3] = Send-Document
D [22/Feb/2024:12:29:42 +0100] [Job 10] [4] = Create-Job
D [22/Feb/2024:12:29:42 +0100] [Job 10] [5] = Get-Job-Attributes
D [22/Feb/2024:12:29:42 +0100] [Job 10] [6] = Get-Jobs
D [22/Feb/2024:12:29:42 +0100] [Job 10] [7] = Get-Printer-Attributes
D [22/Feb/2024:12:29:42 +0100] [Job 10] [8] = Identify-Printer
D [22/Feb/2024:12:29:42 +0100] [Job 10] Sleeping...
D [22/Feb/2024:12:29:42 +0100] [Job 10] Set job-printer-state-message to "Sleeping... ", current level=INFO
D [22/Feb/2024:12:29:42 +0100] [Job 10] update_reasons(attr=1(media-empty-report), s=\"(null)\")
d [22/Feb/2024:12:29:42 +0100] [Job 10] op=\' \', new_reasons=1, state_reasons=1
D [22/Feb/2024:12:29:42 +0100] [Job 10] ATTR: marker-colors=\'\"#000000\"\',\'\"none\"\'
D [22/Feb/2024:12:29:42 +0100] [Job 10] ATTR: marker-high-levels=100,95
D [22/Feb/2024:12:29:42 +0100] [Job 10] ATTR: marker-levels=70,0
D [22/Feb/2024:12:29:42 +0100] [Job 10] ATTR: marker-low-levels=5,0
D [22/Feb/2024:12:29:42 +0100] [Job 10] ATTR: marker-names=\'\"Black TK-1170S\"\',\'\"Waste Toner Box\"\'
D [22/Feb/2024:12:29:42 +0100] [Job 10] ATTR: marker-types=\'\"toner\"\',\'\"waste-toner\"\'
D [22/Feb/2024:12:29:42 +0100] [Job 10] final_content_type=\"application/pdf\", document_format=\"application/pdf\"
D [22/Feb/2024:12:29:42 +0100] [Job 10] retryable=1
D [22/Feb/2024:12:29:42 +0100] [Job 10] Validate-Job IPP/2.0
D [22/Feb/2024:12:29:42 +0100] [Job 10] printer-uri=\"ipps://M2040dn.local:443/ipp/print\"
D [22/Feb/2024:12:29:42 +0100] [Job 10] requesting-user-name=\"daniel\"
D [22/Feb/2024:12:29:42 +0100] [Job 10] job-name=\"MyPDF.pdf\"
D [22/Feb/2024:12:29:42 +0100] [Job 10] document-format=\"application/pdf\"
D [22/Feb/2024:12:29:42 +0100] [Job 10] Adding standard IPP operation/job attributes.
D [22/Feb/2024:12:29:42 +0100] [Job 10] IPP/2.0 Validate-Job #2
D [22/Feb/2024:12:29:42 +0100] [Job 10] ---- operation-attributes-tag ----
D [22/Feb/2024:12:29:42 +0100] [Job 10] attributes-charset charset utf-8
D [22/Feb/2024:12:29:42 +0100] [Job 10] attributes-natural-language naturalLanguage en-us
D [22/Feb/2024:12:29:42 +0100] [Job 10] printer-uri uri ipps://M2040dn.local:443/ipp/print
D [22/Feb/2024:12:29:42 +0100] [Job 10] requesting-user-name nameWithoutLanguage daniel
D [22/Feb/2024:12:29:42 +0100] [Job 10] job-name nameWithoutLanguage MyPDF.pdf
D [22/Feb/2024:12:29:42 +0100] [Job 10] document-format mimeMediaType application/pdf
D [22/Feb/2024:12:29:42 +0100] [Job 10] ---- job-attributes-tag ----
D [22/Feb/2024:12:29:42 +0100] [Job 10] media-col collection {media-size={x-dimension=21000 y-dimension=29700} media-bottom-margin=400 media-left-margin=400 media-right-margin=400 media-top-margin=400}
D [22/Feb/2024:12:29:42 +0100] [Job 10] output-bin keyword top
D [22/Feb/2024:12:29:42 +0100] [Job 10] print-color-mode keyword auto-monochrome
D [22/Feb/2024:12:29:42 +0100] [Job 10] print-quality enum 0
D [22/Feb/2024:12:29:42 +0100] [Job 10] sides keyword two-sided-long-edge
D [22/Feb/2024:12:29:42 +0100] [Job 10] multiple-document-handling keyword separate-documents-collated-copies
D [22/Feb/2024:12:29:42 +0100] [Job 10] ---- end-of-attributes-tag ----
D [22/Feb/2024:12:29:42 +0100] [Job 10] Validate-Job: client-error-bad-request (client-error-bad-request)
...
(IP 子网、工作站主机名、原始 PDF 名称因隐私原因已被删除)