USB peripherals no longer work

My USB printer and scanner had been working fine, but no longer do. No doubt I inadvertently broke it, but cannot recall doing anything that could have caused that, and have been unable to find and fix the problem. The details are these:

I’m running up-to-date openSUSE 42.3 64 bit. Although lsusb can see my printer and scanner…


warren@puccini:~> lsusb
Bus 005 Device 004: ID 058f:6364 Alcor Micro Corp. AU6477 Card Reader Controller
Bus 005 Device 011: ID 03f0:102a Hewlett-Packard 
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 1bcf:0809 Sunplus Innovation Technology Inc. 
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 04a9:2220 Canon, Inc. CanoScan LIDE 25
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 006: ID 09ae:2010 Tripp Lite 
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

…attempting to use either device fails silently. For example, lpstat hangs with no output, simple-scan launched from the command line hangs when trying to scan with no stderr output, and hp-toolbox launched from the comand line hangs when trying to open.

I don’t see anything obviously wrong in boot.log.

At this point I’m not sure what my next step should be in finding and fixing the problem.

That is strange. Starting with your HP printer as an example, what is reported when it’s first plugged in?

dmesg|tail

If using HPLIP, run the following backend

/usr/lib/cups/backend/hp

otherwise the usb backend…

/usr/lib/cups/backend/usb

What is reported (if anything)?

I unplugged the USB cable from the HP printer, plugged it back in, and checked:


warren@puccini:~> sudo dmesg | tail
[15554.777070] SFW2-INext-DROP-DEFLT IN=eth0 OUT= MAC=00:1c:c0:53:44:ef:30:f7:72:65:7f:84:08:00 SRC=192.168.0.179 DST=192.168.0.167 LEN=365 TOS=0x00 PREC=0x00 TTL=64 ID=4 PROTO=UDP SPT=427 DPT=47877 LEN=345 
[18553.972090] usb 5-1: USB disconnect, device number 11
[18553.972333] usblp0: removed
[18559.436038] usb 5-1: new high-speed USB device number 15 using ehci-pci
[18559.568958] usb 5-1: New USB device found, idVendor=03f0, idProduct=102a
[18559.568965] usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[18559.568968] usb 5-1: Product: HP LaserJet Professional P 1102w
[18559.568973] usb 5-1: Manufacturer: Hewlett-Packard
[18559.568976] usb 5-1: SerialNumber: 000000000W48DDSWPR1a
[18559.571255] usblp 5-1:1.0: usblp0: USB Bidirectional printer dev 15 if 0 alt 0 proto 2 vid 0x03F0 pid 0x102A

warren@puccini:~> sudo /usr/lib/cups/backend/hp
direct hp:/usb/HP_LaserJet_Professional_P_1102w?serial=000000000W48DDSWPR1a "HP LaserJet Professional P 1102w" "HP LaserJet Professional P 1102w USB 000000000W48DDSWPR1a HPLIP" "MFG:Hewlett-Packard;MDL:HP LaserJet Professional P 1102w;CLS:PRINTER;DES:HP LaserJet Professional P 1102w;SN:000000000W48DDSWPR1a;"

Which is strange, because I don’t see anything obviously broken there.

Me neither.

Is the printer configuration as expected?

sudo cat /etc/cups/printers.conf

Does this work as expected?

hp-testpage

If not, run the following and examine the output…

hp-check

Another thought I had - in case it’s related to some recent update perhaps, have you since rebooted to check behaviour again?

I have rebooted since the problem started, yes. Other things that I failed to mention that I have tried is (1) swapping the USB cable for a known good one, and (2) sending from the command line a simple print job of a text file (“lp .bashrc”), which was accepted by the shell without error but silently failed to print.

The only thing unexpected in printers.conf is that the printer was paused:


warren@puccini:~> sudo cat /etc/cups/printers.conf
[sudo] password for root: 
# Printer configuration file for CUPS v1.7.5
# Written by cupsd on 2017-10-01 15:42
# DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING
<DefaultPrinter HP_LaserJet>
UUID urn:uuid:20651ede-d3a8-3d3f-5cbc-076ac6573a29
Info HP_LaserJet
DeviceURI hp:/usb/HP_LaserJet_Professional_P_1102w?serial=000000000W48DDSWPR1a
State Stopped
StateMessage 
StateTime 1506894127
Reason paused
Type 8425484
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy stop-printer
</Printer>

