Is there an admin anywhere in the world who likes printing? I seriously doubt it. As much as I appreciate having hard copy of some things, I wouldn’t shed a tear if the oft-predicted “paperless office” were to arrive. Recently, I encountered an odd printing problem that took the help of two colleagues to figure out.
A few weeks ago, one of our faculty sent in a trouble ticket saying that she couldn’t print from her Linux machines anymore. Naturally, I assumed it was either user error or some config file had inadvertently been changed, so I hopped on to the box to see if I could reproduce the problem. Nope, everything worked fine for me. Since it was happening for her on multiple machines and not for me on the same machines, I figured it had to be an account-specific problem.
The first thing I did was to check her home directory quota. I’ve found that’s generally a good place to start when there are account-specific problems. Sure enough, I see that she’s nearly at quota. Problem solved, I think, as I tell her to clear out some space and see if that fixes the problem. Unfortunately, the problem persisted. Okay, so the next step is to have her send the output of `printenv`. Aha! Her PRINTER variable is set to a printer which no longer exists. I tell her to unset it and use `lpstat -a` to get a list of available printers. Surely that will solve the problem.
Once again, my hopes are crushed. She tells me that lpstat gives “get-printers failed: client-error-bad-request”. What? That doesn’t make any sense. The client is obviously configured correctly because it works for me. The server doesn’t care about accounts, it’ll print anything sent to it. So what could be the problem? I know slightly more than nothing about programming, but I figure I’ll ask her to run strace. Maybe the output will be helpful, and if nothing else, it makes it look like I’m doing something.
So I compared her strace output with mine. Line after line after line after painful line match (or close enough), and I’m about to give up, so I ask a friend for help. He recruits his office mate, who notices one small difference. She’s using the iso-8859-1 charset, while I’m using UTF-8. So we poke around some more. In our environment, the default value for $LANG is en_US.utf-8. Hers was set to just en_US. Well it turns out that at some point (apparently) CUPS decided that UTF-8 was the only charset that was going to be supported, so when we did our CUPS upgrade recently (the last install of CUPS was done in 2004!) it broke her printing. So the simple fix was to change the first line in /usr/share/locale/en_US/cups_en_US to “utf-8″. Tadaa! And it only took a week to figure out.
At least it wasn’t a specific file causing a paper jam every time.