Wake-on-LAN doesn't work on 64-bit hosts

Bug #1341278 reported by Fotis Tsamis
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Epoptes
Fix Released
Medium
Fotis Tsamis

Bug Description

Hello

WoL in epoptes doesn't work for RTL8169. If I open a terminal and type "wakeonlan XX:XX:XX:XX:XX" the client starts normally but I cant start it from the epoptes sw pressing the Wake ON Lan Button.

$ sudo python /usr/share/pyshared/epoptes/core/wol.py C4:54:44:52:46:34

Sending magic packet to C45444524634
Traceback (most recent call last):
  File "/usr/share/pyshared/epoptes/core/wol.py", line 122, in <module>
    wake_on_lan(mac)
  File "/usr/share/pyshared/epoptes/core/wol.py", line 117, in wake_on_lan
    for br in getBroadcastList():
  File "/usr/share/pyshared/epoptes/core/wol.py", line 89, in getBroadcastList
    brlist.append(getBroadcast(ifname))
  File "/usr/share/pyshared/epoptes/core/wol.py", line 82, in getBroadcast
    return socket.inet_ntoa(result[20:24])
TypeError: 'NoneType' object has no attribute '__getitem__'

Related branches

Revision history for this message
CoudCoud (coudertmatthieu) wrote :

I'm also affected by this bug.
The IRC #ltsp chan at freenode told me to fill a bug report.
My server runs a Ubuntu Gnome 14.04 64bits, using Epoptes 0.5.7
I got the same error trying the wol.py script.

They told me to type the wol.py command, and another ip command : http://pastebin.com/RyPNbGwy

I can provide any information you ask.

Fotis Tsamis (ftsamis)
Changed in epoptes:
assignee: nobody → Fotis Tsamis (phantomas)
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
CoudCoud (coudertmatthieu) wrote :

I've been watching /usr/share/pyshared/epoptes/core/wol.py in my buntu gnome 14.04 64.
I think the problem comes from the function getInterfaceList() : it returns ['lo', '', ''] but it should return something like ['lo', 'eth0', ''].
I don't know which config file is parsed by this function, but if it's /etc/network/interfaces, I know that eth0 isn't defined in this file any more in Ubuntu.

Fotis Tsamis (ftsamis)
summary: - Wake-on-LAN doesn't work for some NICs
+ Wake-on-LAN doesn't work in 64-bit hosts
Revision history for this message
Fotis Tsamis (ftsamis) wrote : Re: Wake-on-LAN doesn't work in 64-bit hosts

After some digging it seems that this bug affects only 64-bit systems.
The size of "struct ifconf" is 32 bytes in 32-bit systems, but 40 bytes on 64-bit systems.

We'll commit a fix shortly.

Thanks for your provided information.

Changed in epoptes:
status: Confirmed → In Progress
summary: - Wake-on-LAN doesn't work in 64-bit hosts
+ Wake-on-LAN doesn't work on 64-bit hosts
Revision history for this message
Fotis Tsamis (ftsamis) wrote :

Epoptes is now using python-netifaces to detect the interfaces' broadcast addresses. The problem should be fixed.
If you are willing to test, just replace /usr/lib/python2.7/dist-packages/epoptes/core/wol.py with the one found here http://bazaar.launchpad.net/~epoptes/epoptes/trunk/view/head:/epoptes/core/wol.py

Thank you

Changed in epoptes:
status: In Progress → Fix Committed
Revision history for this message
Yannis Tsop (ogiannhs) wrote :

When using python-netifaces, there should be a dependency on: python-netifaces

for those who want to try the new version they should run:
sudo apt-get install python-netifaces

Revision history for this message
Yannis Tsop (ogiannhs) wrote :

When running patched epoptes I get error message:

Sending magic packet to 00XXXXXXXX0C
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/epoptes/ui/gui.py", line 220, in wake_on_lan
    wol.wake_on_lan(client.mac)
  File "/usr/lib/python2.7/dist-packages/epoptes/core/wol.py", line 66, in wake_on_lan
    for br in getBroadcastList():
  File "/usr/lib/python2.7/dist-packages/epoptes/core/wol.py", line 33, in getBroadcastList
    for ifname in netifaces.interfaces:
TypeError: 'builtin_function_or_method' object is not iterable

Revision history for this message
Yannis Tsop (ogiannhs) wrote :

the patch

Revision history for this message
Fotis Tsamis (ftsamis) wrote :

Just pushed the patch. Thanks for testing Yannis!

Revision history for this message
X-Dimension (x-dimension) wrote :

