Announcement

Collapse
No announcement yet.

How To Fix 'Filter failed' on cups jobs

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How To Fix 'Filter failed' on cups jobs

    The root cause of this has already been highlighted on this forum, but it may
    not be clear that's what you got.


    So you look on http://localhost:631/jobs/ and find lots of "hanging jobs"

    Click image for larger version  Name:	failed-filter-with-fonts.png Views:	7 Size:	128.7 KB ID:	657840


    The you may have bug [ Can't find a bug number, has anybody reported this?, but see below ]

    If you do this:
    Code:
    $ lp -d PDF /etc/passwd
    And see yet another job appear in the queue with "filter failed" they you've probably got this [unallocated] bug.

    As a test do (as a normal user):

    Code:
    $ /usr/sbin/cupsfilter --list-filters /etc/passwd
    
    texttopdf
    Then

    Code:
    $ /usr/sbin/cupsfilter /etc/passwd> /tmp/passwd.pdf
    
    DEBUG: argv[0]="cupsfilter"
    DEBUG: argv[1]="1"
    DEBUG: argv[2]="graeme"
    DEBUG: argv[3]="passwd"
    DEBUG: argv[4]="1"
    DEBUG: argv[5]=""
    DEBUG: argv[6]="/etc/passwd"
    DEBUG: envp[0]="<CFProcessPath>"
    DEBUG: envp[1]="CONTENT_TYPE=text/plain"
    DEBUG: envp[2]="CUPS_DATADIR=/usr/share/cups"
    ...<elided>...
    DEBUG: envp[14]="CHARSET=utf-8"
    DEBUG: envp[15]="FINAL_CONTENT_TYPE=application/pdf"
    INFO: texttopdf (PID 11531) started.
    Unsupported OTF font / glyf table
    Unsupported OTF font / cmap table
    Unicode (3,1) cmap in format 4 not found
    Unicode (3,1) cmap in format 4 not found
    Unicode (3,1) cmap in format 4 not found
    Unicode (3,1) cmap in format 4 not found
    ...<several thousand lines elided>....
    Unicode (3,1) cmap in format 4 not found
    Unicode (3,1) cmap in format 4 not found
    Unicode (3,1) cmap in format 4 not found
    Unsupported OTF font / glyf table
    cupsfilter: fontembed/sfnt.c:683: otf_get_name: Assertion `0' failed.
    ERROR: texttopdf (PID 11531) crashed on signal 6
    Then you are looking at the issue highlighted here:
    https://www.kubuntuforums.net/forum/...ttopdf-failing

    It's a basic Ubuntu issue:
    https://askubuntu.com/questions/1240...truetype-fonts

    The Bug (with fix) is here:
    https://unix.stackexchange.com/quest...ith-fontconfig

    In short add a file: /etc/fonts/local.conf :


    <?xml version="1.0"?>
    <!-- /etc/fonts/local.conf file 05nov21 GPV to fix: https://askubuntu.com/questions/1240...truetype-fonts -->
    <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
    <fontconfig>
    <selectfont>
    <rejectfont>
    <glob>/usr/share/fonts/truetype/noto/NotoColorEmoji.ttf</glob>
    </rejectfont>
    </selectfont>
    </fontconfig>
    (Replace GPV with your own initails :-)

    Assuming you can drive an editor as root, then just do that. If you're CLI shy:


    Code:
    $ ls -l /etc/fonts/local.conf # Make sure you don't already have one (should say not found)
    
    
    sudo bash -c cat > /etc/fonts/local.conf << EOF
    <?xml version="1.0"?>
    <!-- /etc/fonts/local.conf file 05nov21 ${USER} to fix: https://askubuntu.com/questions/1240708/problem-with-cups-texttopdf-and-noto-truetype-fonts -->
    <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
    <fontconfig>
    <selectfont>
    <rejectfont>
    <glob>/usr/share/fonts/truetype/noto/NotoColorEmoji.ttf</glob>
    </rejectfont>
    </selectfont>
    </fontconfig>
    EOF
    The post also says to do :

    Code:
    fc-cache -f -v
    To rebuild the font cache. It actually worked for me before I did that, but no harm in going the extra step.

    After the fix:

    Code:
    /usr/sbin/cupsfilter /etc/passwd > /tmp/passwd.pdf-2.pdf
    
    DEBUG: argv[0]="cupsfilter"
    DEBUG: argv[1]="1"
    DEBUG: argv[2]="graeme"
    DEBUG: argv[3]="passwd"
    DEBUG: argv[4]="1"
    DEBUG: argv[5]=""
    DEBUG: argv[6]="/etc/passwd"
    DEBUG: envp[0]="<CFProcessPath>"
    DEBUG: envp[1]="CONTENT_TYPE=text/plain"
    DEBUG: envp[2]="CUPS_DATADIR=/usr/share/cups"
    DEBUG: envp[3]="CUPS_FONTPATH=/usr/share/cups/fonts"
    DEBUG: envp[4]="CUPS_SERVERBIN=/usr/lib/cups"
    DEBUG: envp[5]="CUPS_SERVERROOT=/etc/cups"
    DEBUG: envp[6]="LANG=en_GB.UTF8"
    DEBUG: envp[7]="PATH=/usr/lib/cups/filter:/usr/bin:/usr/sbin:/bin:/usr/bin"
    DEBUG: envp[8]="PPD=/usr/share/cups/model/laserjet.ppd"
    DEBUG: envp[9]="PRINTER_INFO=cupsfilter"
    DEBUG: envp[10]="PRINTER_LOCATION=Unknown"
    DEBUG: envp[11]="PRINTER=cupsfilter"
    DEBUG: envp[12]="RIP_MAX_CACHE=128m"
    DEBUG: envp[13]="USER=graeme"
    DEBUG: envp[14]="CHARSET=utf-8"
    DEBUG: envp[15]="FINAL_CONTENT_TYPE=application/pdf"
    INFO: texttopdf (PID 13128) started.
    INFO: texttopdf (PID 13128) exited with no errors.
    Which is a much happier situation. And obviously the printing then worked (but nothing to see there).

    You may only view thumbnails in this gallery. This gallery has 1 photos.
    Last edited by Snowhog; Nov 05, 2021, 10:52 AM.

    #2
    Graemev, you're hardly a newbie!
    Nice display of Linux chops there! 👍
    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
    – John F. Kennedy, February 26, 1962.

    Comment


      #3
      Thank you very much!! I am a new Kubuntu user and had exactly this problem with my install earlier this week of Kubuntu 22.04. Followed the detailed instructions and saw exactly the same error messages. Followed the steps to correct it and my HP Envy 7645 printer now works!! Would point out that I am also running Xubuntu 22.10 on a different system and did not have this issue. Same printer just worked.

      Comment

      Working...
      X