Bug 249111

Summary: net/py-wsdd: Fails to start
Product: Ports & Packages Reporter: Gerard Seibert <gerard_seibert>
Component: Individual Port(s)Assignee: Danilo G. Baio <dbaio>
Status: Closed Overcome By Events    
Severity: Affects Only Me CC: dbaio, hiroo.ono+freebsd
Priority: --- Flags: dbaio: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on: 249125    
Bug Blocks:    

Description Gerard Seibert 2020-09-04 15:08:09 UTC
FreeBSD 11.4-RELEASE-p3

I have just installed the net/py-wsdd port. Unfortunately, it will not start. I have the proper notation in /etc/rc.conf. The is the output error:

Sep  4 10:58:34 scorpio daemon[64165]: 2020-09-04 10:58:34,733:wsdd WARNING(pid 64166): no interface given, using all interfaces
Sep  4 10:58:34 scorpio daemon[64165]: Traceback (most recent call last):
Sep  4 10:58:34 scorpio daemon[64165]:   File "/usr/local/bin/wsdd", line 1650, in <module>
Sep  4 10:58:34 scorpio daemon[64165]:     sys.exit(main())
Sep  4 10:58:34 scorpio daemon[64165]:   File "/usr/local/bin/wsdd", line 1597, in main
Sep  4 10:58:34 scorpio daemon[64165]:     nm = RouteSocketAddressMonitor(s)
Sep  4 10:58:34 scorpio daemon[64165]:   File "/usr/local/bin/wsdd", line 923, in __call__
Sep  4 10:58:34 scorpio daemon[64165]:     obj.enumerate()
Sep  4 10:58:34 scorpio daemon[64165]:   File "/usr/local/bin/wsdd", line 1275, in enumerate
Sep  4 10:58:34 scorpio daemon[64165]:     self.parse_route_socket_response(rt_buf.raw, True)
Sep  4 10:58:34 scorpio daemon[64165]:   File "/usr/local/bin/wsdd", line 1311, in parse_route_socket_response
Sep  4 10:58:34 scorpio daemon[64165]:     intf, addr_mask, rtm_type, intf_flags)
Sep  4 10:58:34 scorpio daemon[64165]:   File "/usr/local/bin/wsdd", line 1360, in parse_addrs
Sep  4 10:58:34 scorpio daemon[64165]:     self.handle_new_address(addr, addr_family, intf)
Sep  4 10:58:34 scorpio daemon[64165]:   File "/usr/local/bin/wsdd", line 1016, in handle_new_address
Sep  4 10:58:34 scorpio daemon[64165]:     mch, WSDHttpRequestHandler, mch.family, self.selector))
Sep  4 10:58:34 scorpio daemon[64165]:   File "/usr/local/bin/wsdd", line 799, in __init__
Sep  4 10:58:34 scorpio daemon[64165]:     super().__init__(mch.listen_address, RequestHandlerClass)
Sep  4 10:58:34 scorpio daemon[64165]:   File "/usr/local/lib/python3.7/socketserver.py", line 452, in __init__
Sep  4 10:58:34 scorpio daemon[64165]:     self.server_bind()
Sep  4 10:58:34 scorpio daemon[64165]:   File "/usr/local/bin/wsdd", line 805, in server_bind
Sep  4 10:58:34 scorpio daemon[64165]:     super().server_bind()
Sep  4 10:58:34 scorpio daemon[64165]:   File "/usr/local/lib/python3.7/http/server.py", line 137, in server_bind
Sep  4 10:58:34 scorpio daemon[64165]:     socketserver.TCPServer.server_bind(self)
Sep  4 10:58:34 scorpio daemon[64165]:   File "/usr/local/lib/python3.7/socketserver.py", line 466, in server_bind
Sep  4 10:58:34 scorpio daemon[64165]:     self.socket.bind(self.server_address)
Sep  4 10:58:34 scorpio daemon[64165]: socket.gaierror: [Errno 8] hostname nor servname provided, or not known

