Gray Flannel Dwarf

7/16/2006

I CUP

Last night I spent three hours of my life trying to figure something out. Three hours that I’ll never get back. Three hours on something that should’ve only taken five minutes.

Simply put: I tried to get network printing to work via CUPS. I did finally figure the finicky thing out… and hopefully people who are having the same problems that I did will see this and it’ll help em.
The Background: A few months ago, I took the printer connected to my wife’s old desktop and connected it to my Fedora Core 5 linux box. No problems there — printing worked just fine. I was unable to share it, however…. trying to connect to the printer across the network failed. I tried for a little while, to no avail. Meanwhile, I knew that years ago, at the old company, I had set up CUPS to access our network printers, and never had any problems… So last night, with new resolve, I tried again.

So tracing back, I thought of everything I had done. I made my changes to /etc/cups/cupsd.conf to allow remote connections… everything seemed kosher there. First thing I thought of doing that I know I didn’t do before was to open up a port on my local firewall. Specifically, port 631. To do this in FC5, I went to “System | Administration | Security Level and Firewall” in the user menu. At the UI, I went to “Other ports” dropdown and added “631″ TCP and UDP.

Such a simple issue — I surely thought I had resolved my problem. Trying to print returned nothing however — no jobs appearing in the queue. Looking at my error log, I found something akin to the following appearing everytime I tried to print from the remote computer:

Hint: Do you have the raw file printing rules enabled?

I no longer have the full error message readily available (it seems my CUPS log has already been truncated), but that’s the gist of it. So I looked up the message above on Google and found this page posted by an equally-frustrated person. I took his suggestions and made them on my own system. So, (Hint #1) make the following changes:

In /etc/cups/mime.convs, Uncomment…

application/octet-stream     application/vnd.cups-raw        0       -

In /etc/cups/mime.types, Uncomment…

mime.types:application/octet-stream

Fix them, and restart cups:

/etc/rc.d/init.d/cups restart

I actually made a mistake in here, but for continuity’s sake, I will indicate it at the end. You probably won’t make the same mistake and following the above steps may resolve your issue. But read on, regardless — there’s some other stuff you will want to know…

In any case, so I made the changes… still got the same error. So I start fiddling with the settings in CUPS. Running out of options, I decide to check out the Gnome printer configuration tool… and there’s what we will call Mistake #1: As I read elsewhere, find a tool and stick with it. If you use CUPS, don’t use the UI tool. They conflict with each other. Seriously – don’t mix this stuff at all. Before I knew it, my local sample print page output was nothing but one big black inky box, and everytime i tried to print anything, I got the same thing. Also, my print driver would never stay correct. So, in fact — I will recommend using yum (or yumex — it’s easier) to (Hint #2) completely remove the package system-config-printer. That is, remove that if you’re going to use CUPS all the time. If you use something else, you’re on your own. Also, if you’ve been promiscuous with your printer tools, you may find some of those uncommented lines recommented again. Fix them and restart CUPS.

Now — if you’ve gone and made the same dumb mistakes that I have, you’ll probably find that your print setup is in an overall pretty confused state. I resolved this by also (Hint #3) removing the foomatic package and reinstalling it. I was going to remove CUPS and reinstall it if I had to, but I didn’t — and thank God — CUPS is tied to way too much stuff in FC5 to easily remove it, although I guess you could manually rpm –force it. Regardless, uninstalling and reinstalling foomatic did the trick. Once again, you may check those files above to make sure they are uncommented, because while I don’t think foomatic messed with those, I can’t be sure right now. Anyway, you know the drill.

So at this point I am pretty damned sure I have things fixed. I go to the other computer, send a test page and… same error.

I was stymied and a bit frustrated. I began looking at all my stuff again, and then found the biggest idiocy of the whole issue. I had made Mistake #2: When you uncomment, be sure you actually uncomment. What I mean is — when I removed the ‘#’ I had somehow slipped a single leading space character amidst the newly fixed line in mime.convs.

One. Single. Space. I removed the space, restarted CUPS, and three hours later down the road, had out the issue resolved.

So there you have it. What should’ve been a simple configuration took several hours due to both mistakes on my part and idiosyncracies in Linux printing. I should also note, as a postscript, that while retracing my steps, somewhere along the way, the lines where I opened up in my firewall for printing got changed from referencing the port number (“631″) to the actual service itself (“ipp” – internet printing protocol). I am guessing this occurred during the foomatic fix..?


Tags: , , , , , , , — cswiii @ 12:52 pm

Leave a Reply