christgau / wsdd

A Web Service Discovery host daemon.
MIT License
841 stars 99 forks source link

It worked for Asustor NAS but had some error message #108

Closed transformcube closed 3 years ago

transformcube commented 3 years ago

Thanks for your great work. I have a Asustor AS6604T NAS and installed python 3 and executed wsdd.py. It can show network name in Win10 network neighborhood immediately but also shown some error messages. I wanted to know how to get rid of the error messages, thanks.

2021-05-17 09:04:57,539:wsdd WARNING(pid 27302): no interface given, using all interfaces 2021-05-17 09:04:57,561:asyncio ERROR(pid 27302): Exception in callback NetlinkAddressMonitor.handle_request() handle: <Handle NetlinkAddressMonitor.handle_request()> Traceback (most recent call last): File "/usr/local/AppCentral/python3/lib/python3.7/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "wsdd.py", line 1369, in handle_request self.handle_new_address(addr, ifa_family, iface) File "wsdd.py", line 1119, in handle_new_address addr = socket.inet_ntop(addr_family, raw_addr) ValueError: unknown address family 10

christgau commented 3 years ago

I wanted to know how to get rid of the error messages, thanks. 2021-05-17 09:04:57,539:wsdd WARNING(pid 27302): no interface given, using all interfaces

That's not an error, but a warning 😉 and it is going stay there.

2021-05-17 09:04:57,561:asyncio ERROR(pid 27302): Exception in callback NetlinkAddressMonitor.handle_request()

That's a real error message 😉

I need some more information to find the reason:

  1. What's the output of uname -a and cat /etc/os-release?
  2. Do you run wsdd in a docker container or similar environment?
  3. What's the output of ip a (you may shorten or create pseudonyms for the shown IP addresses)
transformcube commented 3 years ago

Thank you for your promptly reply. 😊

1. uname -a Linux AS6604T 4.14.x #1 SMP Mon May 10 00:30:33 CST 2021 x86_64 GNU/Linux

cat /etc/os-release cat: can't open '/etc/os-release': No such file or directory

I using find | grep os-release and get many similar links and cat:

cat ./volume1/.@plugins/AppCentral/docker-ce/docker_lib/btrfs/subvolumes/401019062b808bb 58f1a222ec600b1361836cb47cf3dd6a20f90cb6f361dfa24/etc/os-release NAME="Alpine Linux" ID=alpine VERSION_ID=3.12.7 PRETTY_NAME="Alpine Linux v3.12" HOME_URL="https://alpinelinux.org/" BUG_REPORT_URL="https://bugs.alpinelinux.org/"

  1. I run wsdd using SSH connect to NAS and cd to wsdd.py folder and type command "nohup python3 -u wsdd.py &"

  2. all IP are pseudonyms 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 42:b4:fe:38:9c:9e brd ff:ff:ff:ff:ff:ff inet 192.168.1.120/24 brd 192.168.1.155 scope global eth0 valid_lft forever preferred_lft forever inet6 f8e0::246b:ffef:f8e3:ce19/64 scope link valid_lft forever preferred_lft forever 3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 42:b4:ef:38:9c:ae brd ff:ff:ff:ff:ff:ff inet 192.168.1.121/24 brd 192.168.1.155 scope global eth1 valid_lft forever preferred_lft forever inet6 f8e0::246b:ffef:f8e3:ce9a/64 scope link valid_lft forever preferred_lft forever 4: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue link/ether 20:24:b6:c3:1f:43 brd ff:ff:ff:ff:ff:ff inet 171.17.0.1/16 brd 171.17.255.255 scope global docker0 valid_lft forever preferred_lft forever inet6 f8e0::24:6fbf:f3ec:13f4/64 scope link valid_lft forever preferred_lft forever 6: vethc1b76b8@if5: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue master docker0 link/ether a7:8c:f3:39:91:b brd ff:ff:ff:ff:ff:ff inet6 f8e0::7c88:3fff:f9e3:119b/64 scope link valid_lft forever preferred_lft forever

christgau commented 3 years ago

Thanks for provided the information

cat ./volume1/.@plugins/AppCentral/docker-ce/docker_lib/btrfs/subvolumes/401019062b808bb 58f1a222ec600b1361836cb47cf3dd6a20f90cb6f361dfa24/etc/os-release

That path actually looks like there is a Docker installation but it is not clear to me if your ssh session is inside a container or not. The interface list also shows the docker bridge.

1. I run wsdd using SSH connect to NAS and cd to wsdd.py folder and type command "nohup python3 -u wsdd.py &"

Ok. Providing an interface with -i will make the warning "no interface given, using all interfaces" disappear. The error will very likely remain. I'll get back to you with some further instruction required for debugging.

transformcube commented 3 years ago

Thanks, I used command wsdd.py -i eth0 assigned interface to eth0 the warning disappeared.

christgau commented 3 years ago

I added some more debug messages to the code which are required to analyze the actual problem. Could you please download the latest source code and let it run with python3 wsdd.py -vv 2> debug.log. You can terminate it after a couple of seconds. Please attach the debug.log to your next reply for further analysis. If required, remove/shorten the ip addresses in the log.

transformcube commented 3 years ago

Hi, I attached the debug.log, thanks.

debug.log

christgau commented 3 years ago

Great, looks good so far on the wsdd side. Could you please issue python3 -m 'sysconfig' | fgrep ENABLE_IPV6 and post the output?

transformcube commented 3 years ago

Great, looks good so far on the wsdd side. Could you please issue python3 -m 'sysconfig' | fgrep ENABLE_IPV6 and post the output?

ENABLE_IPV6 = "0"

christgau commented 3 years ago

ENABLE_IPV6 = "0"

Oh dear! 😞 A Python installation on a contemporary, not-so-cheap storage device that was not built with support for a 20+ year old protocol that becomes more and more ubiquitous. Shame on the vendor who apparently provides a Linux with enabled IPv6 support at the same time.

The wsdd implementation currently assumes that IPv6 support in Python has been enabled. I could work around the issue of the error message but, honestly, I would prefer not doing so. If I understand you correctly, wsdd works in principle. It, however, bails out an error but "only" at the start (or whenever an IPv6 address changes). If it is acceptable for you, I would close that issue...

transformcube commented 3 years ago

Thanks, I think the problem may caused by docker or their python3 package not enable ipv6 by default. However, the wsdd is working normally and you can close this issue.😉

christgau commented 3 years ago

Thanks. 😉