Commas in marker supply names misinterpreted as additional markers

Bug #926457 reported by Peter Hurley
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cups (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Printer supply names are determined via SNMP query. The printer may report supply names that contain commas - eg., "Genuine Xerox Solid Ink Yellow, Phaser 8560/8560MFP, P/N 108R00725". This will be interpreted by CUPS as 3 separate supplies:
1) Genuine Xerox Solid Ink Yellow
2) Phaser 8560/8560MFP
3) P/N 108R00725

This has a visual impact on the system-config-printer Printer Properties Dialog, as the supplies are incorrectly titled.

Revision history for this message
Peter Hurley (phurley) wrote :

This was reported upstream and assigned upstream bug #4020.

Revision history for this message
Peter Hurley (phurley) wrote :

This patch addresses the problem by truncated the supply name at the first comma.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "0001-Truncate-marker-supply-names-at-comma.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

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

Thank you very much for the patch (and also for the other patches for bug 925086).

Cutting off the marker level names at the first comma is a bad idea, as the first part can perhaps be equal for two consumables. I suggest to simply replace the commas by spaces or semicolons.

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

CUPS 1.5.1 got released with some fixes on marker levels. Can you update your patch to correctly apply to 1.5.1, so that I can use it in the Debian/Ubuntu package of CUPS? Thanks.

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

Link to CUPS upstream bug report: http://www.cups.org/str.php?L4020

Changed in cups (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
milestone: none → ubuntu-12.04-beta-1
Changed in cups (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

After installing CUPS 1.5.2 with all your patches (package will appear in Precise soon) I have still problems with supply names not correctly being assigned.

I have the HP Color LaserJet CM3530 MFP, set up with the "socket" CUPS backend. system-config-printer shows 6 supplies, the first three are toners which are correctly named and colored, the last two, probably the fuser and a waste toner box are incorrectly named.

In my error_log I get

D [07/Feb/2012:09:32:12 +0100] [Job 23] ATTR: marker-names="Black Cartridge HP CE250A","Cyan Cartridge HP CE251A","Magenta Cartridge HP CE253A","Yellow Cartridge HP CE252A","Image Fuser Kit HP 110V-CE484A"," 220V-CE506A","Toner Collection Unit HP CE254A"

system-config-printer shows the fifth supply as "Image Fuser Kit HP 110V-CE484A", and the sixth as " 220V-CE506A". Correct would be "Image Fuser Kit HP 110V-CE484A? 220V-CE506A" ('?' being some special character) and "Toner Collection Unit HP CE254A".

tags: added: patch-accepted-debian patch-forwarded-upstream
removed: patch
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

larsu, can you also test with your color laser? Please create a print queue for it with the "socket" CUPS backend and then right-click the printer icon in s-c-p, choose "Properties" in the pop-up menu, "Ink/Toner levels" on the left, then "Refresh" button on the right.

Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (3.9 KiB)

This bug was fixed in the package cups - 1.5.2-1

---------------
cups (1.5.2-1) precise; urgency=low

  [ Till Kamppeter ]
  * New upstream release
  * debian/patches/00svn_gif_overflow.patch,
    debian/patches/cups-driverd-recognize-cached-drv-generated-ppds.patch,
    debian/patches/dont-send-malformed-dbus-messages.patch,
    debian/patches/execute-commandtops-commands.patch,
    debian/patches/usb-backend-gracefully-fail-on-more-cases-of-bad-device-id.patch,
    debian/patches/usb-backend-skip-set-configuration-set-interface.patch:
    Removed, included upstream.
  * debian/patches/ipp-patch-r8950+.patch,
    debian/patches/ipp-backend-fails-to-trigger-authentication-prompts.patch,
    debian/patches/ipp-backend-missing-document-type.patch,
    debian/patches/ipp-backend-http-1.0-fallback-fix.patch: Replaced patch
    for downgrading to the IPP backend to the version of CUPS 1.4.x by patches
    for the current backend (LP: #879625, LP: #881843, CUPS STR #3985,
    CUPS STR #3986, CUPS STR #3988, thanks to Robert Bradley, robert dot
    bradley1 at gmail dot com, for the patches).
  * debian/patches/drop_unnecessary_dependencies.patch: Updated patch to
    add "-lm" to the linker command line, libcups uses the "fmod()" function
    now.
  * debian/patches/cups-avahi.patch,
    debian/patches/usb-backend-libusb-1.0.patch,
    debian/patches/printer-filtering.patch:
    Manually regenerated to adapt to upstream changes.
  * debian/patches/pidfile.patch,
    debian/patches/rootbackends-worldreadable.patch,
    debian/patches/colord-support.patch,
    debian/patches/airprint-support.patch,
    debian/patches/no-conffile-timestamp.patch,
    debian/patches/read-embedded-options-from-incoming-postscript-and-add-to-ipp-attrs.patch,
    debian/patches/do-not-broadcast-with-hostnames.patch,
    debian/patches/do-not-suppress-inputslot-setting-with-empty-ap-d-inputslot.patch,
    debian/patches/confdirperms.patch,
    debian/patches/show-compile-command-lines.patch,
    debian/patches/log-debug-history-nearly-unlimited.patch,
    debian/patches/dnssd-reg-array-linear-search.patch:
    Refreshed using quilt.
  * debian/patches/fix-supply-level-computation-for-percent-supply-unit.patch,
    debian/patches/fix-supply-levels-for-enumerated-prtmarkersupplieslevel.patch,
    debian/patches/fix-status-reports-when-supply-levels-grow.patch:
    The printer supply levels reported via SNMP, according to the printer MIB
    were not correctly interpreted (LP: #925086, CUPS STR #4016, thanks to
    Peter Hurley, peter at hurleysoftware dot com, for the patches).
  * debian/patches/add-status-reports-for-full-waste-trays-and-cleaner-unit-eol.patch:
    Added status reports for waste tray status and cleaner unit end-of-life
    (LP: #925086, CUPS STR #4017, thanks to Peter Hurley, peter at
    hurleysoftware dot com, for the patch).
  * debian/patches/match-marker-colorants-which-use-non-standard-string.patch:
    Try harder to match supply colorant values (LP: #925086, CUPS STR #4019,
    thanks to Peter Hurley, peter at hurleysoftware dot com, for the patch).
  * debian/patches/truncate-marker-supply-names-at-comma.patch: Commas in
    marker supply names mi...

Read more...

Changed in cups (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Reopening as for my HP Color LaserJet CM3530 MFP I do not get the expected effect.

Changed in cups (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
Peter Hurley (phurley) wrote :

Till,

There are several possibilities here:
1) the SNMP supplies code caches the results of the MIB walk in /var/cache/cups/<ip_addr>.snmp
This cache file survives cupsd restart - this is really another bug - and contains the *previous* supplies[] structure in binary format. This is bad since the supplies[] structure has now changed.

2) the results of SNMP marker parsing are also cached in /etc/cups/printers.conf
This too I feel is a bug in CUPS - this is what is shown if you don't hit 'Refresh'.

3) I doubt HP put a '?' in the supplies description. More likely is that the localization charset is one the SNMP supplies code doesn't recognize (so it defaults to copying ASCII chars only and blows in '?' for everything else).

4) Along the same lines as #3, there could be a bug in one of charset to utf8 converters used by the SNMP supplies code.