I am not sure if I am doing something incorrectly or if there is a problem with the application.
Comment 1 Hiroo Ono 2020-09-05 11:57:10 UTC
(In reply to Gerard Seibert from comment #0)
Do you define wsdd_flags in /etc/rc.conf?
I found a bug in net/py-wsdd/files/patch-etc_rc.d_wsdd that make this variable ignored.

Anyway edit /usr/local/etc/rc.d/wsdd to replace 'wsdd_suppflags' to 'wsdd_flags' and set -v to wsdd_flags in /etc/rc.conf. Then, there should be more information in /var/log/messages.
Comment 2 Gerard Seibert 2020-09-05 13:07:21 UTC
(In reply to Hiroo Ono from comment #1)
I made the changes you requested. I also added: wsdd_flags "-v -v" to the /etc/rc.conf file. The application still fails to start.

This is the new output:

Sep  5 09:02:12 scorpio daemon[14426]: 2020-09-05 09:02:12,353:wsdd WARNING(pid 14427): no interface given, using all interfaces
Sep  5 09:02:12 scorpio daemon[14426]: 2020-09-05 09:02:12,353:wsdd INFO(pid 14427): using pre-defined UUID ccceb86e-be3a-5e41-80fb-8d63f97c1277
Sep  5 09:02:12 scorpio daemon[14426]: 2020-09-05 09:02:12,362:wsdd DEBUG(pid 14427): new address fe80::24e:1ff:feb0:9234 on alc0
Sep  5 09:02:12 scorpio daemon[14426]: 2020-09-05 09:02:12,362:wsdd DEBUG(pid 14427): handling traffic for fe80::24e:1ff:feb0:9234 on alc0
Sep  5 09:02:12 scorpio daemon[14426]: 2020-09-05 09:02:12,362:wsdd INFO(pid 14427): joined multicast group ('ff02::c', 3702, 22364, 1) on fe80::24e:1ff:feb0:9234%alc0
Sep  5 09:02:12 scorpio daemon[14426]: 2020-09-05 09:02:12,362:wsdd DEBUG(pid 14427): transport address on alc0 is [fe80::24e:1ff:feb0:9234]
Sep  5 09:02:12 scorpio daemon[14426]: 2020-09-05 09:02:12,362:wsdd DEBUG(pid 14427): will listen for HTTP traffic on address ('fe80::24e:1ff:feb0:9234', 5357, 0, 1)
Sep  5 09:02:12 scorpio daemon[14426]: 2020-09-05 09:02:12,363:wsdd DEBUG(pid 14427): constructed xml for WSD message: b'<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:pnpx="http://schemas.microsoft.com/windows/pnpx/2005/10" xmlns:pub="http://schemas.microsoft.com/windows/pub/2005/07" xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsd="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:wsdp="http://schemas.xmlsoap.org/ws/2006/02/devprof" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"><soap:Header><wsa:To>urn:schemas-xmlsoap-org:ws:2005:04:discovery</wsa:To><wsa:Action>http://schemas.xmlsoap.org/ws/2005/04/discovery/Hello</wsa:Action><wsa:MessageID>urn:uuid:039808cf-ef78-11ea-aadc-004e01b09234</wsa:MessageID><wsd:AppSequence InstanceId="1599310932" MessageNumber="0" SequenceId="urn:uuid:03980a03-ef78-11ea-aadc-004e01b09234" /></soap:Header><soap:Body><wsd:Hello><wsa:EndpointReference><wsa:Address>urn:uuid:ccceb86e-be3a-5e41-80fb-8d63f97c1277</wsa:Address></wsa:EndpointReference><wsd:XAddrs>http://[fe80::24e:1ff:feb0:9234]:5357/ccceb86e-be3a-5e41-80fb-8d63f97c1277</wsd:XAddrs><wsd:MetadataVersion>1</wsd:MetadataVersion></wsd:Hello></soap:Body></soap:Envelope>'
Sep  5 09:02:12 scorpio daemon[14426]: 2020-09-05 09:02:12,363:wsdd DEBUG(pid 14427): scheduling Hello message via alc0 to ('ff02::c', 3702, 22364, 1)
Sep  5 09:02:12 scorpio daemon[14426]: 2020-09-05 09:02:12,365:wsdd DEBUG(pid 14427): new address 192.168.1.101 on alc0
Sep  5 09:02:12 scorpio daemon[14426]: 2020-09-05 09:02:12,365:wsdd DEBUG(pid 14427): handling traffic for 192.168.1.101 on alc0
Sep  5 09:02:12 scorpio daemon[14426]: 2020-09-05 09:02:12,365:wsdd INFO(pid 14427): joined multicast group ('239.255.255.250', 3702) on 192.168.1.101%alc0
Sep  5 09:02:12 scorpio daemon[14426]: 2020-09-05 09:02:12,366:wsdd DEBUG(pid 14427): transport address on alc0 is 192.168.1.101
Sep  5 09:02:12 scorpio daemon[14426]: 2020-09-05 09:02:12,366:wsdd DEBUG(pid 14427): will listen for HTTP traffic on address ('192.168.1.101', 5357)
Sep  5 09:02:12 scorpio daemon[14426]: 2020-09-05 09:02:12,366:wsdd DEBUG(pid 14427): constructed xml for WSD message: b'<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:pnpx="http://schemas.microsoft.com/windows/pnpx/2005/10" xmlns:pub="http://schemas.microsoft.com/windows/pub/2005/07" xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsd="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:wsdp="http://schemas.xmlsoap.org/ws/2006/02/devprof" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"><soap:Header><wsa:To>urn:schemas-xmlsoap-org:ws:2005:04:discovery</wsa:To><wsa:Action>http://schemas.xmlsoap.org/ws/2005/04/discovery/Hello</wsa:Action><wsa:MessageID>urn:uuid:03988309-ef78-11ea-aadc-004e01b09234</wsa:MessageID><wsd:AppSequence InstanceId="1599310932" MessageNumber="1" SequenceId="urn:uuid:039883bc-ef78-11ea-aadc-004e01b09234" /></soap:Header><soap:Body><wsd:Hello><wsa:EndpointReference><wsa:Address>urn:uuid:ccceb86e-be3a-5e41-80fb-8d63f97c1277</wsa:Address></wsa:EndpointReference><wsd:XAddrs>http://192.168.1.101:5357/ccceb86e-be3a-5e41-80fb-8d63f97c1277</wsd:XAddrs><wsd:MetadataVersion>1</wsd:MetadataVersion></wsd:Hello></soap:Body></soap:Envelope>'
Sep  5 09:02:12 scorpio daemon[14426]: 2020-09-05 09:02:12,366:wsdd DEBUG(pid 14427): scheduling Hello message via alc0 to ('239.255.255.250', 3702)
Sep  5 09:02:12 scorpio daemon[14426]: Traceback (most recent call last):
Sep  5 09:02:12 scorpio daemon[14426]:   File "/usr/local/bin/wsdd", line 1650, in <module>
Sep  5 09:02:12 scorpio daemon[14426]:     sys.exit(main())
Sep  5 09:02:12 scorpio daemon[14426]:   File "/usr/local/bin/wsdd", line 1597, in main
Sep  5 09:02:12 scorpio daemon[14426]:     nm = RouteSocketAddressMonitor(s)
Sep  5 09:02:12 scorpio daemon[14426]:   File "/usr/local/bin/wsdd", line 923, in __call__
Sep  5 09:02:12 scorpio daemon[14426]:     obj.enumerate()
Sep  5 09:02:12 scorpio daemon[14426]:   File "/usr/local/bin/wsdd", line 1275, in enumerate
Sep  5 09:02:12 scorpio daemon[14426]:     self.parse_route_socket_response(rt_buf.raw, True)
Sep  5 09:02:12 scorpio daemon[14426]:   File "/usr/local/bin/wsdd", line 1311, in parse_route_socket_response
Sep  5 09:02:12 scorpio daemon[14426]:     intf, addr_mask, rtm_type, intf_flags)
Sep  5 09:02:12 scorpio daemon[14426]:   File "/usr/local/bin/wsdd", line 1360, in parse_addrs
Sep  5 09:02:12 scorpio daemon[14426]:     self.handle_new_address(addr, addr_family, intf)
Sep  5 09:02:12 scorpio daemon[14426]:   File "/usr/local/bin/wsdd", line 1016, in handle_new_address
Sep  5 09:02:12 scorpio daemon[14426]:     mch, WSDHttpRequestHandler, mch.family, self.selector))
Sep  5 09:02:12 scorpio daemon[14426]:   File "/usr/local/bin/wsdd", line 799, in __init__
Sep  5 09:02:12 scorpio daemon[14426]:     super().__init__(mch.listen_address, RequestHandlerClass)
Sep  5 09:02:12 scorpio daemon[14426]:   File "/usr/local/lib/python3.7/socketserver.py", line 452, in __init__
Sep  5 09:02:12 scorpio daemon[14426]:     self.server_bind()
Sep  5 09:02:12 scorpio daemon[14426]:   File "/usr/local/bin/wsdd", line 805, in server_bind
Sep  5 09:02:12 scorpio daemon[14426]:     super().server_bind()
Sep  5 09:02:12 scorpio daemon[14426]:   File "/usr/local/lib/python3.7/http/server.py", line 137, in server_bind
Sep  5 09:02:12 scorpio daemon[14426]:     socketserver.TCPServer.server_bind(self)
Sep  5 09:02:12 scorpio daemon[14426]:   File "/usr/local/lib/python3.7/socketserver.py", line 466, in server_bind
Sep  5 09:02:12 scorpio daemon[14426]:     self.socket.bind(self.server_address)
Sep  5 09:02:12 scorpio daemon[14426]: socket.gaierror: [Errno 8] hostname nor servname provided, or not known
Comment 3 Hiroo Ono 2020-09-05 15:33:28 UTC
Adding wsdd_flags="-i alc0" to rc.conf won't help?
Comment 4 Gerard Seibert 2020-09-05 15:43:21 UTC
(In reply to Hiroo Ono from comment #3)
I added that change, plus corrected a minor problem in my firewall (I think). I tried running the command both with and without my firewall enabled, and the log remained the same. This is the latest error message:

Sep  5 11:39:33 scorpio daemon[84582]: 2020-09-05 11:39:33,544:wsdd INFO(pid 84583): using pre-defined UUID ccceb86e-be3a-5e41-80fb-8d63f97c1277
Sep  5 11:39:33 scorpio daemon[84582]: 2020-09-05 11:39:33,553:wsdd INFO(pid 84583): joined multicast group ('ff02::c', 3702, 22364, 1) on fe80::24e:1ff:feb0:9234%alc0
Sep  5 11:39:33 scorpio daemon[84582]: 2020-09-05 11:39:33,556:wsdd INFO(pid 84583): joined multicast group ('239.255.255.250', 3702) on 192.168.1.101%alc0
Sep  5 11:39:33 scorpio daemon[84582]: Traceback (most recent call last):
Sep  5 11:39:33 scorpio daemon[84582]:   File "/usr/local/bin/wsdd", line 1650, in <module>
Sep  5 11:39:33 scorpio daemon[84582]:     sys.exit(main())
Sep  5 11:39:33 scorpio daemon[84582]:   File "/usr/local/bin/wsdd", line 1597, in main
Sep  5 11:39:33 scorpio daemon[84582]:     nm = RouteSocketAddressMonitor(s)
Sep  5 11:39:33 scorpio daemon[84582]:   File "/usr/local/bin/wsdd", line 923, in __call__
Sep  5 11:39:33 scorpio daemon[84582]:     obj.enumerate()
Sep  5 11:39:33 scorpio daemon[84582]:   File "/usr/local/bin/wsdd", line 1275, in enumerate
Sep  5 11:39:33 scorpio daemon[84582]:     self.parse_route_socket_response(rt_buf.raw, True)
Sep  5 11:39:33 scorpio daemon[84582]:   File "/usr/local/bin/wsdd", line 1311, in parse_route_socket_response
Sep  5 11:39:33 scorpio daemon[84582]:     intf, addr_mask, rtm_type, intf_flags)
Sep  5 11:39:33 scorpio daemon[84582]:   File "/usr/local/bin/wsdd", line 1360, in parse_addrs
Sep  5 11:39:33 scorpio daemon[84582]:     self.handle_new_address(addr, addr_family, intf)
Sep  5 11:39:33 scorpio daemon[84582]:   File "/usr/local/bin/wsdd", line 1016, in handle_new_address
Sep  5 11:39:33 scorpio daemon[84582]:     mch, WSDHttpRequestHandler, mch.family, self.selector))
Sep  5 11:39:33 scorpio daemon[84582]:   File "/usr/local/bin/wsdd", line 799, in __init__
Sep  5 11:39:33 scorpio daemon[84582]:     super().__init__(mch.listen_address, RequestHandlerClass)
Sep  5 11:39:33 scorpio daemon[84582]:   File "/usr/local/lib/python3.7/socketserver.py", line 452, in __init__
Sep  5 11:39:33 scorpio daemon[84582]:     self.server_bind()
Sep  5 11:39:33 scorpio daemon[84582]:   File "/usr/local/bin/wsdd", line 805, in server_bind
Sep  5 11:39:33 scorpio daemon[84582]:     super().server_bind()
Sep  5 11:39:33 scorpio daemon[84582]:   File "/usr/local/lib/python3.7/http/server.py", line 137, in server_bind
Sep  5 11:39:33 scorpio daemon[84582]:     socketserver.TCPServer.server_bind(self)
Sep  5 11:39:33 scorpio daemon[84582]:   File "/usr/local/lib/python3.7/socketserver.py", line 466, in server_bind
Sep  5 11:39:33 scorpio daemon[84582]:     self.socket.bind(self.server_address)
Sep  5 11:39:33 scorpio daemon[84582]: OSError: [Errno 49] Can't assign requested address
Comment 5 Gerard Seibert 2020-09-07 11:13:23 UTC
I made the following changes in the /etc/rc.conf file. I modified the "wsdd_flags" setting to"

