Arch Linux
I tried to setup my new Kyocera FS-1061DN under Arch. The printer came along with a CD with some Linux «drivers», which I installed according to the instructions on the CD. The «driver» is basically a PPD-File and a filter, «rastertokpsl».
I’m able to locate and add the printer using CUPS. But every printing attepmt fails with the message «filter failed». One full error_log (debug mode) is available under pastebin: https://pastebin.com/GEefsqTF
The decisive line is IMO line 76:
D [08/Jan/2022:00:11:45 +0100] [Job 9] PID 2041 (/usr/lib/cups/filter/rastertokpsl) crashed on signal 11.
I tried to use the approach, which has it’s own AUR package (https://aur.archlinux.org/packages/rast … l-fs-1040/) (The idea is to treat the arguments before calling rastertokpsl). It had no effect. AFAIK, the «rastertokpsl-re» approach only works for MacOS. There are mutliple «drivers» available online, but they are identical (Hash-verified) to the files on the CD, especially the «rastertokpsl».
However, the printer works fine under my old laptop, which uses Fedora as OS. I took the same steps and it works like a charm.
So, what am I missing? Encoding, some arcane SELinux stuff or filesystem encryption (blind guesses)? The fact that my fedora laptop uses a slightly older CUPS version? (2.3.3 vs 2.4.0 on Arch)? Why does rastertokpsl runs under one linux and not under another?
Last edited by ixolius (2023-02-21 09:25:05)
Tao Wang’s Weblog
I recently got a new Kyocera FS-1025MFP unit and the print jobs would stop if there are Chinese characters in the job title. The OS is Ubuntu 16.04. Specifically, the error message was either «filter failed» or «filter crashed». Upon checking the CUPS error messages, I discovered that this was due to an error signal 6 returned by the «rastertokpsl» program shipped with the Kyocera driver.
1. Download, and install the Kyocera driver by running install.sh as root. This will copy the printer’s PPD file to /usr/share/cups/model/Kyocera/ and the rastertokpsl program to /usr/lib/cups/filter/.
2. Create a wrapper for rastertokpsl by:
sudo nano /usr/lib/cups/filter/rastertokpsl-fixed
#!/bin/bash jobname=$(echo $3 | egrep -o '[[:alnum:]]' | tr -d '\n' | tail -c 20) path=/usr/lib/cups/filter $path/rastertokpsl "$1" "$2" "$jobname" "$4" "$5"
sudo chmod a+x /usr/lib/cups/filter/rastertokpsl-fixed
4. Edit the PPD file specific to your printer model as found in /usr/share/cups/model/Kyocera/. For instance, mine is an FS-1025MFP and the file name is Kyocera_FS-1025MFPGDI.ppd. The only modification that should be made is the cupsFilter line (line 55 in my case):
Find:
*cupsFilter: "application/vnd.cups-raster 0 /usr/lib/cups/filter/rastertokpsl"
*cupsFilter: "application/vnd.cups-raster 0 /usr/lib/cups/filter/rastertokpsl-fixed"
The above steps should fix the problem. Alternatively, you may edit the PPD file shipped with the installation package and create the rastertokpsl-fixed wrapper for the installation files, and add the wrapper into install.sh so that you can be able to install the corrected driver with a single command.
I think the problem also affects FS-1040, FS-1060DN, FS-1020MFP, FS-1120MFP and FS-1125MFP, since they are using the same rastertokpsl program.
CUPS пишет «Filter failed»
Надо заглянуть в /var/log/cups/error_log и посмотреть подробности ошибок.
да там немного непонятно, что он хочет то вообще.
ну вот он запускает:
D [25/May/2022:07:39:18 +0300] [Job 8] Started filter /usr/lib/cups/filter/bannertopdf (PID 260205) D [25/May/2022:07:39:18 +0300] [Job 8] Started filter /usr/lib/cups/filter/pdftopdf (PID 260206) D [25/May/2022:07:39:18 +0300] [Job 8] Started filter /usr/lib/cups/filter/brother_lpdwrapper_HL1210W (PID 260207) D [25/May/2022:07:39:18 +0300] [Job 8] Started backend /usr/lib/cups/backend/dnssd (PID 260208)
D [25/May/2022:07:39:18 +0300] [Job 8] cp: -r not specified; omitting directory \'/opt/brother/Printers/HL1210W//inf/brHL1210Wrc\' D [25/May/2022:07:39:18 +0300] [Job 8] rm: cannot remove \'/tmp/brHL1210Wrc_260207\': No such file or directory D [25/May/2022:07:39:18 +0300] [Job 8] PID 260207 (/usr/lib/cups/filter/brother_lpdwrapper_HL1210W) stopped with status 1. D [25/May/2022:07:39:18 +0300] [Job 8] Hint: Try setting the LogLevel to "debug" to find out more.
brother_lpdwrapper_HL1210W — чё с ним делать?
tip78 ( 25.05.22 08:43:06 MSK )
Последнее исправление: tip78 25.05.22 09:01:17 MSK (всего исправлений: 3)
LogLevel debug в /etc/cups/cupsd.conf
Хотя он, судя по этому разделу, уже должен быть прописан, D в начале строки в логах означают отладочную информацию.
он там насыпал инфы на 100500 экранов
вот то что про фильтр:
D [25/May/2022:09:06:04 +0300] [Client 14] Writing IPP response, ipp_state=IPP_STATE_DATA, old wused=0, new wused=0 D [25/May/2022:09:06:04 +0300] [Client 14] bytes=0, http_state=0, data_remaining=593 D [25/May/2022:09:06:04 +0300] [Client 14] Flushing write buffer. D [25/May/2022:09:06:04 +0300] [Client 14] New state is HTTP_STATE_WAITING D [25/May/2022:09:06:04 +0300] [Client 14] Waiting for request. D [25/May/2022:09:06:04 +0300] cupsdSetBusyState: newbusy="Dirty files", busy="Active clients and dirty files" D [25/May/2022:09:06:04 +0300] [Client 14] POST / HTTP/1.1 D [25/May/2022:09:06:04 +0300] cupsdSetBusyState: newbusy="Active clients and dirty files", busy="Dirty files" D [25/May/2022:09:06:04 +0300] [Client 14] Read: status=200, state=6 D [25/May/2022:09:06:04 +0300] [Client 14] No authentication data provided. D [25/May/2022:09:06:04 +0300] [Client 14] 2.0 Get-Printer-Attributes 25 D [25/May/2022:09:06:04 +0300] Get-Printer-Attributes ipp://@localhost:631/printers/Brother_HL-1210W_series D [25/May/2022:09:06:04 +0300] [Client 14] Returning IPP successful-ok for Get-Printer-Attributes (ipp://@localhost:631/printers/Brother_HL-1210W_series) from localhost. D [25/May/2022:09:06:04 +0300] [Client 14] Content-Length: 593 D [25/May/2022:09:06:04 +0300] [Client 14] cupsdSendHeader: code=200, type="application/ipp", auth_type=0 D [25/May/2022:09:06:04 +0300] [Client 14] con->http=0x55c1f6cf8320 D [25/May/2022:09:06:04 +0300] [Client 14] cupsdWriteClient error=0, used=0, state=HTTP_STATE_POST_SEND, data_encoding=HTTP_ENCODING_LENGTH, data_remaining=593, response=0x55c1f6c58890(IPP_ST ATE_DATA), pipe_pid=0, file=-1 D [25/May/2022:09:06:04 +0300] [Client 14] Writing IPP response, ipp_state=IPP_STATE_DATA, old wused=0, new wused=0 D [25/May/2022:09:06:04 +0300] [Client 14] bytes=0, http_state=0, data_remaining=593 D [25/May/2022:09:06:04 +0300] [Client 14] Flushing write buffer. D [25/May/2022:09:06:04 +0300] [Client 14] New state is HTTP_STATE_WAITING D [25/May/2022:09:06:04 +0300] [Client 14] Waiting for request. D [25/May/2022:09:06:04 +0300] cupsdSetBusyState: newbusy="Dirty files", busy="Active clients and dirty files" D [25/May/2022:09:06:04 +0300] [Job 12] PID 262644 (/usr/lib/cups/filter/brother_lpdwrapper_HL1210W) stopped with status 1.
На что-то сетевое похоже, поиск результаты размазывает тонким разношёрстным слоем возможных причин. Через шнур есть возможность проверить печать?
Весь файл можно на https://pastebin.com/ залить.
Я бы от безысходности погрепал файл на типичные маркеры ошибок, вроде «error», «fail», «could not».
у меня, к примеру, Filter failed происходит всегда при первой печати.
Но чтобы такого не было, я просто еще раз выключаю и включаю принтер и о, чудо, все работает.
Кстати вопрос, как вручную запустить этот, да и любой другой фильтр?
подключил, переустановил локальный, пробовал вкл/выкл — не помогает
D [25/May/2022:13:50:44 +0300] [Client 4] cupsdWriteClient error=0, used=0, state=HTTP_STATE_POST_SEND, data_encoding=HTTP_ENCODING_LENGTH, data_remaining=459, response=0x55d41f3b71e0(IPP_STATE_DATA), pipe_pid=0, file=-1
D [25/May/2022:13:50:44 +0300] [Job 19] printer-state-message="Filter failed"
Это был хороший вопрос, потому что я кое-что нагуглил ТСу.
Если я понял верно, по этой же ссылке есть и про ручной запуск.
P.S. я думаю это заметно по треду, что я с CUPS не дружу. С принтерами немного возился по мелочам, поэтому по специфике CUPS могу лишь в поиск сходить.
по-моему Brother этот вместо драйвера подсунул кусок говна.
вот /usr/lib/cups/filter/brother_lpdwrapper_HL1210W:
LOGFILE="/dev/null" LOGCLEVEL="7" DEBUG=0 LOG_LATESTONLY=1 PRINTER=HL1210W BASEDIR=/opt/brother/Printers/$PRINTER/ LATESTINFO=/tmp/HL1210W_latest_print_info rm -f $LATESTINFO touch $LATESTINFO options="$5" if [ "$(echo $options | grep 'force-debug=1')" != '' ];then DEBUG=1 elif [ "$(echo $options | grep 'force-debug=2')" != '' ];then DEBUG=2 elif [ "$(echo $options | grep 'force-debug=3')" != '' ];then DEBUG=3 elif [ "$(echo $options | grep 'force-debug=4')" != '' ];then DEBUG=4 fi errorcode=0 set +o noclobber if [ $DEBUG != 0 ]; then LOGFILE=/tmp/br_cupsfilter_debug_log fi if [ "$PPD" = "" ]; then PPD="/usr/share/cups/model/$PRINTER.ppd" fi if [ $LOGFILE != "/dev/null" ]; then if [ $LOG_LATESTONLY = "1" ]; then rm -f $LOGFILE date >$LOGFILE else if [ -e $LOGFILE ]; then date >>$LOGFILE else date >$LOGFILE fi fi echo "arg0 = $0" >>$LOGFILE echo "arg1 = $1" >>$LOGFILE echo "arg2 = $2" >>$LOGFILE echo "arg3 = $3" >>$LOGFILE echo "arg4 = $4" >>$LOGFILE echo "arg5 = $5" >>$LOGFILE echo "arg6 = $6" >>$LOGFILE echo "PPD = $PPD" >>$LOGFILE fi TMP_RC=/tmp/brHL1210Wrc_$$ cp /opt/brother/Printers/$PRINTER//inf/brHL1210Wrc $TMP_RC export BRPRINTERRCFILE=$TMP_RC if [ $DEBUG != 0 ]; then echo BRPRINTERRCFILE=$BRPRINTERRCFILE >>$LOGFILE fi if [ -e "/$BASEDIR/lpd/filter_"$"" ]; then : else echo "ERROR: /$BASEDIR/lpd/filter_"$PRINTER" does not exist" >>$LOGFILE echo "ERROR: /$BASEDIR/lpd/filter_"$PRINTER" does not exist" >> $LATESTINFO errorcode=2 rm $TMP_RC exit fi if [ -e "/opt/brother/Printers/$PRINTER//cupswrapper/brcupsconfig4" ]; then if [ $DEBUG = 0 ]; then /opt/brother/Printers/$PRINTER//cupswrapper/brcupsconfig4 $PRINTER $PPD 0 "$options" >> /dev/null else /opt/brother/Printers/$PRINTER//cupswrapper/brcupsconfig4 $PRINTER $PPD $LOGCLEVEL "$options" >>$LOGFILE fi fi if [ $DEBUG = 0 ]; then if [ $# -ge 7 ]; then cat $6 | /$BASEDIR/lpd/filter_"$PRINTER" else cat | /$BASEDIR/lpd/filter_"$PRINTER" fi echo brHL1210Wrc_$$ >> $LATESTINFO cat $TMP_RC >> $LATESTINFO rm $TMP_RC exit $errorcode else ## ---------------- for debug echo --------------------------- >>$LOGFILE cat $BRPRINTERRCFILE >>$LOGFILE echo --------------------------- >>$LOGFILE INPUT_TEMP_PS=`mktemp /tmp/br_input_ps.XXXXXX` if [ $# -ge 7 ]; then cat $6 > $INPUT_TEMP_PS else cat > $INPUT_TEMP_PS fi case $DEBUG in 1) export LPD_DEBUG=1 cat $INPUT_TEMP_PS | /$BASEDIR/lpd/filter_"$PRINTER" ;; 2) export LPD_DEBUG=2 echo "" >>$LOGFILE echo " ------PostScript Data-------" >>$LOGFILE cat $INPUT_TEMP_PS >>$LOGFILE cat $INPUT_TEMP_PS | /$BASEDIR/lpd/filter_"$PRINTER" ;; 3) export LPD_DEBUG=3 echo "" >>$LOGFILE echo " ------PostScript Data-------" >>$LOGFILE cat $INPUT_TEMP_PS >>$LOGFILE ;; 4) export LPD_DEBUG=4 echo "" >>$LOGFILE echo " ------PostScript Data-------" >>$LOGFILE cat $INPUT_TEMP_PS >>$LOGFILE echo " ------Print Data-------" >>$LOGFILE cat $INPUT_TEMP_PS | /$BASEDIR/lpd/filter_"$PRINTER" | hexdump -C >>$LOGFILE ;; esac rm echo brHL1210Wrc_$$ >> $LATESTINFO cat $TMP_RC >> $LATESTINFO rm $TMP_RC fi exit
ошибки, которые я выше показывал:
D [25/May/2022:07:39:18 +0300] [Job 8] cp: -r not specified; omitting directory \'/opt/brother/Printers/HL1210W//inf/brHL1210Wrc\' D [25/May/2022:07:39:18 +0300] [Job 8] rm: cannot remove \'/tmp/brHL1210Wrc_260207\': No such file or directory
ERROR: //opt/brother/Printers/HL1210W//lpd/filter_HL1210W does not exist
дира «/opt/brother/Printers/HL1210W/inf/brHL1210Wrc» — пустая.
чё он блин ищет того, чего нет, и почему после этих двух строк он отваливается с кодом 1 ?!