Next troubleshooting steps:
1) Delete the printer from CUPS printer management
2) Stop cups, delete the snmp cache file (I'm not sure if CUPS deletes the cache file if the printer is deleted - please report if cache file is present after deleting printer).
3) Restart cups, re-add printer, navigate to supplies tab and hit 'Refresh'.

If those steps didn't resolve the problem, then please post here the following:
1) Output results from 'testsupplies'
'testsupplies' is a binary product not included in the packaging but still built. It's in the 'backend' subdir. It needs the PPD filename in the environment and the target's ip address. It outputs to stderr (that's how it communicates the job results :) How I run mine (from the backend subdir):

$ PPD=/etc/cups/ppd/hp2605dn.ppd ./testsupplies 192.168.1.201 2> supplies.result

It runs in a loop - you have to interrupt it after you see the PASS/FAIL output.

2) The system MIB and print MIB. To dump the mibs:
$ snmpwalk -v 1 -c public <ip address> .1.3.6.1.2.1.25 > hp.system.mib
$ snmpwalk -v 1 -c public <ip address> .1.3.6.1.2.1.43 > hp.print.mib

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

Note that where I wrote the '?' there was a character not known to me. Looking into the /var/cache/cups/192.168.178.31.snmp file I see now that it is a comma.

I have recreated the queue now and still have the problem, CUPS is assuming that the text after the comma is the next supply name. So s-c-p still shows "Image Fuser Kit HP 110V-CE484A" and " 220V-CE506A" as the banes of the 5th and 6th supplies.

The files you asked for are attached.

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

In looking over the attached 'supplies.result', it appears that the various patches weren't applied, as additional output is generated by those patches.

Also, now I see your point about truncating at the first comma. Initially, I felt it was 'no big deal'; but looking at the cleanerUnit supply on your printer, I would feel bad if someone replaced their 220V unit with a 110V unit because that's all that was reported.

I'll make an updated patch that addresses the comma problem in some other way.

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

I have found out what happens: I forgot to update the "series" file, the list of patches to be applied to the CUPS package. So all new patches (including yours) die not get applied. Will be fixed in CUPS 1.5.2-2. Sorry.

Changed in cups (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Now it works, thank you very much for the patches.

I have a suggestion for improving it: Instead of discarding what is after the first comma,. I suggest to replace the comma by a space or by a semicolon and conserver the rest of the supply name, as I have now

"Image Fuser Kit HP 110V-CE484A"

and

"Toner Collection Unit HP CE254A"

This makes the impression that in my printer is a 110V fuser and in Germany we have 220V. It also suppresses the part number for the 220V version, so

"Image Fuser Kit HP 110V-CE484A 220V-CE506A"

would be much better.

Changed in cups (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cups - 1.5.2-2

---------------
cups (1.5.2-2) unstable; urgency=low

  * debian/patches/series: Actually add the new patches for the IPP backend and
    the SNMP supply level check (LP: #879625, LP: #881843, LP: #925086,
    LP: #926457).
 -- Martin Pitt <email address hidden> Tue, 07 Feb 2012 17:57:57 +0100

Changed in cups (Ubuntu):
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.