wsdd_flags="-i 127.0.0.1 -n SCORPIO  -v -v"

The application now starts. The log show this:

Sep  7 07:05:41 scorpio daemon[343]: 2020-09-07 07:05:41,053:wsdd INFO(pid 344): using pre-defined UUID ccceb86e-be3a-5e41-80fb-8d63f97c1277
Sep  7 07:05:41 scorpio daemon[343]: 2020-09-07 07:05:41,062:wsdd DEBUG(pid 344): new address fe80::24e:1ff:feb0:9234 on alc0
Sep  7 07:05:41 scorpio daemon[343]: 2020-09-07 07:05:41,062:wsdd DEBUG(pid 344): ignoring that address on alc0
Sep  7 07:05:41 scorpio daemon[343]: 2020-09-07 07:05:41,062:wsdd DEBUG(pid 344): new address 192.168.1.101 on alc0
Sep  7 07:05:41 scorpio daemon[343]: 2020-09-07 07:05:41,062:wsdd DEBUG(pid 344): ignoring that address on alc0
Sep  7 07:05:41 scorpio daemon[343]: 2020-09-07 07:05:41,062:wsdd DEBUG(pid 344): new address 2606:a000:111e:cae2:24e:1ff:feb0:9234 on alc0
Sep  7 07:05:41 scorpio daemon[343]: 2020-09-07 07:05:41,062:wsdd DEBUG(pid 344): ignoring that address on alc0

