打印时我收到“过滤失败”。根据 CUPS 日志,横幅设置为“none”,但bannertopdf
过滤器仍然失败,并出现权限被拒绝的错误输出:
D [21/Dec/2020:12:48:31 +0100] [Job 926] PID 88203 (/usr/lib/cups/filter/bannertopdf) stopped with status 1.
...
D [21/Dec/2020:12:48:31 +0100] [Job 926] Error opening banner file: Permission denied
D [21/Dec/2020:12:48:31 +0100] [Job 926] Error: could not read banner file
...
这里是bannertopdf 错误的完整日志:
D [21/Dec/2020:12:48:31 +0100] cupsdSetBusyState: newbusy="Active clients and dirty files", busy="Active clients and dirty files"
D [21/Dec/2020:12:48:31 +0100] [Job 926] Applying default options...
D [21/Dec/2020:12:48:31 +0100] add_job: requesting-user-name="root"
D [21/Dec/2020:12:48:31 +0100] Adding default job-sheets values "none,none"...
I [21/Dec/2020:12:48:31 +0100] [Job 926] Adding start banner page "none".
D [21/Dec/2020:12:48:31 +0100] cupsdMarkDirty(----S)
D [21/Dec/2020:12:48:31 +0100] cupsdSetBusyState: newbusy="Active clients and dirty files", busy="Active clients and dirty files"
D [21/Dec/2020:12:48:31 +0100] cupsdMarkDirty(---J-)
D [21/Dec/2020:12:48:31 +0100] cupsdSetBusyState: newbusy="Active clients and dirty files", busy="Active clients and dirty files"
I [21/Dec/2020:12:48:31 +0100] [Job 926] Adding end banner page "none".
I [21/Dec/2020:12:48:31 +0100] [Job 926] File of type application/vnd.cups-pdf-banner queued by "root".
D [21/Dec/2020:12:48:31 +0100] [Job 926] hold_until=0
I [21/Dec/2020:12:48:31 +0100] [Job 926] Queued on "MFCJ470DW" by "root".
D [21/Dec/2020:12:48:31 +0100] [Job 926] time-at-processing=1608551311
D [21/Dec/2020:12:48:31 +0100] cupsdMarkDirty(---J-)
D [21/Dec/2020:12:48:31 +0100] cupsdSetBusyState: newbusy="Active clients and dirty files", busy="Active clients and dirty files"
D [21/Dec/2020:12:48:31 +0100] cupsdSetBusyState: newbusy="Active clients and dirty files", busy="Active clients and dirty files"
D [21/Dec/2020:12:48:31 +0100] cupsdMarkDirty(----S)
D [21/Dec/2020:12:48:31 +0100] cupsdSetBusyState: newbusy="Active clients and dirty files", busy="Active clients and dirty files"
D [21/Dec/2020:12:48:31 +0100] [Job 926] 4 filters for job:
D [21/Dec/2020:12:48:31 +0100] [Job 926] bannertopdf (application/vnd.cups-pdf-banner to application/pdf, cost 32)
D [21/Dec/2020:12:48:31 +0100] [Job 926] pdftopdf (application/pdf to application/vnd.cups-pdf, cost 66)
D [21/Dec/2020:12:48:31 +0100] [Job 926] pdftops (application/vnd.cups-pdf to application/vnd.cups-postscript, cost 100)
D [21/Dec/2020:12:48:31 +0100] [Job 926] brother_lpdwrapper_mfcj470dw (application/vnd.cups-postscript to printer/MFCJ470DW, cost 0)
D [21/Dec/2020:12:48:31 +0100] [Job 926] job-sheets=none,none
D [21/Dec/2020:12:48:31 +0100] [Job 926] argv[0]="MFCJ470DW"
D [21/Dec/2020:12:48:31 +0100] [Job 926] argv[1]="926"
D [21/Dec/2020:12:48:31 +0100] [Job 926] argv[2]="root"
D [21/Dec/2020:12:48:31 +0100] [Job 926] argv[3]="Test Page"
D [21/Dec/2020:12:48:31 +0100] [Job 926] argv[4]="1"
D [21/Dec/2020:12:48:31 +0100] [Job 926] argv[5]="job-uuid=urn:uuid:e7d8c878-3d1a-373a-6205-0ccb7ee4e2dc job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1608551311 time-at-processing=1608551311"
D [21/Dec/2020:12:48:31 +0100] [Job 926] argv[6]="/var/spool/cups/d00926-001"
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[0]="CUPS_CACHEDIR=/var/cache/cups"
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[1]="CUPS_DATADIR=/usr/share/cups"
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[2]="CUPS_DOCROOT=/usr/share/cups/doc-root"
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[3]="CUPS_FONTPATH=/usr/share/cups/fonts"
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[4]="CUPS_REQUESTROOT=/var/spool/cups"
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[5]="CUPS_SERVERBIN=/usr/lib/cups"
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[6]="CUPS_SERVERROOT=/etc/cups"
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[7]="CUPS_STATEDIR=/run/cups"
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[8]="HOME=/var/spool/cups/tmp"
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[9]="PATH=/usr/lib/cups/filter:/usr/bin:/usr/sbin:/bin:/usr/bin"
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[10]="SERVER_ADMIN=root@creeck"
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[11]="SOFTWARE=CUPS/2.3.1"
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[12]="TMPDIR=/var/spool/cups/tmp"
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[13]="USER=root"
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[14]="CUPS_MAX_MESSAGE=2047"
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[15]="CUPS_SERVER=/run/cups/cups.sock"
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[16]="CUPS_ENCRYPTION=IfRequested"
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[17]="IPP_PORT=631"
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[18]="CHARSET=utf-8"
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[19]="LANG=de.UTF-8"
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[20]="PPD=/etc/cups/ppd/MFCJ470DW.ppd"
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[21]="RIP_MAX_CACHE=128m"
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[22]="CONTENT_TYPE=application/vnd.cups-pdf-banner"
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[23]="DEVICE_URI=usb:/dev/usb/lp0"
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[24]="PRINTER_INFO=MFCJ470DW"
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[25]="PRINTER_LOCATION="
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[26]="PRINTER=MFCJ470DW"
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[27]="PRINTER_STATE_REASONS=none"
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[28]="CUPS_FILETYPE=document"
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[29]="FINAL_CONTENT_TYPE=application/vnd.cups-postscript"
D [21/Dec/2020:12:48:31 +0100] [Job 926] envp[30]="AUTH_I****"
I [21/Dec/2020:12:48:31 +0100] [Job 926] Started filter /usr/lib/cups/filter/bannertopdf (PID 88203)
I [21/Dec/2020:12:48:31 +0100] [Job 926] Started filter /usr/lib/cups/filter/pdftopdf (PID 88204)
I [21/Dec/2020:12:48:31 +0100] [Job 926] Started filter /usr/lib/cups/filter/pdftops (PID 88205)
I [21/Dec/2020:12:48:31 +0100] [Job 926] Started filter /usr/lib/cups/filter/brother_lpdwrapper_mfcj470dw (PID 88206)
I [21/Dec/2020:12:48:31 +0100] [Job 926] Started backend /usr/lib/cups/backend/usb (PID 88208)
D [21/Dec/2020:12:48:31 +0100] cupsdMarkDirty(----S)
D [21/Dec/2020:12:48:31 +0100] cupsdSetBusyState: newbusy="Active clients, printing jobs, and dirty files", busy="Active clients and dirty files"
D [21/Dec/2020:12:48:31 +0100] [Client 204] Returning IPP successful-ok for Print-Job (ipp://localhost:631/printers/MFCJ470DW) from localhost.
D [21/Dec/2020:12:48:31 +0100] [Client 204] Content-Length: 190
D [21/Dec/2020:12:48:31 +0100] [Client 204] cupsdSendHeader: code=200, type="application/ipp", auth_type=0
D [21/Dec/2020:12:48:31 +0100] [Job 926] PID 88203 (/usr/lib/cups/filter/bannertopdf) stopped with status 1.
D [21/Dec/2020:12:48:31 +0100] [Client 204] con->http=0x558c6f9ccea0
D [21/Dec/2020:12:48:31 +0100] [Client 204] cupsdWriteClient error=0, used=0, state=HTTP_STATE_POST_SEND, data_encoding=HTTP_ENCODING_LENGTH, data_remaining=190, response=0x558c6fa94730(IPP_STATE_IDLE), pipe_pid=0, file=-1
D [21/Dec/2020:12:48:31 +0100] [Client 204] Writing IPP response, ipp_state=IPP_STATE_DATA, old wused=0, new wused=0
D [21/Dec/2020:12:48:31 +0100] [Client 204] bytes=0, http_state=0, data_remaining=190
D [21/Dec/2020:12:48:31 +0100] [Client 204] Flushing write buffer.
D [21/Dec/2020:12:48:31 +0100] [Client 204] New state is HTTP_STATE_WAITING
D [21/Dec/2020:12:48:31 +0100] [Client 204] Waiting for request.
D [21/Dec/2020:12:48:31 +0100] cupsdSetBusyState: newbusy="Active clients, printing jobs, and dirty files", busy="Active clients, printing jobs, and dirty files"
D [21/Dec/2020:12:48:31 +0100] [Notifier] state=3
D [21/Dec/2020:12:48:31 +0100] [Notifier] state=3
D [21/Dec/2020:12:48:31 +0100] [Notifier] state=3
D [21/Dec/2020:12:48:31 +0100] [Job 926] Error opening banner file: Permission denied
D [21/Dec/2020:12:48:31 +0100] [Job 926] Error: could not read banner file
D [21/Dec/2020:12:48:31 +0100] [Job 926] pdftopdf: Last filter determined by the PPD: brother_lpdwrapper_mfcj470dw; FINAL_CONTENT_TYPE: application/vnd.cups-postscript => pdftopdf will not log pages in page_log.
D [21/Dec/2020:12:48:31 +0100] [Job 926] Input is empty, outputting empty file.
D [21/Dec/2020:12:48:31 +0100] [Job 926] PID 88204 (/usr/lib/cups/filter/pdftopdf) exited with no errors.
下游过滤器(例如 pdftops)成功运行,尽管输入和输出为空:
D [21/Dec/2020:12:48:31 +0100] [Job 926] pdftops - copying to temp print file \"/tmp/1588d5fec4a35\"
D [21/Dec/2020:12:48:31 +0100] [Job 926] Input is empty, outputting empty file.
D [21/Dec/2020:12:48:31 +0100] [Job 926] PID 88205 (/usr/lib/cups/filter/pdftops) exited with no errors.
现有的横幅文件都是世界可读的(包括完整路径),但没有横幅none
。创建一个空文件不会改变任何东西,我想实际上不需要这样的文件。
一些背景
打印机是通过 USB 和网络连接的 Brother MFC-J470DW。当我通过网络发送打印作业时,也会出现同样的问题。
该打印机过去可以在 Ubuntu 19.04 上使用,但自从升级(不是重新安装)到 Ubuntu 20.04.1 LTS (Focal Fossa) 后,它就不再工作了。
此打印机需要安装 Brother 的驱动程序。在旧的 Ubuntu 安装中,这些曾经使用 Brother 安装程序 linux-brprinter-installer-2.1.1-1 进行安装。升级后,使用 Brother 安装程序 linux-brprinter-installer-2.2.2-1。
软件包和版本
我使用打印机驱动程序安装脚本 linux-brprinter-installer-2.2.2-1,下载并安装
- brscan4-0.4.9-1.amd64.deb
- brscan-skey-0.3.1-1.amd64.deb
- mfcj470dwcupswrapper-3.0.0-1a.i386.deb
- mfcj470dwcupswrapper-3.0.0-1.i386.deb
- mfcj470dwlpr-3.0.0-1a.i386.deb
- mfcj470dwlpr-3.0.0-1.i386.deb
更多可能相关的版本
$ dpkg -l hplip "cups*" Gewünscht=Unbekannt/Installieren/R=Entfernen/P=Vollständig Löschen/Halten | Status=Nicht/Installiert/Config/U=Entpackt/halb konFiguriert/ Halb installiert/Trigger erWartet/Trigger anhängig |/ Fehler?=(kein)/R=Neuinstallation notwendig (Status, Fehler: GROSS=schlecht) ||/ Name Version Architektur Beschreibung +++-=========================-================-============-=================================================================== ii cups 2.3.1-9ubuntu1.1 amd64 Common UNIX Printing System(tm) - PPD/driver support, web interface ii cups-browsed 1.27.4-1 amd64 OpenPrinting CUPS Filters - cups-browsed ii cups-bsd 2.3.1-9ubuntu1.1 amd64 Common UNIX Printing System(tm) - BSD commands ii cups-client 2.3.1-9ubuntu1.1 amd64 Common UNIX Printing System(tm) - client programs (SysV) ii cups-common 2.3.1-9ubuntu1.1 all Common UNIX Printing System(tm) - common files ii cups-core-drivers 2.3.1-9ubuntu1.1 amd64 Common UNIX Printing System(tm) - driverless printing ii cups-daemon 2.3.1-9ubuntu1.1 amd64 Common UNIX Printing System(tm) - daemon ii cups-filters 1.27.4-1 amd64 OpenPrinting CUPS Filters - Main Package ii cups-filters-core-drivers 1.27.4-1 amd64 OpenPrinting CUPS Filters - Driverless printing un cups-filters-ippusbxd <keine> <keine> (keine Beschreibung vorhanden) ii cups-ipp-utils 2.3.1-9ubuntu1.1 amd64 Common UNIX Printing System(tm) - IPP developer/admin utilities un cups-pdf <keine> <keine> (keine Beschreibung vorhanden) ii cups-pk-helper 0.2.6-1ubuntu3 amd64 PolicyKit helper to configure cups with fine-grained privileges ii cups-ppdc 2.3.1-9ubuntu1.1 amd64 Common UNIX Printing System(tm) - PPD manipulation utilities ii cups-server-common 2.3.1-9ubuntu1.1 all Common UNIX Printing System(tm) - server common files rc hplip 3.20.3+dfsg0-2 amd64 HP Linux Printing and Imaging System (HPLIP)
答案1
对我来说,解决方案非常简单,但这只是因为我的 CUPS 配置几乎没有修改,不值得保存。
我“清除”了与 CUPS 和打印机相关的软件包。基本上,
# Purge CUPS-related packages
apt purge cups cups-client cups-daemon cups-common cups-filters cups-filters-core-drivers cups-ipp-utils cups-pk-helper cups-ppdc cups-server-common
# Purge Brother packages
apt purge mfcj470dwcupswrapper mfcj470dwlpr
清除删除了所有(显然已损坏的)系统范围的配置。如果您的CUPS配置被修改,您应该先备份它们! (无论如何你都有它们,对吧;-))
之后我重新安装了 CUPS
apt install cups cups-client
和兄弟包
sudo bash linux-brprinter-installer-2.2.2-1