Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1772698 - Can't setup printer (HP LJ 2200): no attributes found in model.dat
Summary: Can't setup printer (HP LJ 2200): no attributes found in model.dat
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: hplip
Version: 30
Hardware: All
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Zdenek Dohnal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-11-14 22:12 UTC by azrdev
Modified: 2020-10-04 20:23 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-10-04 20:23:51 UTC
Type: Bug


Attachments (Terms of Use)
gdb_log of hp-setup (3.49 KB, text/plain)
2020-09-23 21:41 UTC, azrdev
no flags Details
gdb_log of hp-setup no.2 (3.38 KB, text/plain)
2020-09-30 21:34 UTC, azrdev
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1853002 0 None None None 2020-07-23 11:53:43 UTC

Description azrdev 2019-11-14 22:12:13 UTC
Description of problem:
I have a HP LaserJet 2200 which used to work on that Fedora Server machine (i.e. headless / no Xorg) since several fedora releases.
I tried to reinstall it now (purging /etc/cups/ ) which failed when -- on the fresh cups installation -- accessing the web interface page Admin > "Add Printer":
It doesn't show the USB attached, powered on printer as available (as it used to).

`journalctl -u cups` contains:

> Nov 14 22:44:30 hostname python3[15499]: io/hpmud/model.c 537: no HP_LaserJet_2200 attributes found in /usr/share/hplip/data/models/models.dat
> Nov 14 22:44:30 hostname python3[15499]: io/hpmud/model.c 548: no HP_LaserJet_2200 attributes found in /usr/share/hplip/data/models/unreleased/unreleased.dat
> Nov 14 22:44:30 hostname python3[15499]: io/hpmud/musb.c 2129: ignoring hp:/usb/HP_LaserJet_2200?serial=00FRHRC15973 support=0


The Printer appears in lsusb:
> Bus 003 Device 007: ID 03f0:0217 HP, Inc LaserJet 2200

and apparently even corresponds to some /dev/usb/lp0 :
> $ udevadm info --attribute-walk --name=/dev/usb/lp0
> ...
>   looking at device '/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0/usbmisc/lp0':
>     KERNEL=="lp0"
>     SUBSYSTEM=="usbmisc"
>     DRIVER==""
>
>   looking at parent device '/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0':
>     KERNELS=="3-2:1.0"
>     SUBSYSTEMS=="usb"
>     DRIVERS=="usblp"
>     ATTRS{bInterfaceClass}=="07"
>     ATTRS{authorized}=="1"
>     ATTRS{bInterfaceNumber}=="00"
>     ATTRS{ieee1284_id}=="MFG:Hewlett-Packard;CMD:PJL,MLC,PCL,PCLXL,POSTSCRIPT;MDL:HP LaserJet 2200;CLS:PRINTER;DES:Hewlett-Packard LaserJet 2200;MEM:8MB"


And I suspect this is the root of the problem: The printer has a "MDL:HP LaserJet 2200" in its "ieee1284_id", while the model description in hplip is in lowercase:
> $ grep -i HP_LaserJet_2200 /usr/share/hplip/data/models/models.dat
> [hp_laserjet_2200_series]


Version-Release number of selected component (if applicable):
> $ rpm -q hplip hplip-common
> hplip-3.19.8-2.fc30.x86_64
> hplip-common-3.19.8-2.fc30.x86_64


How reproducible: always


I am happy to debug further upon instruction how to, however the hplip included tools (hp-check, hp-doctor, ...) most require a GUI / Xorg, and this is a headless system with tty / SSH only, so they are of little use.

Comment 1 Zdenek Dohnal 2019-11-15 13:14:37 UTC
Hi,

thank you for reporting the issue and investigating it!

io/hpmud/model.c does the exact comparison of model and section, but it ignores the case - the problem is there is no section hp_laserjet_2200, but only hp_laserjet_2200_series, so it finds nothing.