However, the network is not shown in the Windows 10 Network. I tried changing the IP to: 192.168.0.101; however, that made o difference and the log file remained exactly the same.

Do you hae any suggestions?
Comment 6 Gerard Seibert 2020-09-07 11:56:00 UTC
UPDATE

I modified the wsdd_flags setting to:

wsdd_flags="-i 192.168.1.101 -n SCORPIO  -w WORKGROUP"

Now everything is working as it is intended to. I have no idea why though. By the way, using "alc0" does NOT work. I have to use the machine's IP -AND- specify the workgroup.

This is now the log output:

Sep  7 07:52:45 scorpio daemon[2589]: 2020-09-07 07:52:45,642:wsdd INFO(pid 2590): using pre-defined UUID ccceb86e-be3a-5e41-80fb-8d63f97c1277
Sep  7 07:52:45 scorpio daemon[2589]: 2020-09-07 07:52:45,651:wsdd INFO(pid 2590): joined multicast group ('239.255.255.250', 3702) on 192.168.1.101%alc0
Sep  7 07:52:45 scorpio daemon[2589]: 2020-09-07 07:52:45,661:wsdd INFO(pid 2590): 192.168.1.102 - - "POST /ccceb86e-be3a-5e41-80fb-8d63f97c1277 HTTP/1.1" 200 -
Sep  7 07:52:45 scorpio daemon[2589]: 2020-09-07 07:52:45,662:wsdd INFO(pid 2590): 192.168.1.102 - - "POST /ccceb86e-be3a-5e41-80fb-8d63f97c1277 HTTP/1.1" 200 -
Sep  7 07:52:45 scorpio daemon[2589]: 2020-09-07 07:52:45,965:wsdd INFO(pid 2590): 192.168.1.103 - - "POST /ccceb86e-be3a-5e41-80fb-8d63f97c1277 HTTP/1.1" 200 -
Comment 7 Danilo G. Baio freebsd_committer freebsd_triage 2020-09-13 17:50:37 UTC
ports r548495 should fix this, if you still find any issue, please reopen this PR.
thanks!
Comment 8 Gerard Seibert 2020-09-16 11:05:36 UTC
(In reply to Danilo G. Baio from comment #7)

I am still waiting for this to appear in the ports tree.
Comment 9 Danilo G. Baio freebsd_committer freebsd_triage 2020-09-17 23:13:33 UTC
(In reply to Gerard Seibert from comment #8)

It's already in the ports tree.
Soon it will be available in all package repositories, you can watch this through FreshPorts, version 0.6.1_1.
https://www.freshports.org/net/py-wsdd