I have also problems with Edubuntu 14.04 on 32Bit systems:

Sending magic packet to xxxxxxxxxxxx
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/epoptes/core/wol.py", line 71, in <module>
    wake_on_lan(mac)
  File "/usr/lib/python2.7/dist-packages/epoptes/core/wol.py", line 66, in wake_on_lan
    for br in getBroadcastList():
  File "/usr/lib/python2.7/dist-packages/epoptes/core/wol.py", line 35, in getBroadcastList
    for addr in netifaces.ifaddresses(ifname)[netifaces.AF_INET]:
KeyError: 2

I've tested it with the latest Epoptes version from Edubuntu and also with the version from "ppa:epoptes/proposed".

Revision history for this message
Fotis Tsamis (ftsamis) wrote :

X-Dimension, that is a separate bug that probably occurs when you have an interface with no ipv4 configured. It should be fixed in trunk revision 448. Could you test it and confirm?

Revision history for this message
X-Dimension (x-dimension) wrote :

Sorry for the late answer.

Wake on LAN still don't work for me on Ubuntu 14.04.3 i386 with Epoptes 0.5.8-1 from Epoptes stable PPA.

When i run the wol.py script from a terminal i get:

$python /usr/lib/python2.7/dist-packages/epoptes/core/wol.py 00:xx:xx:xx:xx:xx
Sending magic packet to 00xxxxxxxxxx
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/epoptes/core/wol.py", line 71, in <module>
    wake_on_lan(mac)
  File "/usr/lib/python2.7/dist-packages/epoptes/core/wol.py", line 66, in wake_on_lan
    for br in getBroadcastList():
  File "/usr/lib/python2.7/dist-packages/epoptes/core/wol.py", line 35, in getBroadcastList
    for addr in netifaces.ifaddresses(ifname)[netifaces.AF_INET]:
KeyError: 2

We don't use IPv6 on our network.

Maybe it has something to do with the dual port Realtek NIC that our Zotac ZBOX is using? I can't reproduce this problem on a computer with a single port Realtek NIC.
Our system: Zotac ZBOX ID91 / Realtek RTL8111

Wake on LAN itself works fine on the ZBOX when using "wakeonlan 00:xx:xx:xx:xx:xx", but not in Epoptes.

Revision history for this message
Fotis Tsamis (ftsamis) wrote :

Unfortunately this fix was pushed after 0.5.8 was released, so, you'll need to wait until 0.6 which will be released soon in our stable PPA in order to get the fix. So, keep an eye on your updates, and please confirm that this issue is fixed when you get 0.6.

Thanks

Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

Fix released in epoptes 0.5.9.

Changed in epoptes:
status: Fix Committed → Fix Released
Revision history for this message
Rachmad Setiawan (sheenidgs) wrote :

Hi... I want share how to fix this bug if you want need it quickly. I've added a library called netifaces because when i use alkisg's patch, object netifaces not defined. I google it and found this module. Try to workaround to install the module and try to WOL my client from Epoptes GUI and it works! Here's the fix:

1. Use alkisg's fix above and the current file is in /usr/lib/python2.7/dist-packages/epoptes/core/wol.py

2. In script, add import netifaces below import fcntl

3. To install netifaces module, i use pip. Install the pip from terminal: sudo apt-get install python-pip python-dev.

4. Type in terminal: pip install netifaces

If you open the GUI while do this fix, I recommend to re-open the GUI. Then, try the WOL and it should be fixed for now. Sorry for my bad explanation because i'm a newcomer ._.

Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

Rachmad, python-netifaces is available in all Ubuntu versions:
http://packages.ubuntu.com/python-netifaces

And it's also listed in the epoptes dependencies:
$ apt policy epoptes | grep ^Depends
Depends: ..., python-netifaces, ...

I.e. it should work by default without applying any patches to everyone that is using a recent epoptes version.

If it's not working by default for you, which distro/version and which epoptes version are you using?

Revision history for this message
Rachmad Setiawan (sheenidgs) wrote :

Alkis, I use Ubuntu Server 14.04 LTS. I already tried to click boot from Epoptes GUI and from CLI by execute wol.py, but it's not working. The error as same as reported here.

Then, I use my workaround fix to make it works.

Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

Ubuntu 14.04 doesn't have the fix, you need to add the epoptes stable PPA in your sources to properly get the updated 0.5.10 version.

If you tried to manually apply the fix and it didn't work, you might have done something wrong, use the PPA instead. That's the recommended method, not the one you mentioned.

If you do have the PPA and it's not working, then a bug still exists and a fix will need to be deployed via the PPA again.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.