Can't add a printer in KDE: parser error?

Bug #42965 reported by TuxFan
100
Affects Status Importance Assigned to Milestone
foomatic-db-engine (Ubuntu)
Fix Released
High
Ubuntu Printing Team

Bug Description

Binary package hint: kdeprint

I originally reported this in #35581, but there was many bugs under that bug id and the "original" got fixed so here goes...

When I try to add a printer (using CUPS as the print system) I get this message after choosing the right driver (works well on Breezy):

----8<----
Error - KDE Control Module

Unable to load the requested driver:

Unable to create the Foomatic driver
[HP-LaserJet_1320,Postscript]. Either that driver does
not exist, or you don't have the required permissions to perform that operation.
----8<-----

I get the same error no matter if I'm in the administrator mode or not.

If I start systemsettings from command line, I can see this:

----8<----
*** glibc detected *** double free or corruption (!prev): 0x08178838 ***
Entity: line 2058: parser error : Extra content at the end of the document
  </printer>
                 ^
printer 'HP-LaserJet_1320' not found!
kdeprint: WARNING: PPD syntax error, PPD parse failed
----8<----

All this with the latest dapper versions:
kdeprint 3.5.2-0ubuntu19
kcontrol 3.5.2-0ubuntu19
kde-systemsettings 0.0svn20060502-0ubuntu1

TuxFan (make)
description: updated
Revision history for this message
Frank Siegert (fsiegert) wrote :

Changed to package "kdeprint" (?) and status "confirmed", because the same happens for me with a HP Laserjet 5L that has so far worked in every single distribution I was using (including Breezy).

kdeprint 4:3.5.2-0ubuntu23
cupsys 1.2.0-0ubuntu2

Furthermore there is a duplicate bug in bug #43990 (which I will mark as that), which says, that gnome-cups-manager works fine at the same time.

Changed in kdebase:
status: Unconfirmed → Confirmed
Revision history for this message
TuxFan (make) wrote :

Can someone increase the severity of this bug from normal to um... let's say like to critical?

