HP Setup crashes with ValueError

Bug #1048754 reported by Flavia Rainone
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
HPLIP
Fix Released
Undecided
Amarnath Chitumalla

Bug Description

At Fedora 17, when running hp-setup, I get the following error:
wifisetupdialog.py:272:showNetworkPage:ValueError: need more than 1 value to unpack

Traceback (most recent call last):
  File "/usr/share/hplip/ui4/wifisetupdialog.py", line 703, in NextButton_clicked
    self.showNetworkPage()
  File "/usr/share/hplip/ui4/wifisetupdialog.py", line 272, in showNetworkPage
    self.adaptor_id, self.adapterName, state, presence = self.wifiObj.setAdaptorPower(self.dev, adaptor_list )
ValueError: need more than 1 value to unpack

Local variables in innermost frame:
adaptor_list: [1, u'Wifi0', u'ActiveLink', u'PluggedIn']
self: <ui4.wifisetupdialog.WifiSetupDialog object at 0x2193320>

My prnter is an HP Officejet 6500 e709n, hpcups 3.12.9.

The problem occurs when I try to add the printer. Despite the error, the printer ended up being added after several attempts. Still, the error message is constantly showing up and the printer won't work via wifi.

The printer setup worked perfectly with older versions of hplip, before I downloaded this new version, that enforces me to add the printer first using the USB cable (before, I could add it without this extra step, right through the network, and it always worked).

Revision history for this message
Amarnath Chitumalla (amarnath-chitumalla) wrote :

Hi,

Can you please reboot system and run hp-setup/hp-wificonfig commands. Is it still reproducible?
If yes, please add debug print in following file in root mode.

$ gedit "/usr/share/hplip/ui4/wifisetupdialog.py"
--> @line no. 270 add "print adaptor_list " string
from:
         log.debug("Turning on wireless radio...")
         try:
to:
         log.debug("Turning on wireless radio...")
         print adaptor_list
         try:

--> run hp-wificonfig in debug mode
$ hp-wificonfig -g

send us the output.

To know more let me know whether you have installed hplip-3.12.9 using auto installer (i.e. sh hplip-3.12.9.run) or manual instructions (make, su -c "make install" etc).

Thanks & Regards,
Amarnath

Revision history for this message
Amarnath Chitumalla (amarnath-chitumalla) wrote :

Hi,

If problem persists, even after reboot, please follow below steps.

$ su -c "hp-uninstall"

Install as mentioned in @ http://hplipopensource.com/hplip-web/install/install/index.html

Thanks & Regards,
Amarnath

Revision history for this message
Matt White (mattw922) wrote :
Download full text (11.4 KiB)

I get the same error. Here's the output I get when I click "Next" on step 2 of 5:

hp-wificonfig[3828]: debug: hp:/usb/Deskjet_F4500_series?serial=CN08BC211X05H5: back_end:hp is_hp:True bus:usb model:Deskjet_F4500_series serial:CN08BC211X05H5 dev_file: host: zc: port:1
hp-wificonfig[3828]: debug: hp:/usb/Deskjet_F4500_series?serial=CN08BC211X05H5: back_end:hp is_hp:True bus:usb model:Deskjet_F4500_series serial:CN08BC211X05H5 dev_file: host: zc: port:1
hp-wificonfig[3828]: debug: Device URI: hp:/usb/Deskjet_F4500_series?serial=CN08BC211X05H5
hp-wificonfig[3828]: debug: Printer: None
hp-wificonfig[3828]: debug: Connecting to com.hplip.StatusService (try #1)...
hp-wificonfig[3828]: debug: hp:/usb/Deskjet_F4500_series?serial=CN08BC211X05H5: back_end:hp is_hp:True bus:usb model:Deskjet_F4500_series serial:CN08BC211X05H5 dev_file: host: zc: port:1
hp-wificonfig[3828]: debug: URI: backend=hp, is_hp=True, bus=usb, model=Deskjet_F4500_series, serial=CN08BC211X05H5, dev=, host=, port=1
hp-wificonfig[3828]: debug: Model/UI model: Deskjet_F4500_series/HP Deskjet f4500 Series
hp-wificonfig[3828]: debug: hp:/usb/Deskjet_F4500_series?serial=CN08BC211X05H5: back_end:hp is_hp:True bus:usb model:Deskjet_F4500_series serial:CN08BC211X05H5 dev_file: host: zc: port:1
hp-wificonfig[3828]: debug: Re-reading CUPS printer queue information.
hp-wificonfig[3828]: debug: Sending request on wifi config channel...
hp-wificonfig[3828]: debug: 0000: 3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e 3d 22 31 <?xml version="1
hp-wificonfig[3828]: debug: 0010: 2e 30 22 20 65 6e 63 6f 64 69 6e 67 3d 22 75 74 .0" encoding="ut
hp-wificonfig[3828]: debug: 0020: 66 2d 38 22 3f 3e 0a 3c 57 69 46 69 43 6f 6e 66 f-8"?>.<WiFiConf
hp-wificonfig[3828]: debug: 0030: 69 67 20 78 6d 6c 6e 73 3d 22 68 74 74 70 3a 2f ig xmlns="http:/
hp-wificonfig[3828]: debug: 0040: 2f 77 77 77 2e 68 70 2e 63 6f 6d 2f 73 63 68 65 /www.hp.com/sche
hp-wificonfig[3828]: debug: 0050: 6d 61 73 2f 69 6d 61 67 69 6e 67 2f 63 6e 63 2f mas/imaging/cnc/
hp-wificonfig[3828]: debug: 0060: 64 63 73 6c 2f 32 30 30 36 2f 30 35 2f 57 69 66 dcsl/2006/05/Wif
hp-wificonfig[3828]: debug: 0070: 69 43 6f 6e 66 69 67 22 3e 0a 3c 47 65 74 41 64 iConfig">.<GetAd
hp-wificonfig[3828]: debug: 0080: 61 70 74 6f 72 4c 69 73 74 52 65 71 75 65 73 74 aptorListRequest
hp-wificonfig[3828]: debug: 0090: 3e 0a 3c 2f 47 65 74 41 64 61 70 74 6f 72 4c 69 >.</GetAdaptorLi
hp-wificonfig[3828]: debug: 00a0: 73 74 52 65 71 75 65 73 74 3e 0a 3c 2f 57 69 46 stRequest>.</WiF
hp-wificonfig[3828]: debug: 00b0: 69 43 6f 6e 66 69 67 3e iConfig>
hp-wificonfig[3828]: debug: Opening device: hp:/usb/Deskjet_F4500_series?serial=CN08BC211X05H5 (not for printing)
hp-wificonfig[3828]: debug: I/O mode=3
hp-wificonfig[3828]: debug: device-id=1
hp-wificonfig[3828]: debug: Opened device: hp (backend=hp:/usb/Deskjet_F4500_series?serial=CN08BC211X05H5, is_hp=True, bus=usb, model=Deskjet_F4500_series, dev=, serial=CN08BC211X05H5, host=, port=1)
hp-wificonfig[3828]: debug: Opening HP-WIFICONFIG channel...
hp-wificonfig[3828]: debug: channel-id=43
hp-wificonfig[3828]: debug: Writing 184 bytes to channel 43 (device-id=1)...
hp-wificonfig[...

Revision history for this message
Gaurav Sood (gaurav-sood) wrote :

Please provide hp-check output

Revision history for this message
Tim Newman (timmenewman) wrote :

Getting same error as original poster in Linux Mint 13 with a Photosmart c309g-m.

File "/usr/share/hplip/ui4/wifisetupdialog.py", line 272, in showNetworkPage
    self.adaptor_id, self.adapterName, state, presence = self.wifiObj.setAdaptorPower(self.dev, adaptor_list )
ValueError: need more than 1 value to unpack

Revision history for this message
Amarnath Chitumalla (amarnath-chitumalla) wrote :

Hi Tim,

This issue happens, if system is not restarted after HPLIP is installed.
Please restart system and try to configure printer using wifi.

If problem still persists, then uninstall and re-install as follows
$ su -c "hp-uninstall"

Download HPLIP-3.12.9 and install as follows
$ sh hplip-3.12.9.run

Thanks & Regards,
Amarnath

Revision history for this message
Amarnath Chitumalla (amarnath-chitumalla) wrote :

HI Matt White,

Are you facing same even after "hp-uninstall" and new installation?

From Comment-3.txt log file, I can see below debug output
>>hp-wificonfig[3828]: debug: Turning on wireless radio...
>>[0, u'Wifi0', u'ActiveLink', u'PluggedIn']

Where as new code generates:-
>>hp-wificonfig[3828]: debug: Turning on wireless radio...
>>[[0, u'Wifi0', u'ActiveLink', u'PluggedIn']]

Can you please confirm whether following files are matching with new files or is there any mismatch?

$ diff attached_LedmWifi.py /usr/share/hplip/base/LedmWifi.py
or
$ diff attached_LedmWifi.py /usr/local/share/hplip/base/LedmWifi.py

if any difference is observed, please uninstall and re-install HPLIP.
if files are same, restart the system and try the functionality.

Thanks & Regards,
Amarnath

Revision history for this message
Tim Farrell (digitalfx) wrote :

I have the exact same problem with Slackware64 14. I've tried removing the prebuilt package and rebuilding the latest version with the slackbuild script but I get the same error.

Revision history for this message
Amarnath Chitumalla (amarnath-chitumalla) wrote :
Revision history for this message
Amarnath Chitumalla (amarnath-chitumalla) wrote :
Revision history for this message
Amarnath Chitumalla (amarnath-chitumalla) wrote :

Hi Tim,

On fresh installation, this issue should not happen and we are not able to reproduce here also.
Can you please confirm whether any difference the installation files by comparing attached (wifisetupdialog.py from comment #10, LedmWifi.py from Comment #9) as follows

----------------------------------------------------------------------
if "/usr/share/hplip/" folder exists:-
$ diff attached_files/LedmWifi.py /usr/share/hplip/base/LedmWifi.py
$ diff attached_files/wifisetupdialog.py /usr/share/hplip/ui4/wifisetupdialog.py

and if "/usr/local/share/hplip/" folder exists:-
$ diff attached_files/LedmWifi.py /usr/local/share/hplip/base/LedmWifi.py
$ diff attached_files/wifisetupdialog.py /usr/local/share/hplip/ui4/wifisetupdialog.py

--> if files are same, don't print anything on screen.
---------------------------------------------------------------------

Possibilities:-
1. if difference found in attached LedmWifi.py, wifisetupdialog.py and installed LedmWifi.py, wifisetupdialog.py files, please remove "/usr/local/share/hplip/" folders (if exists) and "/usr/local/share/hplip/" folder (if exists)
and install as mentioned in "http://hplipopensource.com/hplip-web/install/manual/distros/slackware.html"

2. if "/usr/local/share/hplip/" folder exists, this is not correct location of installation. Please remove "/usr/local/share/hplip/" folder and install as mentioned in "http://hplipopensource.com/hplip-web/install/manual/distros/slackware.html"

3. still problem happens, please attach here the "/usr/share/hplip/base/LedmWifi.py" and "/usr/share/hplip/ui4/wifisetupdialog.py" files

Thanks & Regards,
Amarnath

Changed in hplip:
status: New → In Progress
assignee: nobody → Amarnath Chitumalla (amarnath-chitumalla)
Revision history for this message
Tim Farrell (digitalfx) wrote :

Amarnath,

Both LedmWifi.py and wifisetupdialaog.py are the same as the attached files. Also, the /usr/local/share/hplip/ folder does not exist. If you like I can attach the two files, however like I said there is no difference.

Thanks,

Tim

Revision history for this message
Tim Farrell (digitalfx) wrote :

I tried to reinstall from source rather than use the official slackware package or slackbuild (and double checked the files again) and now I receive a slightly different error instead on step 2.

/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py:127: RuntimeWarning: PyOS_InputHook is not available for interactive use of PyGTK
  set_interactive(1)
Traceback (most recent call last):
  File "/usr/share/hplip/ui4/wifisetupdialog.py", line 703, in NextButton_clicked
    self.showNetworkPage()
  File "/usr/share/hplip/ui4/wifisetupdialog.py", line 272, in showNetworkPage
    self.adaptor_id, self.adapterName, state, presence = self.wifiObj.setAdaptorPower(self.dev, adaptor_list )
ValueError: need more than 1 value to unpack

Revision history for this message
Tim Farrell (digitalfx) wrote :

Sorry just realized I didn't run setup as root for that last post. Here is the error when running as root.

Searching on USB bus...
Traceback (most recent call last):
  File "/usr/share/hplip/ui4/wifisetupdialog.py", line 703, in NextButton_clicked
    self.showNetworkPage()
  File "/usr/share/hplip/ui4/wifisetupdialog.py", line 272, in showNetworkPage
    self.adaptor_id, self.adapterName, state, presence = self.wifiObj.setAdaptorPower(self.dev, adaptor_list )
ValueError: need more than 1 value to unpack

Revision history for this message
Amarnath Chitumalla (amarnath-chitumalla) wrote :

Hi Tim,

I added some more debug prints in code (i.e contains "TESTING_DATA"), can you please copy this file and provide me the data to analyse further.

Sorry for the Inconvenience.

Procedure:-
--> taking backup
 $ cp /usr/local/share/hplip/base/LedmWifi.py /usr/local/share/hplip/base/LedmWifi.py_org
 $ cp attached_LedmWifi.py /usr/local/share/hplip/base/LedmWifi.py

--> now run hp-setup
 $ hp-setup

Please provide the output data..

Thanks & Regards,
Amarnath

Revision history for this message
Tim Farrell (digitalfx) wrote :

Amarnath,

It's not a problem, thanks for looking into this.

The output appears to be the same.

Searching on USB bus...
Traceback (most recent call last):
  File "/usr/share/hplip/ui4/wifisetupdialog.py", line 703, in NextButton_clicked
    self.showNetworkPage()
  File "/usr/share/hplip/ui4/wifisetupdialog.py", line 272, in showNetworkPage
    self.adaptor_id, self.adapterName, state, presence = self.wifiObj.setAdaptorPower(self.dev, adaptor_list )
ValueError: need more than 1 value to unpack

Also, I did copy to /usr/share not /usr/local/share.

Thanks,

Tim

Revision history for this message
Amarnath Chitumalla (amarnath-chitumalla) wrote :

Hi Tim,

What I attached in comment #15 is not a patch. Just added some more debug prints in code (i.e contains "TESTING_DATA") to analyse further. Since this issue is not reproducible here.

Please follow the instructions:-

$ cp attached_LedmWifi.py /usr/share/hplip/base/LedmWifi.py
$ hp-setup &> hp_setup.log

attach here hp_setup.log

Note:- this hp_setup.log file contains info with "TESTING_DATA" keyword.. if it is not there, copy is not done properly. retry above steps again..

Thanks & Regards,
Amarnath

Revision history for this message
Tim Farrell (digitalfx) wrote :

Amarnath,

I verified the file is copied correctly but I am still not getting any TESTING_DATA output. I've attached the log file so that you can see what I'm talking about.

Thanks,

Tim

Revision history for this message
Amarnath Chitumalla (amarnath-chitumalla) wrote :

Hi Tim,

Please cross verify once whether "/usr/share/hplip/base/LedmWifi.py" file contains "TESTING_DATA" data. if not please copy again.

If "TESTING_DATA" is present, restart system and try.

Thanks & Regards,
Amarnath

Revision history for this message
Tim Farrell (digitalfx) wrote :

I double checked /usr/share/hplip/base/LedmWifi.py and confirmed that TESTING_DATA is in the file. I also rebooted my system. I'm still getting the same error with no TESTING_DATA output.

Revision history for this message
Jiri Popelka (jpopelka) wrote :

Hi, I see the same backtrace in https://bugzilla.redhat.com/show_bug.cgi?id=870641

Looking at the code I think the problem is not in base/LedmWifi.py but in base/wifi.py

The self.wifiObj.setAdaptorPower() can be either (depending on printer model)
base/LedmWifi.py:setAdaptorPower() or base/wifi.py:setAdaptorPower().

In 3.12.9 the LedmWifi.py:setAdaptorPower() was changed to return 4-tuple instead of dict.
But wifi.py:setAdaptorPower() was not changed and it still returns dict (empty or with one key), which leads to the above error.

See also
# python -c "a,b,c,d = {'x':1}"
ValueError: need more than 1 value to unpack

Revision history for this message
Amarnath Chitumalla (amarnath-chitumalla) wrote :

Hi Jiri Popelka,

Thank you for pointing out the problem.

Please find the following patch file.

$ sudo cp atached_wifi.py /usr/share/hplip/base/
or
$ su -c "cp atached_wifi.py /usr/share/hplip/base/"

--> Restart the system.

$ hp-setup

Thanks & Regards,
Amarnath

Changed in hplip:
status: In Progress → Fix Committed
Revision history for this message
Tim Farrell (digitalfx) wrote :

I can verify that this works. Thank you!

Changed in hplip:
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.