So I enabled it with “sudo cupsenable HP_LaserJet”. Immediately the test job printed that I had earlier sent. printers.conf now reports that it is idle.

“hp-testpage” prints a copyright message and hangs hard, not even ^C kills it. I had to kill the process.

“hp-check” eventually hung on “discovered scanner devices”, which is an odd place to hang given that my HP device is just a printer and not a scanner or multi-function device. It produced quite a lot of output before it hung. I’ll spare you it all but these things did catch my eye:


warning: 3-42.3 version is not supported. Using 3-42.2 versions dependencies to verify and install...
(snip)
warning: HPLIP-Installation: Auto installation is not supported for 3 distro  42.3 version 
(snip. Lots of warnings in the compiledep section, but I'm using a precompiled binaries so I presume that can be ignored. I'm not so sure about the next section however, given that not all of them are development packages.)
------------------------
| General Dependencies |
------------------------

 error: libcrypto     libcrypto - OpenSSL cryptographic library                    REQUIRED        -               1.0.2           MISSING    'libcrypto needs to be installed'
 python-xml           Python XML libraries                                         REQUIRED        -               2.1.1           OK         -
 error: libnetsnmp-devel libnetsnmp-devel - SNMP networking library development files REQUIRED        5.0.9           -               MISSING    'libnetsnmp-devel needs to be installed'
 error: sane-devel    SANE - Scanning library development files                    REQUIRED        -               -               MISSING    'sane-devel needs to be installed'
 error: pil           PIL - Python Imaging Library (required for commandline scanning with hp-scan) OPTIONAL        -               -               MISSING    'pil needs to be installed'
 pyqt4-dbus           PyQt 4 DBus - DBus Support for PyQt4                         REQUIRED        4.0             4.11.4          OK         -
 error: libpthread    libpthread - POSIX threads library                           REQUIRED        -               2.22            MISSING    'libpthread needs to be installed'
 error: python-devel  Python devel - Python development files                      REQUIRED        2.2             2.7.13          MISSING    'python-devel needs to be installed'
 error: cups-devel    CUPS devel- Common Unix Printing System development files    REQUIRED        -               1.7.5           MISSING    'cups-devel needs to be installed'
 python-dbus          Python DBus - Python bindings for DBus                       REQUIRED        0.80.0          1.2.0           OK         -
 error: cups-ddk      CUPS DDK - CUPS driver development kit                       OPTIONAL        -               -               MISSING    'cups-ddk needs to be installed'
 error: reportlab     Reportlab - PDF library for Python                           OPTIONAL        2.0             -               MISSING    'reportlab needs to be installed'
 pyqt4                PyQt 4- Qt interface for Python (for Qt version 4.x)         REQUIRED        4.0             4.11.4          OK         -
 error: libusb        libusb - USB library                                         REQUIRED        -               1.0             MISSING    'libusb needs to be installed'
 error: cups-image    CUPS image - CUPS image development files                    REQUIRED        -               1.7.5           MISSING    'cups-image needs to be installed'
 python2X             Python 2.2 or greater - Python programming language          REQUIRED        2.2             2.7.13          OK         -
 error: python-notify Python libnotify - Python bindings for the libnotify Desktop notifications OPTIONAL        -               -               MISSING    'python-notify needs to be installed'
 error: libjpeg       libjpeg - JPEG library                                       REQUIRED        -               -               MISSING    'libjpeg needs to be installed'
(snip)
-------------------------
| External Dependencies |
-------------------------
(snip)
 error: dbus          DBus - Message bus system                                    REQUIRED        -               1.8.22          MISSING    'DBUS may not be installed or not running'
 error: avahi-utils   avahi-utils                                                  OPTIONAL        -               -               MISSING    'avahi-utils needs to be installed'
(snip)

I’m not sure why hp-check didn’t find dbus, because it is installed and running:


warren@puccini:~> sudo service dbus status
● dbus.service - D-Bus System Message Bus
   Loaded: loaded (/usr/lib/systemd/system/dbus.service; static; vendor preset: disabled)
   Active: active (running) since Sun 2017-10-01 12:02:16 CST; 8h ago
     Docs: man:dbus-daemon(1)
 Main PID: 1009 (dbus-daemon)
    Tasks: 1 (limit: 512)
   CGroup: /system.slice/dbus.service
           └─1009 /bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation

You do seem to missing a lot of dependencies. Is libusb really missing?

zypper se -si libusb

If so, there may well be other inconsistencies.

Are your configured repos as expected? All compatible?

zypper lr -d

I do have libusb, and I believe my repos are fine:


warren@puccini:~> sudo zypper se -si libusb
[sudo] password for root: 
Loading repository data...
Reading installed packages...

S  | Name         | Type    | Version     | Arch   | Repository           
---+--------------+---------+-------------+--------+----------------------
i+ | libusb-0_1-4 | package | 0.1.13-34.3 | x86_64 | Main Repository (OSS)
i+ | libusb-1_0-0 | package | 1.0.20-5.5  | x86_64 | Main Repository (OSS)
i+ | libusbmuxd4  | package | 1.0.10-7.1  | x86_64 | Main Repository (OSS)
warren@puccini:~> sudo zypper lr -d
Repository priorities are without effect. All enabled repositories share the same priority.

#  | Alias                               | Name                                    | Enabled | GPG Check | Refresh | Priority | Type   | URI                                                                                   | Service
---+-------------------------------------+-----------------------------------------+---------+-----------+---------+----------+--------+---------------------------------------------------------------------------------------+--------
 1 | download.opensuse.org-non-oss       | Main Repository (NON-OSS)               | Yes     | (r ) Yes  | No      |   99     | yast2  | http://download.opensuse.org/distribution/leap/42.3/repo/non-oss/                     |        
 2 | download.opensuse.org-non-oss_1     | Update Repository (Non-Oss)             | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/42.3/non-oss/                                |        
 3 | download.opensuse.org-oss           | Main Repository (OSS)                   | Yes     | (r ) Yes  | No      |   99     | yast2  | http://download.opensuse.org/distribution/leap/42.3/repo/oss/                         |        
 4 | download.opensuse.org-oss_1         | Main Update Repository                  | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/42.3/oss                                     |        
 5 | http-download.opensuse.org-dab6f4b1 | home:lazka0:ql-stable                   | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/repositories/home:/lazka0:/ql-stable/openSUSE_Leap_42.3/ |        
 6 | http-opensuse-guide.org-6924181f    | libdvdcss repository                    | Yes     | (r ) Yes  | No      |   99     | rpm-md | http://opensuse-guide.org/repo/openSUSE_Leap_42.3/                                    |        
 7 | http-packman.inode.at-5ddfa412      | Packman Repository                      | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://packman.inode.at/suse/openSUSE_Leap_42.3/                                      |        
 8 | repo-debug                          | openSUSE-Leap-42.3-Debug                | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/debug/distribution/leap/42.3/repo/oss/                   |        
 9 | repo-debug-non-oss                  | openSUSE-Leap-42.3-Debug-Non-Oss        | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/debug/distribution/leap/42.3/repo/non-oss/               |        
10 | repo-debug-update                   | openSUSE-Leap-42.3-Update-Debug         | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/debug/update/leap/42.3/oss/                              |        
11 | repo-debug-update-non-oss           | openSUSE-Leap-42.3-Update-Debug-Non-Oss | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/debug/update/leap/42.3/non-oss/                          |        
12 | repo-source                         | openSUSE-Leap-42.3-Source               | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/source/distribution/leap/42.3/repo/oss/                  |        
13 | repo-source-non-oss                 | openSUSE-Leap-42.3-Source-Non-Oss       | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/source/distribution/leap/42.3/repo/non-oss/              |        


warning: 3-42.3 version is not supported. Using 3-42.2 versions dependencies to verify and install...
(snip)
warning: HPLIP-Installation: Auto installation is not supported for 3 distro  42.3 version

Where did you get that HPLIP version from? The OSS repo for openSUSE 42.3 currently has version 3.16.11-1.3

What is returned by the following?

zypper se -si hplip

