hp-plugin cannot download the HPLIP plugin via proxy

Bug #573971 reported by Kirikaza
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
HPLIP
Invalid
Undecided
Unassigned
Gentoo Linux
Fix Released
Medium

Bug Description

<code>
Checking for network connection...
Downloading configuration file from: http://hplip.sf.net/plugin.conf
Downloading configuration: [\
                                                       ] 0%
error: I/O Error: invalid proxy for http
Traceback (most recent call last):
  File "/usr/bin/hp-plugin", line 320, in <module>
    plugin_download_callback)
  File "/usr/share/hplip/installer/core_install.py", line 1875, in
get_plugin_info
    os.remove(local_conf)
OSError: [Errno 2] No such file or directory: '/tmp/tmpfh3FTb'
</code>

And it does not break! I think it should break if DL fails.

If I unset HTTP_PROXY it downloads the plugin well. And I can download the plugin manually via the proxy.

Tags: hp-setup proxy
Revision history for this message
In , Betelgeuse-t (betelgeuse-t) wrote :
Download full text (7.0 KiB)

-----------------------------------------
| PLUG-IN INSTALLATION FOR HPLIP 3.9.4b |
-----------------------------------------

  Option Description
  ---------- --------------------------------------------------
  d Download plug-in from HP (recomended)
  p Specify a path to the plug-in (advanced)
  q Quit hp-plugin (skip installation)

Enter option (d=download*, p=specify path, q=quit) ?

--------------------------
| DOWNLOAD CONFIGURATION |
--------------------------

Checking for network connection...
Downloading configuration file from: http://hplip.sf.net/plugin.conf
Downloading configuration: [***********************************************************************************************************************************************************************] 100% 8.0 KB

-------------------
| DOWNLOAD PLUGIN |
-------------------

Checking for network connection...
Downloading plug-in from: http://www.linuxprinting.org/download/printdriver/auxfiles/HP/plugins/hplip-3.9.4b-plugin.run
Downloading plug-in: [*****************************************************************************************************************************************************************************] 100% 8.0 KB Receiving digital keys: /usr/bin/gpg --no-permission-warning --keyserver pgp.mit.edu --recv-keys 0x9013c005

----------------------
| INSTALLING PLUG-IN |
----------------------

Verifying archive integrity... All good.
Uncompressing HPLIP 3.9.4b Plugin Self Extracting Archive................................

HP Linux Imaging and Printing System (ver. 3.9.4b)
Plugin Installer ver. 3.0

Copyright (c) 2001-9 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

Self-installs the HPLIP plugin.

Usage: hplip-plugin-install [OPTIONS]

[OPTIONS]
  Set the logging level: -l<level> or --logging=<level>
                                                                    <level>: none, info*, error, warn, debug (*default)
  Run in debug mode: -g (same as option: -ldebug)
  This help information: -h or --help

error: option -i not recognized

------------------------
| DOWNLOADING FIRMWARE |
------------------------

Downloading firmware to device hp:/usb/HP_LaserJet_P1005?serial=BC123L9...
error: Firmware file '/usr/share/hplip/data/firmware/hp_laserjet_p1005.fw.gz' not found.

Done.

---------------------
| PRINT QUEUE SETUP |
---------------------

warning: One or more print queues already exist for this device: LPUSB.

Would you like to install another print queue for this device (y=yes, n=no*, q=quit) ?

Done.
Portage 2.2_rc33 (default/linux/x86/2008.0/desktop, gcc-4.3.3, glibc-2.10.1-r0, 2.6.30-rc6 i686)
=================================================================
System uname: Linux-2.6.30-rc6-i686-Intel-R-_Core-TM-_i7_CPU_920_@_2.67GHz-with...

Read more...

Revision history for this message
In , Leio-gentoo (leio-gentoo) wrote :

Same problem here. I suspect the hplip-3.9.4b-plugin.run has changed, to lose the -i option, or it was not tested during the bump and the newer version has changed.

Revision history for this message
In , Pacho-gentoo (pacho-gentoo) wrote :
Revision history for this message
In , Billie-gentoo (billie-gentoo) wrote :

Does the solution from the upstream bug work?

