question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

can't start after network-online (Fedora 31)

See original GitHub issue

I couldn’t get the wsdd.service unit to work on startup, it would fail with the following:

oct 04 14:10:31 principal python3[849]: detected unhandled Python exception in '/usr/local/bin/wsdd'
oct 04 14:10:31 principal wsdd[849]: Traceback (most recent call last):
oct 04 14:10:31 principal wsdd[849]:   File "/usr/local/bin/wsdd", line 840, in <module>
oct 04 14:10:31 principal wsdd[849]:     sys.exit(main())
oct 04 14:10:31 principal wsdd[849]:   File "/usr/local/bin/wsdd", line 833, in main
oct 04 14:10:31 principal wsdd[849]:     retval = serve_wsd_requests(addresses)
oct 04 14:10:31 principal wsdd[849]:   File "/usr/local/bin/wsdd", line 776, in serve_wsd_requests
oct 04 14:10:31 principal wsdd[849]:     http_srv = klass(interface.listen_address, WSDHttpRequestHandler)
oct 04 14:10:31 principal wsdd[849]:   File "/usr/lib64/python3.7/socketserver.py", line 452, in __init__
oct 04 14:10:31 principal wsdd[849]:     self.server_bind()
oct 04 14:10:31 principal wsdd[849]:   File "/usr/local/bin/wsdd", line 64, in server_bind
oct 04 14:10:31 principal wsdd[849]:     super().server_bind()
oct 04 14:10:31 principal wsdd[849]:   File "/usr/lib64/python3.7/http/server.py", line 137, in server_bind
oct 04 14:10:31 principal wsdd[849]:     socketserver.TCPServer.server_bind(self)
oct 04 14:10:31 principal wsdd[849]:   File "/usr/lib64/python3.7/socketserver.py", line 466, in server_bind
oct 04 14:10:31 principal wsdd[849]:     self.socket.bind(self.server_address)
oct 04 14:10:31 principal wsdd[849]: OSError: [Errno 99] Cannot assign requested address

I went ahead and added a time.sleep(10) right after parse_args() on main() as a stop gap measure, but there’s got to be a proper fix.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
christgaucommented, Jan 15, 2020

Perfect! Thanks a lot for your feedback and your efforts in producing it.

Sorry for the delay in replying. ip addr gives

Please, don’t feel pressured. Answer whenever possible for you.

When I add -4 to the ExecStart I can see my Ubuntu server from my Windows machine. I rebooted three times and it works great each time.

Fine. That’s what I’ve expected.

When I switch it from -4 to -6 it doesn’t work. I can’t see my Ubuntu server from Windows. Even rebooting three times it still doesn’t work.

The logs confirm that this is “only” an IPv6 issue. Some research confirmed that in fact a race condition is causing the problem here. When the kernel automatically assigns an IPv6 address to an interface, the IPv6 implementation checks if there are other hosts on the interface’s network with the same address. This is called duplicate address detection (DAD). As long as the DAD is not completed, one cannot bind to the “preliminary” address. According requests result in error 99 on Linux. https://www.agwa.name/blog/post/beware_the_ipv6_dad_race_condition contains a nice summary of the problem.

The DAD is why you face the issue on reboot only, i.e. when the DAD is performed. Manual restarts of wsdd are much likely to happen after the DAD has completed and will therefore not face the problem.

This also explains why your workaround with a call to sleep before running all the network stuff in wsdd solves the issue. You can also add a line like ExecStartPre=/bin/sleep 2 to the systemd unit file (or similar for other init systems). This may not hurt the overall experience since the host can still be discovered - even some few seconds later. However, a real solution in the code would respect such situations as well as other changes to interfaces (e.g. changes WiFi networks) but this is more a little more difficult to implement in a portable way for FreeBSD and Linux and it is worth a separate issue.

As a temporary workaround, I propose to change the unit file as hinted above. I’ll add an according comment to the template unit file in etc and close that issue afterwards.

1reaction
christgaucommented, Jan 6, 2020

I’m sorry, I won’t be able to I’ve moved the network to AD keep going with bwaindwain

@mikelpr You’re welcome. Thanks for your input, anyways!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Start network services after log-in; not during boot-up : r/Fedora
Using systemd-analyze , I have noticed that sssd.service and NetworkManager-wait-online.service took significant time during the boot process.
Read more >
NetworkManager-wait-online fails on boot when 2 NIC are active
It appears that your interfaces are taking 31 seconds to come up, but NM-wait-online's timeout is 30s by default. That's why it's failing....
Read more >
How do you restart the network service on Fedora 30?
Open the 'Settings' application in Fedora. In the left column, scroll down to 'Network'; Toggle the blue switch off and back on again...
Read more >
Cause a script to execute after networking has started?
On current systems, ordering after network.target just guarantees that the network service has been started, not that there's some actual ...
Read more >
Unable to configure service after network-online
[tobiasb@tobias-pc ~]$ cat ~/.config/systemd/user/olad.service [Unit] Description=Open Lighting Architecture service (olad) # Doesn't work ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found