My mistake - misinterpreted the output you posted. In future, please post all output within code tags (refer to the ‘#’ button in the forum editor), and best to post complete. If the output is lengthy, consider using https://paste.opensuse.org/ instead and post the link that it generates here.

My apologies for not being clearer, and thank you for the forum best practices. I’ve re-run hp-check and have pasted the full output here:

https://paste.opensuse.org/25825584

The error message in it that you cited perplexed me too, because I am running the HPLIP that I was given from the standard 42.3 repositories, and further it had been working fine until I broke it somehow. zypper se -si hplip says:


warren@puccini:~> zypper se -si hplip
Loading repository data...
Reading installed packages...

S  | Name        | Type    | Version     | Arch   | Repository           
---+-------------+---------+-------------+--------+----------------------
i+ | hplip       | package | 3.16.11-1.3 | x86_64 | Main Repository (OSS)
i+ | hplip-hpijs | package | 3.16.11-1.3 | x86_64 | Main Repository (OSS)
i+ | hplip-sane  | package | 3.16.11-1.3 | x86_64 | Main Repository (OSS)

That checks out as expected.

Let’s see if zypper thinks everything is consistent…

zypper ve

Everything looks good:

warren@puccini:~> sudo zypper ve
[sudo] password for root: 
Retrieving repository 'Packman Repository' metadata ......................[done]
Building repository 'Packman Repository' cache ...........................[done]
Loading repository data...
Reading installed packages...

Dependencies of all installed packages are satisfied.

Run the following as regular user

hp-doctor

Eventually, it will prompt you for an admin password. Once done, follow any prompts to begin Install missing/incompatible packages. This may fail, but I just want to see the list produced via this utility.

It might also be good to review /etc/cups/cupsd.conf for any unusual policies etc, although if it was working before I wouldn’t think there would be any changes.

You mentioned that scanning wasn’t working either. For your USB-connected device, can you please check the output of the following, as regular user…

scanimage -L
sane-find-scanner

If they fail, run them again as root.

Also, confirm the group membership of your user account

groups

hp-doctor run as user hung on “discovered scanner devices” and did not get to prompting me for the root password. Output is in the pastebin at https://paste.opensuse.org/18137821.

I don’t see anything obviously wrong in my cupsd.conf, though I’ll admit I’ve never configured it by hand and so there might be a problem there I don’t recognize. It is in the pastebin at https://paste.opensuse.org/685724.

scanimage -L as both user and root hung with no output.

sane-find-scanner as user did find my one scanner: found USB scanner (vendor=0x04a9 [Canon], product=0x2220 [CanoScan]) at libusb:002:002. The full output is in the pastebin at https://paste.opensuse.org/71566487.

I belong only to the group “users”:

warren@puccini:~> groups
users

Ok, you need to make the user a member of the ‘lp’ group for access to USB-connected scanners. The applicable rule in /etc/udev/rules.d/55-libsane.rules is

# Canon CanoScan LiDE25
ATTR{idVendor}=="04a9", ATTR{idProduct}=="2220", MODE="0664", GROUP="lp", ENV{libsane_matched}="yes"

I notice that you have

# Explicitly set the CUPS 'default' policy to be used by default:DefaultPolicy allowallforanybody

For reference, I have

<Policy allowallforanybody>
  JobPrivateAccess all
  JobPrivateValues none
  SubscriptionPrivateAccess all
  SubscriptionPrivateValues none
  <Limit Validate-Job Cancel-Jobs Cancel-My-Jobs Close-Job CUPS-Get-Document>
    Order deny,allow
    Allow from all
  </Limit>
  <Limit All>
    Order deny,allow
    Allow from all
  </Limit>
</Policy>
DefaultPolicy default

There is an openSUSE bug report describing similar behaviour with ‘DefaultPolicy allowallforanybody’, but I haven’t studied this in depth, and I don’t pretend to know why this impacted the user who submitted the bug report. You might try editing it using ‘DefaultPolicy default’, then restart CUPS

sudo systemctl restart cups

and check the CUPS behaviour again.

Eureka! Changing the policy in cupsd.conf from allowallforanybody to default and restarting CUPS brought my printer back to life. I had forgotten, but you reminded me, that I had seen that setting in YaST and changed it to allowallforanybody.

Likewise, adding my user to the lp group, then logging out and back in, brought my scanner to life.

Thank you! I appreciate your help.

Glad to have been of assistance! :slight_smile: