I recently upgraded a 18.04 release to 20.04 (early, I know), and wiped away my manually installed 'hplip' package (3.16.11) and installed the official package from the release (3.20.3+dgfsg0-2). All seemed to be well until I started getting messages to update my driver. Making sure I had nothing else to print today, I followed the instructions only to have the 'hp-plugin' command fail to download the plugin with the following backtrace...
Traceback (most recent call last):
File "/usr/share/hplip/ui5/plugindialog.py", line 248, in NextButton_clicked
status, download_plugin_file, error_str = self.pluginObj.download(self.plugin_path,self.plugin_download_callback)
File "/usr/share/hplip/installer/pluginhandler.py", line 254, in download
core = core_install.CoreInstall()
File "/usr/share/hplip/installer/core_install.py", line 239, in __init__
self.passwordObj = password.Password(ui_mode)
File "/usr/share/hplip/base/password.py", line 88, in __init__
self.__readAuthType() # self.__authType
File "/usr/share/hplip/base/password.py", line 110, in __readAuthType
distro_name = get_distro_name().lower()
File "/usr/share/hplip/base/password.py", line 78, in get_distro_name
return distro.linux_distribution(full_distribution_name=False)[0]
File "/usr/lib/python3/dist-packages/distro.py", line 122, in linux_distribution
return _distro.linux_distribution(full_distribution_name)
File "/usr/lib/python3/dist-packages/distro.py", line 677, in linux_distribution
self.version(),
File "/usr/lib/python3/dist-packages/distro.py", line 737, in version
self.lsb_release_attr('release'),
File "/usr/lib/python3/dist-packages/distro.py", line 899, in lsb_release_attr
return self._lsb_release_info.get(attribute, '')
File "/usr/lib/python3/dist-packages/distro.py", line 552, in __get__
ret = obj.__dict__[self._fname] = self._f(obj)
File "/usr/lib/python3/dist-packages/distro.py", line 1012, in _lsb_release_info
stdout = subprocess.check_output(cmd, stderr=devnull)
File "/usr/lib/python3.8/subprocess.py", line 411, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/lib/python3.8/subprocess.py", line 512, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '('lsb_release', '-a')' returned non-zero exit status 1.
Downloading the plugin program manually and trying to install it that way yielded the same result. What's going on here? It doesn't appear that the lsb_release module is missing, and running /usr/bin/lsb_release -a
works fine and doesn't return any errors.
$ apt-cache policy hplip-gui
hplip-gui:
Installed: 3.20.3+dfsg0-2
Candidate: 3.20.3+dfsg0-2
Version table:
*** 3.20.3+dfsg0-2 500
500 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu focal/universe i386 Packages
100 /var/lib/dpkg/status
$ dpkg -l | grep -i hplip
ii hplip 3.20.3+dfsg0-2 amd64 HP Linux Printing and Imaging System (HPLIP)
ii hplip-data 3.20.3+dfsg0-2 all HP Linux Printing and Imaging - data files
ii hplip-doc 3.20.3+dfsg0-2 all HP Linux Printing and Imaging - documentation
ii hplip-gui 3.20.3+dfsg0-2 all HP Linux Printing and Imaging - GUI utilities (Qt-based)
Running the hp-plugin command from the command line prints the stack twice, and the first iteration has a few more complaints...
File "/usr/lib/python3.8/subprocess.py", line 512, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '('lsb_release', '-a')' returned non-zero exit status 1.
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 144, in apport_excepthook
with os.fdopen(os.open(pr_filename,
PermissionError: [Errno 13] Permission denied: '/var/crash/_usr_share_hplip_plugin.py.1000.crash'
I have no problem writing files as a regular user in /var/crash, so I'm not sure where the problem is here.
I'd mentioned that running lsb_release -a
worked fine from the command line, but neglected to provide the output of that...
$ lsb_release -a
LSB Version: core-11.1.0ubuntu2-noarch:printing-11.1.0ubuntu2-noarch:security-11.1.0ubuntu2-noarch
Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: focal
$ echo $?
0
Running hp-plugin -i -g
seems to indicate that the real problem is on hp's side...
hp-plugin[310176]: debug: /usr/bin/wget --cache=off --tries=3 --timeout=60 --output-document=- http://www.hp.com --spider -S
hp-plugin[310176]: debug: Spider mode enabled. Check if remote file exists.
--2020-05-31 09:36:45-- http://www.hp.com/
Resolving www.hp.com (www.hp.com)... 15.73.200.23, 15.73.200.22
Connecting to www.hp.com (www.hp.com)|15.73.200.23|:80... connected.
HTTP request sent, awaiting response...
HTTP/1.1 301 Moved Permanently
Server: Apache
X-Frame-Options: SAMEORIGIN
Cache-Control: no-store, no-cache, must-revalidate, max-age=0, max-age=7200
Location: http://www-redirect.ext.hp.com
Expires: Sun, 31 May 2020 15:36:45 GMT
Vary: Accept-Encoding
Content-Type: text/html; charset=iso-8859-1
Accept-Ranges: bytes
Date: Sun, 31 May 2020 13:36:45 GMT
X-Varnish: 1131355252
Age: 0
Via: 1.1 varnish
Connection: keep-alive
X-Varnish-Origin: g2t3073.austin.hp.com
X-Cache: MISS
Location: http://www-redirect.ext.hp.com [following]
Spider mode enabled. Check if remote file exists.
--2020-05-31 09:36:45-- http://www-redirect.ext.hp.com/
Resolving www-redirect.ext.hp.com (www-redirect.ext.hp.com)... 96.7.23.193
Connecting to www-redirect.ext.hp.com (www-redirect.ext.hp.com)|96.7.23.193|:80... connected.
HTTP request sent, awaiting response...
HTTP/1.1 301 Moved Permanently
Server: AkamaiGHost
Content-Length: 0
Location: https://www8.hp.com/us/en/home.html
Cache-Control: max-age=0
Expires: Sun, 31 May 2020 13:36:45 GMT
Date: Sun, 31 May 2020 13:36:45 GMT
Connection: keep-alive
Location: https://www8.hp.com/us/en/home.html [following]
Spider mode enabled. Check if remote file exists.
--2020-05-31 09:36:45-- https://www8.hp.com/us/en/home.html
Resolving www8.hp.com (www8.hp.com)... 184.24.150.205
Connecting to www8.hp.com (www8.hp.com)|184.24.150.205|:443... connected.
HTTP request sent, awaiting response...
HTTP/1.1 200 OK
Server: Apache
Last-Modified: Sun, 31 May 2020 13:01:01 GMT
Access-Control-Allow-Headers: Access-Control-Allow-Origin, Origin, X-Requested-With, Content-Type, Accept
Access-Control-Allow-Methods: GET, OPTIONS, POST, PUT, DELETE
Access-Control-Allow-Origin: *
X-Powered-By: Servlet/2.5 JSP/2.1
Access-Control-Max-Age: 3600
X-Frame-Options: SAMEORIGIN
Content-Type: text/html; charset=UTF-8
Cache-Control: max-age=1448
Expires: Sun, 31 May 2020 14:00:53 GMT
Date: Sun, 31 May 2020 13:36:45 GMT
Connection: keep-alive
Vary: Accept-Encoding
Length: unspecified [text/html]
Remote file exists and could contain further links,
but recursion is disabled -- not retrieving.
hp-plugin[310176]: debug: wget returned: 0
[...] rest of error was the same.
But then I downloaded the file manually and got this...
-----------------------------------------
| PLUG-IN INSTALLATION FOR HPLIP 3.20.3 |
-----------------------------------------
Option Description
---------- --------------------------------------------------
d Download plug-in from HP (recommended)
p Specify a path to the plug-in (advanced)
q Quit hp-plugin (skip installation)
Enter option (d=download*, p=specify path, q=quit) ? p
Enter the path to the 'hplip-3.20.3-plugin.run' file (q=quit) : hplip-3.20.3-plugin.run
---------------
| COPY PLUGIN |
---------------
Downloading plug-in from: file:///home/users/jason/Downloads/hplip-3.20.3-plugin.run
Downloading plug-in: [\ ] 0% Traceback (most recent call last):
[...] rest of error the same.
That's the correct path, too.
UPDATE: I managed to get this to work, but this isn't really an "answer" or even really a "solution". I figured I'd see if the python debugger would tell me anything new so I ran hp-plugin
from that, with the command pdb3 /usr/share/hplip/plugin.py -i -g
, and, uh, it just plain worked. It still doesn't work without the debugger, but at least I was able to get my printer working again. I still cannot tell you what's wrong (and there's still something wrong here), but maybe more data will help.