Would you mind testing the build https://koji.fedoraproject.org/koji/taskinfo?taskID=39012164 ?

The patch there should take care of hpmud error message, but I'm not quite sure if it helps with installation - IMO prnt/drv/hpcups.drv.in will need to be patched too, but I would rather have smaller patch, if it will work.

Comment 2 azrdev 2019-11-16 20:09:47 UTC
Thank you, the new build fixed the issue!

After installing from https://koji.fedoraproject.org/koji/taskinfo?taskID=39012167 the packages
hplip-3.19.10-2.fc30.x86_64.rpm  hplip-common-3.19.10-2.fc30.x86_64.rpm  hplip-libs-3.19.10-2.fc30.x86_64.rpm  libsane-hpaio-3.19.10-2.fc30.x86_64.rpm
the printer turns up as option "HP LaserJet 2200 USB 00FRHRC15973 HPLIP (HP LaserJet 2200)", all the logged errors (about models.dat) are gone.

Comment 3 Zdenek Dohnal 2019-11-18 13:12:44 UTC
Reported upstream https://bugs.launchpad.net/hplip/+bug/1853002 .

Thank you for the testing! The fix will be in the next hplip update.

Comment 4 Fedora Update System 2019-11-18 14:18:12 UTC
FEDORA-2019-722e4e3f0c has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2019-722e4e3f0c

Comment 5 Fedora Update System 2019-11-19 02:13:31 UTC
hplip-3.19.10-2.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-69e684dd40

Comment 6 Fedora Update System 2019-11-19 03:15:33 UTC
hplip-3.19.10-2.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-722e4e3f0c

Comment 7 Fedora Update System 2019-11-26 23:51:47 UTC
hplip-3.19.10-2.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2019-11-27 00:23:41 UTC
hplip-3.19.10-2.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.

Comment 9 azrdev 2020-07-23 11:53:44 UTC
This bug reappeared exactly as described above on fedora32 with packets:


$ rpm -q hplip{,-common,-libs} libsane-hpaio 
hplip-3.20.6-1.fc32.x86_64
hplip-common-3.20.6-1.fc32.x86_64
hplip-libs-3.20.6-1.fc32.x86_64
libsane-hpaio-3.20.6-1.fc32.x86_64


setting to NEW, hope that's correct since there's no REOPENED.

Comment 10 Zdenek Dohnal 2020-07-24 07:36:26 UTC
Hi,

thank you for letting me know!

Are you sure you are getting the same error messages? I tried to fake a device uri:

hp:/usb/LaserJet_2200?serial=00FRHRC15973

with `hp-setup -i`, but I didn't get the error messages.

Are you again not able to install printer via cups web ui and there are the same logs in journal?

Would you mind trying 'hp-setup -i -ldebug' if it installs the printer?


Please attach the logs after following steps here https://fedoraproject.org/wiki/How_to_debug_printing_problems#I_have_HP_printer_and_have_a_problem_with_HPLIP_script .


Thank you in advance!

Comment 11 azrdev 2020-08-11 20:37:37 UTC
@Zdenek thank you for getting back to me so quickly!

Yes, the cups web interface doesn't list the printer in the "add printer" dialog.

`hp-setup -i -ldebug` fails to recognize the printer, ans spews the following into the journal:

