openhab / openhab-docker

Repository for building Docker containers for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
211 stars 128 forks source link

network] Include ping and arping in official docker images to avoid unreliable ping #305

Closed dafzor closed 3 years ago

dafzor commented 4 years ago

"cross report" of https://github.com/openhab/openhab-addons/issues/8349

When using " network:pingdevice" against a Windows 10 19041.450 PC with latest patches, if the firewall is active with the IMCP Ping inbound rule active, ping tool will be able to ping the PC, but java ping will fail making the device remain offline.

Expected Behavior

network:pingdevice should be able to ping the PC correctly.

Current Behavior

network:pingdevice will fail if windows firewall is active with IMCP inbound allowed.

image (gray is no firewall, black shows when firewall is enabled)

This might have been introduced with a recent windows or openHAB update as it was previously working correctly.

Possible Solution

Installing ping and arping inside the container image and restarting openhab resolves the issue.

Steps to Reproduce (for Bugs)

  1. Have a windows 10 2004 PC with latest patches
  2. Have openHAB running on arm docker host
  3. enable firewall on windows with default settings and allow core network diagnostics
  4. validate ping works by pinging from docker host
  5. verify that openHAB does not see device as online
  6. disable windows firewall
  7. openHAB ping should now work as expected

Context

It makes it impossible to create rules that depend on computer shutting down.

Your Environment

wborn commented 4 years ago

arping is already installed:

https://github.com/openhab/openhab-docker/blob/f16a4ea5908ecbee231cc2bb87c9d9d5885a38f5/2.5.8/debian/Dockerfile#L53-L73

According to the README it should have more functionality than the ping command.

You can install additional packages for your specific use case using a startup script or by building your own container.

dafzor commented 4 years ago

I've redeployed the container to re-test the issue, doing so made it pull a new container version and now I'm unable to reproduce it.

No idea what happened as I was able to consistently reproduce the issue and even upgraded from 2.5.7 to 2.5.8 during two days of troubleshooting with both having the same behavior and only fixing itself after I manually installed arping and ping.

dafzor commented 4 years ago

And after the previous reply I have seen the issue return after a PC reboot, openhab would not see computer online. Turning off Windows 10 firewall would magically make online status work again, and restarting the openhab container also fixed it without turning of the firewall...

wborn commented 3 years ago

Installing ping and arping inside the container image and restarting openhab resolves the issue.

Turning off Windows 10 firewall would magically make online status work again, and restarting the openhab container also fixed it without turning of the firewall...

Let's close this since it doesn't seem like installing ping or arping will solve this as you could fix it by restarting the container. Seems more like some kind of a network/firewall/router issue to me.