In addition to these 3 printers mentioned (in bug #43990 there was an HP Deskjet 600) also the HP 4100N can't be added, so I guess this could affect all HP printers, which would be a pretty bad thing...

Revision history for this message
Johan Rutgeerts (johan-rutgeerts) wrote :

I had the same problem with a Ricoh Aficio 2060 and a Dell M5200.

Issuing "sudo foomatic-cleanupdrivers", according to bug #44033 in foomatic-db-engine (Ubuntu): "Error to configure printer driver with "foomatic-configure"", solved the problem for me.

Revision history for this message
Johan Rutgeerts (johan-rutgeerts) wrote :

Sorry, that should have said bug #44003 and not bug #44033.

Revision history for this message
Didier Raboud (odyx) wrote :

Following https://wiki.ubuntu.com/Bugs/CommonTasks, marked as "Major", not everybody has an HP Printer.

Changed in kdeprint:
assignee: nobody → kubuntu-team
Revision history for this message
TuxFan (make) wrote :

Thanks Didier, I don't have acces to other than HP printers, so I wasn't able to test any other printers, but apparently the problem is also with other than HP printers as seen above.

I tested now with some "wrong" Brother driver, and didn't get the "Error - KDE Control Module" pop-up error message, but there was still the same parser error in the same line in console.

After that I did an upgrade, which didn't help, but the "sudo foomatic-cleanupdrivers" fixed the problem also for me.

(Now I have an HP LJ 1100 in CUPS+SAMBA configuration, which I can't get working from my laptop running Dapper, but which works fine from my desktop running Breezy, but I think that's not related to this bug... Gotta try the other printers tomorrow.)

Maybe the magic command (foomatic-cleanupdrivers) should be run after updating some foomatic package?

Revision history for this message
Kinski (e0325620) wrote :

I'm getting the same "parser" error. But i can add a printer manually by copying the driver to /usr/share/ppd/custom/.

Revision history for this message
Frank Siegert (fsiegert) wrote :

"sudo foomatic-cleanupdrivers" (see bug #44003) also fixed this issue for me.

Revision history for this message
Kinski (e0325620) wrote :

"sudo foomatic-cleanupdrivers" works for me too.

Revision history for this message
Alan Hartless (harty83) wrote :

"sudo foomatic-cleanupdrivers" works

Revision history for this message
TuxFan (make) wrote :

I was right above, that my CUPS+SAMBA system bug wasn't related to this bug. I couldn't get the HP LJ 1320 thru SMB (on a windows machine) working either, but after an upgrade both work. I guess it was a CUPS problem which was fixed in cupsys version 1.2.0-0ubuntu5 (fixes handling of spaces in manufacturer names).

Now everything seems to work fine, but I still think that the magic command (foomatic-cleanupdrivers) should be run somewhere after upgrading some foomatic package. Most likely new installations don't have this problem, but for those people upgrading from Breezy to Dapper it might exist.

Revision history for this message
Didier Raboud (odyx) wrote :

I still confirm it does not work without that "magical command". It should be in "post-inst" for some cups-package, no ?

Revision history for this message
TuxFan (make) wrote :

I'm not a printing expert, but Martin Pitt said on bug #44003, that this was fixed in some foomatic upgrade and it occurs "because of some old cruft". That's why I've been suggesting "post-inst" of some foomatic package...

Revision history for this message
Kåre Särs (kare-sars) wrote :

I just installed Kubuntu Draper RC and I did get this same error when trying to add a generic postscript printer. I run the "sudo foomatic-cleanupdrivers" command and immediately after rerun the KDE Control module and now the module crashed. I did get it to work after restartting cups and kcontrol, but it did not give a very good impression by crashing and not working. Is it being fixed for the final 6.06 release?

Revision history for this message
Jojo (ojoj) wrote :

I'm running Kubuntu Rc and can confirm this bug using a HP LaserJet 5L.
The "sudo foomatic-cleanupdriver" made it work.

Revision history for this message
VF (vfiend) wrote :

I also had this problem in Dapper for Canon BJC-7100 and sudo foomatic-cleanupdriver fixed it for me.

Revision history for this message
Edu (martinez-bernal) wrote :

With HP710c I have two options, HP710c and HP710c pnm2ppa. I get the same problem with the first option, but worked ok with the second one.

Revision history for this message
Andreas Wenning (andreas-wenning) wrote :

Still a problem in final Kubuntu 6.06 release! Clean install. HP Deskjet 980C. sudo foomatic-cleanupdriver fixed it.

Revision history for this message
WalterNicholls (walter-nic) wrote :

This is a duplicate of #42123 ? as noted against that bug#, I had this problem with an Epson Stylus inkjet, in both breezy and after a fresh install of dapper. In dapper the "foomatic-cleanupdrivers" seems to have fixed things up.

Revision history for this message
Manuel López-Ibáñez (manuellopezibanez) wrote :

@ WlaterNicholls, hint: if you write bug 42123, launchpad automatically generates a link to the bug, however, if you write only #42123, it doesn't.

Revision history for this message
Maurizio Lattuada (maulattu) wrote :

me too. i've run into this problem (i've an hp laserjet 1000). with breezy was all right.
with "foomatic-cleanupdrivers" the problem is solved... that is: it installs the printer, but it prints anything...
damned hp

Revision history for this message
Nicole D (nederoy) wrote :

I have an hp deskjet 920c

I had just upgraded to dapper from hoary, and had never had any cups set up problems until now.

I took Johan Rutgeerts advice and entered a simple "sudo foomatic-cleanupdrivers" in the shell and that solved the problem immediately!!!

DEFINITELY TRY THIS BEFORE ANYTHING ELSE

Revision history for this message
bailout (jumpingclear) wrote :

Just to add that I have had the same problem with an Epson r220. I haven't tried the foomatic-cleanup yet. Just did a clean install the other so will test again. On previous dapper pre-release install I followed someone's advice to manually navigate to folder instead which worked but the resulting performance through kdeprint was appaling so I wasn't sure whether I had actually got the right driver in the end. I will be interested to see whether this method produces a better result.

Revision history for this message
Peter Liedler (peter-liedler) wrote :

Somae with lexmark z11. After installing the driver binaries from sourceforge I could selevt the printer in kcontrol (system settings).

Revision history for this message
Kraftwerk (lafferman) wrote :

I have the same problem in Dapper when installing generic printer drivers. Actually I haven't come across any drivers yet, where I didn't get this message. I have experimented with a Ricoh Aficio 1013F, a HP Laserjet 3020, an HP Laserjet 4l, Laserjet 5L and a few other ones where I don't remember what make or model they where.

However, can somebodyplease explain me what the command "sudo foomatic-cleanupdrivers" actually does? 'Clean up' can mean many different things.

However, I use a workaround by selecting the drivers manually. When you come to the dialogue, where you select the driver, just click on other. Then you can navigate to the ppd files. All the files should be in /usr/share/ppd. This way it works for me.

Revision history for this message
Sisyphe (verslenet-buntu) wrote :

Hi,

After I did the sudo foomatic-cleanupdrivers trick, the problem got worse since now there are no driver available anymore.

When I use kdeprint in administrator mode to add a printer, my printer HP Deskjet 6122 is recognised on the usb port but no make nor driver can be chosen next : the lists are completely empty (I can provide a screenshot if this is not clear).

(Of course I can still click the Other button to browse the ppd files).

This seems to be kde related only : using the cupsys web interface, the list of drivers is displayed.

Revision history for this message
Aleksi Nurmi (aleksi-nurmi) wrote :

I have a new Epson Stylus D88 and a clean Kubuntu 6.06 install and I got the same problem.

I did the cleanupdrivers trick.

What does it do? It says something like:
PM760pl.upp.xml has an empty command line, deleted!
PM820pl.upp.xml has an empty command line, deleted!
Stc680pl.upp.xml has an empty command line, deleted!
... the list goes on and on

Before that I tried to list the drivers in terminal but it didn't work (can't remember the output). After the trick it works fine.

In the end, the recommended driver doesn't exist anymore. A not-recommended CUPS driver works but psbook-rotated text looks awful. Gutenprint-ijs driver seems to work fine, but its printer options are not as polished.

Revision history for this message
TTL (supernova-2149) wrote :

I had the same problem with various printers. Even removing cupsys and reinstalling did not help. But "foomatic-cleanupdrivers" helped me.

Revision history for this message
S. Christoffer Eliesen (sce) wrote :

I have an HP Deskjet 930C with the same problem.
sudo foomatic-cleanupdrivers fixed it for me as well.

Revision history for this message
David Miller (djmdave) wrote :

I managed to side-step this issue by importing the correct driver for my HP Deskjet 940c from /usr/share/cups/model/hpijs/HP/ and importing the .ppd file instead of selecting it from the database in KDEprint

The sudo foomatic-cleanupdrivers command does a proper job at fixing this issue though -- try that before anything else

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

The best is to have a call of foomatic-cleanupdrivers in the post-install and post-uninstall scripts of all packages which contain Foomatic data, including foomatic-db itself. The we can make sure that there is always an existing driver as recommended driver in every printer XML file.

Changed in foomatic-db:
assignee: kubuntu-team → ubuntu-printing
Revision history for this message
Iain Cheyne (icheyne) wrote :

Note that the command is

sudo foomatic-cleanupdrivers

It's been spelt wrong a lot on this thread. I mistakenly tried a misspelling and got a bit panicky!

Revision history for this message
Kjetil Kjernsmo (kjetil) wrote :

I had the same problem a little while ago. I solved my problem by reinstalling the driver manually, and it turned out that there was a new driver that was recommended.

Also, I ended up validating all the XML files on my system by running

for file in `locate foomatic | grep '\.xml'`; do xmllint --noout $file ; done

as it seemed to me that the file was well-formed, and none of these files had errors. Which is kinda weird, since both xmllint and foomatic uses the same parser. The parse error didn't seem to matter, though, which leads me to think that the parse error and the driver problem are two unrelated problems.

Revision history for this message
Pascal De Vuyst (pascal-devuyst) wrote :

Till wrote:
> The best is to have a call of foomatic-cleanupdrivers in the post-install
> and post-uninstall scripts of all packages which contain Foomatic data,
> including foomatic-db itself.

I'm using Edgy 20060924 which uses dynamically generated PPDs now (since foomatic-db-engine 3.0.2-20060530-2ubuntu2).

There are some pseudo drivers in foomatic-db that are only used to list supported printers on the linuxprinting.org website. It is not possible to generate PPDs from these pseudo-drivers since there is no Ghostscript command line.

Adding a printer with a pseudo driver with gnome-cups-manager results in no printer being added and the user has no clue of what went wrong. This gives a very bad user experience.

It would be nice to have the fix you mentioned in Edgy to avoid this.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

I have fixed the problem upstream in foomatic-db-engine. The fixed version lets CUPS only list printer/driver combos which really produce a PPD files. So CUPS-1.2-based printer setup frontends will not show unusable printer driver combos any more.

I will make an Ubuntu package of this new fixed version soon.

Changed in foomatic-db:
status: Confirmed → In Progress
Changed in foomatic-db-engine:
status: In Progress → Fix Committed
Changed in foomatic-db-engine:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.