Revision history for this message
In , 0-iascha-7 (0-iascha-7) wrote :

(In reply to comment #3)
> Does the solution from the upstream bug work?
>

yes it works fine

Revision history for this message
In , Billie-gentoo (billie-gentoo) wrote :

Can anybody try this with hplip-3.9.10. Running "hp-plugin -i" works fine here, but I can not check with hp-setup because my printer does not require a plugin.

Revision history for this message
In , Cruz Enrique Borges (cruzki123) wrote :

Whith 3.9.12 did not work.

Making the change sugested in the upstream AND instaling pygobject (as sugested by this thread https://answers.launchpad.net/hplip/+question/68660)
I can finally install my printer.

Revision history for this message
In , Billie-gentoo (billie-gentoo) wrote :

(In reply to comment #6)
> Whith 3.9.12 did not work.
>
> Making the change sugested in the upstream AND instaling pygobject (as sugested
> by this thread https://answers.launchpad.net/hplip/+question/68660)
> I can finally install my printer.
>

The link you posted above seems unrelated to our problem here. The launchpad question is about missing dependencies which should be installed when installing hplip.

From Petteri's output there must be a problem after hp-setup is trying to run the the downloaded run script.

From hp-setup it is called with: "sh hplip-3.9.12-plugin.run -- -i" or "-u" depending on how hp-setup is called.

When I run this command the plugin installs successfully. I tested with the -u and with the -i switch. As mentioned above I can not run it from hp-setup as this part is only executed if the printer in question needs a plugin.

Please can anybody experiencing this problem run "sh hplip-3.9.12-plugin.run -- -ig". This should give extra debug output.

Revision history for this message
In , Cruz Enrique Borges (cruzki123) wrote :

I misscopy the link. The correct one was:

https://bugs.launchpad.net/hplip/+bug/399522

But after doing this I hit the problem that the other link said.

Revision history for this message
In , Billie-gentoo (billie-gentoo) wrote :

(In reply to comment #8)
> I misscopy the link. The correct one was:
>
> https://bugs.launchpad.net/hplip/+bug/399522
>
> But after doing this I hit the problem that the other link said.
>

I guess you have the qt4 use flag disabled for hplip as enabling it pulls in
the required dependencies. Probably the python dbus bindings and pygobject are
also needed when using the non gui mode but this would be another issue.

Can you please download the plugin from
http://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/ and run
the command I mentioned above.

Revision history for this message
In , Cruz Enrique Borges (cruzki123) wrote :

I forgot to said that after intaling pygobject I can finally run hp-plugin and the command you provide.

And I haven't enable de qt4 flag, so I think this would be the problem.

Thanks for the help ;)

Revision history for this message
In , A0401241 (a0401241) wrote :

*** Bug 309013 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Billie-gentoo (billie-gentoo) wrote :

+*hplip-3.10.2-r1 (20 Mar 2010)
+
+ 20 Mar 2010; Daniel Pielmeier <email address hidden>
+ -files/hplip-3.9.4+glibc-2.10.patch, +hplip-3.10.2-r1.ebuild,
+ +files/hplip-3.10.2-plugin.patch:
+ Revision bump. Update ebuild to use newer python eclass related functions.
+ Add a patch which fixes plugin installation from bug #274538. Remove
+ unused patch.

Please test if this version fixes the plugin installation.

Revision history for this message
Kirikaza (kirikaza) wrote :

The version of HPLIP is 3.10.2

Kirikaza (kirikaza)
summary: - hp-setup cannot download the HPLIP plugin via proxy
+ hp-plugin cannot download the HPLIP plugin via proxy
Revision history for this message
Kirikaza (kirikaza) wrote :

hp-plugin[2700]: debug: Plugin.conf url: http://hplip.sf.net/plugin.conf

--------------------------
| DOWNLOAD CONFIGURATION |
--------------------------
Checking for network connection...
hp-plugin[2700]: debug: /usr/bin/wget --timeout=10 --output-document=- http://www.google.com
hp-plugin[2700]: debug: --2010-05-03 23:49:28-- http://www.google.com/
Распознаётся localhost... ::1, 127.0.0.1
Устанавливается соединение с localhost|::1|:3128... сбой: В соединении отказано.
Устанавливается соединение с localhost|127.0.0.1|:3128... соединение установлено.
Запрос Proxy послан, ожидается ответ... 302 Moved Temporarily
Адрес: http://www.google.ru/ [переход]
--2010-05-03 23:49:28-- http://www.google.ru/
Устанавливается соединение с localhost|127.0.0.1|:3128... соединение установлено.
Запрос Proxy послан, ожидается ответ... 200 OK
Длина: нет информации [text/html]
Saving to: «STDOUT»
<!doctype html><html> .... skipped .... </html>
 2010-05-03 23:49:29 (74,7 KB/s) - written to stdout [7474]

YES

hp-plugin[2700]: debug: wget returned: 0
Downloading configuration file from: http://hplip.sf.net/plugin.conf
Downloading configuration: [\ ] 0% error: I/O Er
ror: invalid proxy for http
Traceback (most recent call last):
  File "/usr/bin/hp-plugin", line 320, in <module>
    plugin_download_callback)
  File "/usr/share/hplip/installer/core_install.py", line 1875, in get_plugin_info
    os.remove(local_conf)
OSError: [Errno 2] No such file or directory: '/tmp/tmp_mui0I'

Revision history for this message
In , Billie-gentoo (billie-gentoo) wrote :

*** Bug 316777 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Billie-gentoo (billie-gentoo) wrote :

+ 04 May 2010; Daniel Pielmeier <email address hidden>
+ files/hplip-3.10.2-plugin.patch:
+ Another try to fix plugin installation. This should fix bug #274538 and
+ #316777.

Apparently the upstream patch did not fix the problem so I replaced it with a new one. See also bug #316777. The user confirmed that the issue is fixed with the new patch, so I will close this for now. If there are still issues please reopen.

Revision history for this message
Naga Samrat Chowdary, Narla (samrat-hplip) wrote :

Can you please try wget www.google.co.in?
This is an issue in Ubuntu Lucid, wget is not working as normal user.
https://bugs.launchpad.net/bugs/525628

Please run "hp-plugin" as root user.

Thanks!
Naga Samrat Chowdary, Narla

Revision history for this message
Kirikaza (kirikaza) wrote :

My system is not Ubuntu but Gentoo. All the commands above have been executed as root user (directly, without sudo).

Changed in gentoo:
status: Unknown → Invalid
Revision history for this message
Naga Samrat Chowdary, Narla (samrat-hplip) wrote :

Please run "hp-plugin -g" as root and post the output.

Thanks!
Naga Samrat Chwodary, Narla

Revision history for this message
Kirikaza (kirikaza) wrote :

> Please run "hp-plugin -g" as root and post the output
You can find it in comment #2

Revision history for this message
Kirikaza (kirikaza) wrote :

Oh, I'm sorry =) It was in Russian! I'll post the log with English locale

Revision history for this message
Kirikaza (kirikaza) wrote :
Revision history for this message
Naga Samrat Chowdary, Narla (samrat-hplip) wrote :

I guess, if http_proxy is unset then "all_proxy" may be in use.
Is both http_proxy and all_proxy values are same?
if not can you try by setting all_proxy value to http_proxy.

hp-plugin intern use wget to download plugin file.
in this case, this issue is nothing to do with HPLIP.

Thanks!
Naga Samrat Chowdary, Narla

Revision history for this message
Kirikaza (kirikaza) wrote :

% env | grep -i proxy
http_proxy=localhost:3128
https_proxy=localhost:3128
HTTPS_PROXY=localhost:3128
HTTP_PROXY=localhost:3128

If I use wget to download http://hplip.sf.net/plugin.conf it does. Via my proxy.

When hp-plugin uses wget to retrieve google.com it works well. But when hp-plugin tries to retrieve plugin.conf downloading fails. You can see the code in core_install.py:
filename, headers = urllib.urlretrieve(plugin_conf_url, local_conf, callback)

So hp-plugin uses not wget but urllib for that.

Revision history for this message
Naga Samrat Chowdary, Narla (samrat-hplip) wrote :

can you please try by following lines:

import urllib2
  tmp_sock = urllib2.urlopen(plugin_conf_url)
  tmp_file = open(local_conf, 'w')
  tmp_file.write(tmp_sock.read())
  tmp_file.close()

Thanks!
Naga Samrat Chowdary, Narla

Changed in gentoo:
status: Invalid → Fix Released
Revision history for this message
Kirikaza (kirikaza) wrote :

I'm sorry for silence! I was writing and defending my master thesis.

I do not understand where I should put these lines? I tried to replace the problem line with them but something was wrong

Revision history for this message
In , marathon (junk4me46806) wrote :

(In reply to comment #14)
> + 04 May 2010; Daniel Pielmeier <email address hidden>
> + files/hplip-3.10.2-plugin.patch:
> + Another try to fix plugin installation. This should fix bug #274538 and
> + #316777.
>
> Apparently the upstream patch did not fix the problem so I replaced it with a
> new one. See also bug #316777. The user confirmed that the issue is fixed with
> the new patch, so I will close this for now. If there are still issues please
> reopen.
>

I just had the same problem with 3.10.6. It appears the plugin patch was dropped between the 3.10.5 and 3.10.6 ebuilds. I applied a similar patch (solved the issue on my own before I found this bug) and it fixed the issue.

Revision history for this message
In , Billie-gentoo (billie-gentoo) wrote :

(In reply to comment #15)
> I just had the same problem with 3.10.6. It appears the plugin patch was
> dropped between the 3.10.5 and 3.10.6 ebuilds. I applied a similar patch
> (solved the issue on my own before I found this bug) and it fixed the issue.
>

The patch was dropped intentionally as upstream added a fix for this problem. They did not apply the patch [1] I provided in [2] but this [3] one instead.

This is also why you experience bug #331163.

[1] http://launchpadlibrarian.net/47809379/hplip-3.10.2-plugin.patch
[2] https://bugs.launchpad.net/hplip/+bug/399522
[3] http://launchpadlibrarian.net/49192341/core_install.patch

Revision history for this message
In , marathon (junk4me46806) wrote :

I ran some tests that are documented in Bug 331163 Comment 2 [1] that shows that my system does not work with the new patch (Listed as [3] above).
  [1] http://bugs.gentoo.org/show_bug.cgi?id=331163#c2
  [3] http://launchpadlibrarian.net/49192341/core_install.patch

I think that part of the problem is that I don't have the qt4 use flag enabled. The documentation states that -u is for gui (normal default) and -i is for interactive. If I run hp-setup -i, it gives an error indicating an unrecognized option. Running hp-setup with no arguments works and run in interactive mode. This is also true of hp-plugin. To me, the correct solution is to find out why -i is not accepted when USE=-qt4 and fix that (then the old patch is not needed). The error message from hp-setup -i is attached. The funny part is that the error message shows usage info for -i and even includes examples of using -i and then complains that -i is invalid.

Here are my use flags for hplip:
qwerty ~ $ emerge -pv =net-print/hplip-3.10.6

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild UD] net-print/hplip-3.10.6 [3.10.6-r1] USE="X hpcups libnotify
scanner -doc -fax -hpijs -minimal -parport -policykit -qt4 -snmp -static-ppds
-udev-acl" 0 kB [1=>0]

Total: 1 package (1 downgrade), Size of downloads: 0 kB
Portage tree and overlays:
 [0] /usr/portage
 [1] /usr/local/overlay/

Note that I currently have a version my a local overlay installed that requires
dbus-python and applies the "old" patch (I want printing to work while this bug
is being processed). I had the portage version installed when I ran the tests in bug 331163.

Revision history for this message
In , marathon (junk4me46806) wrote :

Created attachment 241515
Error message of hp-setup -i with USE=-qt4

Revision history for this message
In , Billie-gentoo (billie-gentoo) wrote :

(In reply to comment #17)
> I think that part of the problem is that I don't have the qt4 use flag enabled.
> The documentation states that -u is for gui (normal default) and -i is for
> interactive. If I run hp-setup -i, it gives an error indicating an
> unrecognized option. Running hp-setup with no arguments works and run in
> interactive mode. This is also true of hp-plugin. To me, the correct solution
> is to find out why -i is not accepted when USE=-qt4 and fix that (then the old
> patch is not needed). The error message from hp-setup -i is attached. The
> funny part is that the error message shows usage info for -i and even includes
> examples of using -i and then complains that -i is invalid.

If you build hplip without GUI (USE="-qt4") there is no -i or -u flag available because only interactive mode is possible. The confusing thing is that hp-setup lists the options as available.

Revision history for this message
Naga Samrat Chowdary, Narla (samrat-hplip) wrote :

Attachment in comment #8 is showing, there is an error while retrieving data over http_proxy.
Please post the output of "echo $http_proxy"

if it is not set, please set this and try again.

Thanks,
Naga Samrat Chowdary, Narla

Revision history for this message
Kirikaza (kirikaza) wrote :

> if it is not set, please set this and try again
I tried with version 3.10.5 -- nothing changes.

It seems to be an bug in Python's urllib. I tried to download OpenOffice by using their download-go-oo.py and it failed with the same error:
Traceback (most recent call last):
  File "./download-go-oo.py", line 111, in <module>
    for line in urllib.urlopen(source).readlines():
  File "/usr/lib/python2.6/urllib.py", line 86, in urlopen
    return opener.open(url)
  File "/usr/lib/python2.6/urllib.py", line 200, in open
    return self.open_unknown_proxy(proxy, fullurl, data)
  File "/usr/lib/python2.6/urllib.py", line 219, in open_unknown_proxy
    raise IOError, ('url error', 'invalid proxy for %s' % type, proxy)

So it is not your trouble.

Revision history for this message
Kirikaza (kirikaza) wrote :

As you can see in urllib documentation (http://docs.python.org/library/urllib.html) this behaviour is not a bug. urllib requires a longer format for proxy definition: "http://host:port" not just "host:port". So if I try `http_proxy=http://$http_proxy x.py` it works. But there is a small trick: urllib reads HTTP_PROXY firstly and only if it is empty urllib read http_proxy. Documentation say nothing about it and I will disturb python developers.

So I think *this* bug can be closed.

Revision history for this message
Naga Samrat Chowdary, Narla (samrat-hplip) wrote :

Thanks for reporting with us and for your update.
i will try to accomodate some code to check weather http_proxy value is available in format (http://host:port) or not.

Thanks,
Naga Samrat Chowdary, Narla

Changed in hplip:
status: New → Invalid
Changed in gentoo:
importance: Unknown → Medium
Revision history for this message
In , Joshuas-spam1 (joshuas-spam1) wrote :

Created attachment 292713
fix for hplip problem

Revision history for this message
In , Joshuas-spam1 (joshuas-spam1) wrote :

It seems post #8 at the following site has a working patch for this problem:

https://bugs.launchpad.net/hplip/+bug/399522

From the post:

Here is a patch that seems to fix this bug. It works on my machine.

The issue, as I understand it is:
   A) Python scripts pass -i to other python scripts when running in interactive mode.
   B) When built without the gt4 gui_build option, -i is not a valid option.

The previous patch from comment #4 attempted to fix issue part A. This patch was rejected because it affected the behavior when built with gui_build (hp-setup -i will still launch the gui because hp-plugin is called with no arguments and its default is to launch the gui.).

The patch from comment #6 did not affect code execution, but instead printed a message to the user to install python dbus and python gobject. The patch operated under the assumption that installing these packages would fix the issue. I have both of these packages installed (gentoo packages dev-python/dbus-python-0.83.0-r1 and dev-python/pygobject-2.20.0) and am still seeing this bug. Comment #7 reiterates this point.

The attached patch address issue part B, which I believe is the correct place to fix this bug. The attached patch always allows the -i option as long as interactive mode is available. Without this patch, if interactive mode was the only version, -i would receive an error even though the program could run in interactive mode just fine (in fact that is what the user desires). This patch has the advantage of not changing the current behavior of the code. When built with gui_build, this patch will have no effect since -i was already accepted in that case. When built without gui_build, this patch will fix this bug and allow proper execution.

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.