Bug 383139 - printing to cups printer silently failing (error on console - lpr: The printer or class does not exist)
Summary: printing to cups printer silently failing (error on console - lpr: The printe...
Status: RESOLVED UPSTREAM
Alias: None
Product: okular
Classification: Applications
Component: printing (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR critical
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-04 20:04 UTC by ericj
Modified: 2017-08-08 14:11 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ericj 2017-08-04 20:04:55 UTC
Version: 1.1.2
OS: OpenSUSE 42.3
RPM version: okular-17.04.2-1.6.x86_64

Since re-installing from OpenSUSE 42.1 to 42.3, Okular is unable to print to remote printers (served via a CUPS print server).  The GUI will not throw any exceptions.  However, Okular will print the following to the console (if started that way):

lpr: The printer or class does not exist.

In another case, it printed to the first printer in the list rather than the one selected.  Note that we have 149 printers defined (as shown in lpstat -t).  Perhaps the long list of printers is causing some sort of overflow ?

Note that other software such as firefox is printing fine from the same user session.
Comment 1 Yuri Chornoivan 2017-08-05 06:05:39 UTC
Does the printing from other Qt/KDE applications work?

It might be the problems with libqpdf similar to those in the current Mageia:

https://bugs.mageia.org/show_bug.cgi?id=21444

What is the version of qpdf/libqpdf btw?

Thanks in advance for the info.
Comment 2 ericj 2017-08-07 13:24:56 UTC
I have just attempted to print from Konsole (File --> Print Screen --> [select printer] --> Print) and the same symptoms.  (Silently fails).  I also tried from Kate and it also has the same symptoms.  If launching Konsole or Kate from the command line, you see the following logged to the console:
QPainter::begin(): Returned false
QPainter::save: Painter not active
QPainter::setPen: Painter not active
QPainter::setFont: Painter not active
QPainter::restore: Unbalanced save/restore
QPainter::save: Painter not active
QPainter::setPen: Painter not active
QPainter::restore: Unbalanced save/restore
QPainter::translate: Painter not active
QPainter::setPen: Painter not active
QPainter::pen: Painter not active
QPainter::pen: Painter not active
QPainter::setPen: Painter not active
QPainter::setClipping: Painter not active, state will be reset by begin
QPainter::translate: Painter not active
QPainter::end: Painter not active, aborted

I am running this version of libqpdf:
libqpdf13-5.1.3-5.1.x86_64

I am running cup 1.7.5 on both client and server so I don't think it is related to that other bug...

Thanks!
Comment 3 Albert Astals Cid 2017-08-07 21:32:40 UTC
Can you please run

  QT_LOGGING_RULES=org.kde.okular.core=true okular

And try to print and paste the 
   org.kde.okular.core: Executing "lpr" with arguments

line?
Comment 4 ericj 2017-08-07 21:50:23 UTC
Hmm.. that line did not even show up in the terminal.  Here is the full output:

~> QT_LOGGING_RULES=org.kde.okular.core=true okular                                                                                                                                                                             
org.kde.okular.core: "/usr/lib64/qt5/plugins/okular/generators/okularGenerator_txt.so"                                                                                                                                                       
org.kde.okular.core: Output DPI: QSizeF(94.1467, 94.0741)                                                                                                                                                                                    
org.kde.okular.core: request observer=0x1a37910 527x702@0                                                                                                                                                                                    
org.kde.okular.core: request observer=0x1a37910 527x702@1                                                                                                                                                                                    
org.kde.okular.core: sending request observer=0x1a37910 527x702@0 async == true isTile == false                                                                                                                                              
org.kde.okular.core: request observer=0x1a37910 527x702@1                                                                                                                                                                                    
org.kde.okular.core: request observer=0x1a37910 527x702@1                                                                                                                                                                                    
org.kde.okular.core: request observer=0x1a37910 527x702@1                                                                                                                                                                                    
org.kde.okular.core: request observer=0x1c398a0 327x436@0                                                                                                                                                                                    
org.kde.okular.core: request observer=0x1c398a0 327x436@1                                                                                                                                                                                    
org.kde.okular.core: sending request observer=0x1c398a0 327x436@0 async == true isTile == false                                                                                                                                              
org.kde.okular.core: sending request observer=0x1c398a0 327x436@1 async == true isTile == false                                                                                                                                              
org.kde.okular.core: request observer=0x1a37910 507x676@0                                                                                                                                                                                    
org.kde.okular.core: request observer=0x1a37910 507x676@1                                                                                                                                                                                    
org.kde.okular.core: sending request observer=0x1a37910 507x676@0 async == true isTile == false                                                                                                                                              
org.kde.okular.core: request observer=0x1a37910 507x676@1                                                                                                                                                                                    
org.kde.okular.core: request observer=0x1a37910 507x676@1
org.kde.okular.core: request observer=0x1a37910 507x676@1
QPainter::begin(): Returned false
^C
Comment 5 ericj 2017-08-07 21:55:15 UTC
So, I just re-ran that and instead of opening a txt file, I opened a PDF and tried to print that.  Here is the line you are looking for:

org.kde.okular.core: Executing "lpr" with arguments ("-P", "", "-#1", "-J", "Dell.pdf", "-r", "/tmp/okular_S21220.ps")
lpr: The printer or class does not exist.
Comment 6 Albert Astals Cid 2017-08-07 21:59:20 UTC
At this point i'd say this is most likely a Qt/distribution bug, please install the qt5 assistant program and see if can you print from there (make sure you're running the Qt5 version by doing Help->About)

Since basically we're asking Qt your printer name and it says its empty "". What is the output of lpstat -a?
Comment 7 ericj 2017-08-07 22:26:04 UTC
You are right.  assistant-qt5 has the same issue (although I don't know how to enable the right logging that shows me the lpr command args that are being run).

lpstat -a shows me all 149 printers in this format:
PRINTER_NAME accepting requests since DAY_DATE_TIME
Comment 8 Albert Astals Cid 2017-08-07 22:35:35 UTC
So it would seem it's a problem of Qt upstream if assistant also fails, not something we can really help with, sorry.

You may want to report this upstream in the qt bug tracker (only mention assistant, otherwise they'll try to shift it back to "KDE being broken")
Comment 9 Albert Astals Cid 2017-08-07 22:37:41 UTC
If you report it upstream Qt please add the url of the bug here so we can follow up the discussion.
Comment 10 Yuri Chornoivan 2017-08-08 13:50:23 UTC
Just for the reference, the similar bug in Mageia has been fixed by cups-filters patching update.

http://advisories.mageia.org/MGAA-2017-0055.html
Comment 11 ericj 2017-08-08 14:11:38 UTC
I created a bug for this with openSUSE:
https://bugzilla.opensuse.org/show_bug.cgi?id=1052793