Troubleshooting CUPS in TDEPrint
Prev
Next

Troubleshooting CUPS in TDEPrint

This section of the TDEPrint Handbook will live from the readers' feedback. Here is just a small beginning.

Error Messages

1. What does the error client-error-bad-request mean?
2. And client-error-not-possible?
3. How about client-error-not-found?
1.

What does the error client-error-bad-request mean?

The user sent a file to the CUPS which the server could not process. You get this also upon sending an “empty” file.

2.

And client-error-not-possible?

User is either not allowed to print to a certain printer or has achieved their quota (based on file size and/or page number)

3.

How about client-error-not-found?

The user tried to access a nonexistent resource on the CUPS server, such as trying to print a nonexistent file, or one that you are denied permission to read.

Questions and Answers

1. Why can't I re-start my jobs?
2. How do I get rid of the long list of completed jobs in the web interface?
3. How does page accounting work?
4. Why doesn't page-accounting work with Windows clients?
5. How do I get a list of available options for a given printer or a PPD file?
6. How do I read the listing retrieved by the lpoptions command?
7. How do I get a nicely formatted listing of available options for a given printer or PPD?
1.

Why can't I re-start my jobs?

To be able to re-start your “completed” jobs from the web interface, you need a setting in the /etc/cups/cupsd.conf file: set PreserveJobFiles True.

2.

How do I get rid of the long list of completed jobs in the web interface?

TODO

3.

How does page accounting work?

CUPS does the “print accounting” by passing nearly every job through the “pstops” filter. This one does, amongst other things, the page counting. Output of this filter there may be piped into other filters (like pstoraster --> rastertopcl) or sent to the printer directly (if it is a PostScript® printer).

In any case, this works for network, parallel, serial or USB printers the same. For pstops to work, it needs DSC, Document Structuring Convention compliant PostScript® (or near-equivalent) as input. So it calculates the pages during filtering on the print server and writes info about every single page (what time, which user, which job-ID and -name, which printer, how many copies of which pages of the document, how many kilo-bytes?) into /var/log/cups/page_log.

By the way: on my personal “wishlist” is a hack of “webalizer” to read and analyze the page_log and give a similar output. Anyone?

However, it is not giving correct results in the following cases:

  • The printer jams and maybe therefor throw away the job (real live experience; or maybe throwing away the job because of problems with the data format)

  • Jobs printed as “raw” are always counted as size of 1 page (and maybe multiple copies).

Therefore the page accounting of CUPS is “only” an approximation (in many cases an excellent or at least good one, in others a quite poor one). The only reliable print count is the one done by the internal printer counter. (Because this is the one you pay for, if you are on a “click price” or similar.) Some, by far not most, printers can be queried remotely for that information via SNMP (Simple Network Management Protocol). That means, in a bigger network with many different printers there is just no completely reliable and accurate page accounting tool!

4.

Why doesn't page-accounting work with Windows® clients?

From Windows® clients jobs nearly always need to be sent as “raw”. Why? If CUPS works as a print server for Windows® clients using the original native Windows® driver for the target print device, this guarantees the correct formatting of the job on the clients already; therefor the server should not touch it and print “raw”; therefor no filtering is started (and this is not even possible as the input from the clients is not PostScript® as pstops expects; hence no page-count other than the default “1”.

5.

How do I get a list of available options for a given printer or a PPD file?

See the man page for the lpoptions command. You may investigate a CUPS-enabled box about any option of its available printers. There is no need to have the printer installed locally. As long as the printer is available locally (through the CUPSprinter browsing” feature), it will also work remote.

To query for a printers' option typing lpoptions -p HitachiDDP70MicroPress -l will give a long listing of all available options as read from the PPD file for the given Hitachi-Printer (in my case installed on remote server transmeta). Remote server Transmeta and its CUPS daemon as well as the localhost's CUPS daemon need to be up and running for this to succeed.

6.

How do I read the listing retrieved by the lpoptions command?

You know that for PostScript® printer manufacturers it is “legal” to define their own internal names and procedures even for standard PostScript® options. As long as the driver is able to retrieve the option from the PPD and show it to the user in a way that he understands it everything is OK. But what do you do, if you want to use some obscure printer options on the command line? How do you find out its exact syntax?

Let's take an example. Looking at Hitachi's DDP70 printer and how it implements duplex printing is revealing somehow. How do you tell how to print double sided? duplex or Duplex? Or another name altogether?.

lpoptions -h transmeta -p Hitachi_DDP70_ClusterPrintingSystem -l | grep uplex

This leads to the output

TR-Duplex/Duplex: False *True

This is to be interpreted like follows:

  • The name of the investigated option is TR-Duplex;

  • Behind the slash you see the translation of the option, as it should be shown in a GUI or Web interface (“Duplex”);

  • The option may take one of the two values False or True;

  • The present setting is True to be recognized by the marking with a star *.

To override the present default setting (duplex) and print a job in simplex, you need to use the following command:

lpr -P Hitachi_DDP70_ClusterPrintingSystem -o TR-Duplex=False /path/to/your/printjob
7.

How do I get a nicely formatted listing of available options for a given printer or PPD?

Use the lphelp command which may be installed on your system locally. There is not yet a man page for lphelp.

lphelp infotecP450

This lists the available options for the named printer. It is nicely formatted and does explain every available option and how to use it. You can query different printers' options at once:

lphelp infotec7410color DANKA_fullcolor_D2000 HP_ColorLaserJet8550

It also works for PPD files. Just specify the path to the PPD:

lphelp /home/kurt/PPDs/HP-ColorLaserJet8550.ppd

Solving Problems

No system is perfect. Here are some commonly seen traps people have fallen into.

1. My printer named 3-lp-duplex shows erratic behavior. What's wrong?
2. Why do I get Unable to connect to SAMBA host: Success with my printer shares from Windows accessed via Samba?
3. My files for printer lp sometimes mysteriously disappear and two days later I am told they got printed on a printer three floors below my office. What is going on?
1.

My printer named “3-lp-duplex” shows erratic behavior. What's wrong?

The printer names used in CUPS shall start with a letter and may contain up to 128 letters, numbers or underscores. Using dashes may lead to problems. Speaking about naming: printer names in CUPS are not case sensitive. So a printer named Best_of_Danka will be the same as best_of_danka or BEST_OF_DANKA. (This is a requirement of IPP, which CUPS is fully compliant with).

2.

Why do I get Unable to connect to SAMBA host: Success with my printer shares from Windows® accessed via Samba?

Are the rights on the remote Windows® box set correctly for you? Are you actually allowed to print on the Windows® shared printer?

3.

My files for printer lp sometimes mysteriously disappear and two days later I am told they got printed on a printer three floors below my office. What is going on?

Believe me, it is very unlikely that your printer is the only one with the name lp. Maybe CUPS is playing a trick on you. As you might have the setting “ImplicitClasses On” activated, CUPS tries to stuff all printers it sees on the network into a “Class” name lp. All jobs destined to lp are sent to this class and the first available member prints it. So if you had this nice fellow (who listened closely when you raved about CUPS and TDEPrint) install CUPS and poke around the system...get the idea?

Take my advice: choose a unique name for any network printer! (Mind you, the one on your parallel port also turns out to be a network printer for the rest of the world if you don't take care of your settings).

Prev
Next
Home


Would you like to comment or contribute an update to this page?
Send feedback to the TDE Development Team