> python3[2769773]: io/hpmud/model.c 546: no HP_LaserJet_2200 attributes found in /usr/share/hplip/data/models/models.dat
> python3[2769773]: io/hpmud/model.c 557: no HP_LaserJet_2200 attributes found in /usr/share/hplip/data/models/unreleased/unreleased.dat
> python3[2769773]: io/hpmud/musb.c 2129: ignoring hp:/usb/HP_LaserJet_2200?serial=00FRHRC15973 support=0
> python3[2769773]: io/hpmud/model.c 546: no HP_LaserJet_2200 attributes found in /usr/share/hplip/data/models/models.dat
> python3[2769773]: io/hpmud/model.c 557: no HP_LaserJet_2200 attributes found in /usr/share/hplip/data/models/unreleased/unreleased.dat
> python3[2769773]: io/hpmud/musb.c 2129: ignoring hp:/usb/HP_LaserJet_2200?serial=00FRHRC15973 support=0
> python3[2769773]: io/hpmud/model.c 546: no HP_LaserJet_2200 attributes found in /usr/share/hplip/data/models/models.dat
> python3[2769773]: io/hpmud/model.c 557: no HP_LaserJet_2200 attributes found in /usr/share/hplip/data/models/unreleased/unreleased.dat
> python3[2769773]: io/hpmud/musb.c 2129: ignoring hp:/usb/HP_LaserJet_2200?serial=00FRHRC15973 support=0
> /hp-setup[2769773]: hp-setup[2769773]: error: No device selected/specified or that supports this functionality.

And the models.dat file still contains the section with _series suffix:
> # grep -ri HP_LaserJet_2200 /usr/share/hplip/data/models                                                                                                             :(
> /usr/share/hplip/data/models/models.dat:[hp_laserjet_2200_series]


I have no unreleased.dat file, if I (as a debugging hack) extract the [hp_laserjet_2200_series] section from models.dat into it under [hp_laserjet_2200] the printer is found by the web ui.

Comment 12 Zdenek Dohnal 2020-08-18 12:49:00 UTC
@azrdev I have a testing build prepared - https://koji.fedoraproject.org/koji/taskinfo?taskID=49535010

Would you mind testing it?

It is a scratch build, so it will be removed after 2-3 days, so please download rpms at least if you don't have time to test at the moment.

Comment 13 Fedora Update System 2020-08-24 11:05:47 UTC
FEDORA-2020-388083cf4d has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-388083cf4d

Comment 14 Fedora Update System 2020-08-24 11:21:59 UTC
FEDORA-2020-0fe6dfcdbf has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-0fe6dfcdbf

Comment 15 Fedora Update System 2020-08-25 01:59:56 UTC
FEDORA-2020-388083cf4d has been pushed to the Fedora 32 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-388083cf4d`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-388083cf4d

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 16 Fedora Update System 2020-08-25 02:04:34 UTC
FEDORA-2020-0fe6dfcdbf has been pushed to the Fedora 31 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-0fe6dfcdbf`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-0fe6dfcdbf

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 17 Zdenek Dohnal 2020-08-25 09:30:40 UTC
The previous patch used uninitialized value as an index. Fixing again.

Comment 18 Fedora Update System 2020-08-25 10:58:08 UTC
FEDORA-2020-4967d78730 has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-4967d78730

Comment 19 Fedora Update System 2020-08-25 11:12:00 UTC
FEDORA-2020-5109b7fe70 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-5109b7fe70

Comment 20 Fedora Update System 2020-08-26 14:33:58 UTC
FEDORA-2020-4967d78730 has been pushed to the Fedora 32 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-4967d78730`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-4967d78730

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 21 Fedora Update System 2020-08-26 15:16:02 UTC
FEDORA-2020-5109b7fe70 has been pushed to the Fedora 31 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-5109b7fe70`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-5109b7fe70

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 22 Fedora Update System 2020-08-31 15:49:31 UTC
FEDORA-2020-4967d78730 has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 23 Fedora Update System 2020-09-03 16:25:34 UTC
FEDORA-2020-5109b7fe70 has been pushed to the Fedora 31 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 24 azrdev 2020-09-21 19:53:15 UTC
Hello @Zdenek,

sorry that it took me a while to get back to this, but I downloaded your scratch build from comment 12 in time.
However, neither that build nor the now-current hplip-3.20.6-9.fc32.x86_64 do fix the issue: `sudo hp-setup -i -b usb` for both says "error: No device selected/specified or that supports this functionality."
As before, adding the following file makes the command recognize the printer and proposing to add a queue:
$ head /usr/share/hplip/data/models/unreleased/unreleased.dat
[hp_laserjet_2200]
align-type=0
clean-type=0
color-cal-type=0
copy-type=0
embedded-server-type=1
fax-type=0
fw-download=False
...

Comment 25 Zdenek Dohnal 2020-09-22 12:39:33 UTC
Hi @azrdev,

thank you for letting me know - I'll look into it.

I would appreciate if you get here once a week at least, to answer my questions or test the builds - because it seems I'm not able to fake that I have your device :( .

Please do following (have python3-debuginfo, python3-debugsource, hplip-debuginfo, hplip-libs-debuginfo, hplip-debugsource installed):

1) $ gdb /usr/bin/python3

Then in gdb:

(gdb) set logging file gdb_log

(gdb) set logging on

(gdb) b hpmud_get_model_attributes

(gdb) b ParseFile

(gdb) r /usr/bin/hp-setup -i -b usb

(gdb) c

(gdb) p model

(gdb) b 423 if strncmp(rcbuf, "[hp_laserjet_2200_series]\n", strlen("[hp_laserjet_2200_series]"))

(gdb) c

(gdb) p rcbuf

(gdb) fin

(gdb) q


and please attach created gdb_log as an attachment. I tried to set 'model' in ParseFile() function to 'HP_LaserJet_2200' (model name from your logs) and then ParseFile() finds the entry...

Comment 26 azrdev 2020-09-23 21:35:25 UTC
Hello Zdenek, I'll try to.

I'm attaching the log as you requested.

Comment 27 azrdev 2020-09-23 21:41:10 UTC
Created attachment 1716149 [details]
gdb_log of hp-setup

Comment 28 Zdenek Dohnal 2020-09-29 13:17:33 UTC
Damn me... (never rush thing before holidays...):

1) probably you will need glibc debuginfo installed too - otherwise I'm not sure about the message from the log:

"Error in testing breakpoint condition:
'__strlen_sse2' has unknown return type; cast the call to its declared return type"

2) from the steps I provided:

The current - incorrect command:
...
(gdb) b 423 if strncmp(rcbuf, "[hp_laserjet_2200_series]\n", strlen("[hp_laserjet_2200_series]"))
...


The new correct one (we need to compare to 0, because we need to break when the string IS in the buffer):

(gdb) b 423 if strncmp(rcbuf, "[hp_laserjet_2200_series]\n", strlen("[hp_laserjet_2200_series]")) == 0


I'm really sorry about this, would you mind correcting those two mistakes and reupload the debug log?

Comment 29 azrdev 2020-09-30 21:33:56 UTC
Your corrected break condition also doesn't fire. I tried with `b 423 if strstr(rcbuf, "_2200")` and got the attached result. "value returned is 1" looks to me like it's correctly matching my printer to the models.dat entry, so the error has to be somewhere else.


`dnf debuginfo-install glibc` was correct to get rid of the strlen_sse2 warning, though.

Comment 30 azrdev 2020-09-30 21:34:33 UTC
Created attachment 1718003 [details]
gdb_log of hp-setup no.2

Comment 31 Zdenek Dohnal 2020-10-02 07:55:23 UTC
Hmm... if I run it in gdb, strncmp works for that breakpoint... anyway, thanks for finding out strstr() works!

Then it is really confusing... the return value of ParseFile() is checked in hpmud_get_model_attributes() and if the model isn't found, then the following message is generated:

> python3[2769773]: io/hpmud/model.c 546: no HP_LaserJet_2200 attributes found in /usr/share/hplip/data/models/models.dat


Do you still get such error messages in journal?

Comment 32 azrdev 2020-10-04 20:23:51 UTC
Indeed, sorry for not cross checking that! That message doesn't turn up in journal, but the printer appears on the "new printer" dialog on cups admin interface.

So thank your for caring, this issue appears to be fixed now.


Note You need to log in before you can comment on or make changes to this bug.