Knx: hostname can't be null

Hi,

I’m upgrading from 3.1 to 3.2, and found this issue on the knx thing configuration:

16:37:31.197 [INFO ] [del.core.internal.ModelRepositoryImpl] - Loading model 'knx.things'
16:37:31.291 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'knx:ip:bridge' changed from UNINITIALIZED (HANDLER_INITIALIZING_ERROR): hostname can't be null to UNINITIALIZED (HANDLER_MISSING_ERROR)
16:37:31.297 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'knx:ip:bridge' changed from UNINITIALIZED (HANDLER_INITIALIZING_ERROR): hostname can't be null to INITIALIZING
16:37:31.305 [ERROR] [rnal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.initialize()' on 'org.openhab.binding.knx.internal.handler.IPBridgeThingHandler@d7098': hostname can't be null
java.lang.IllegalArgumentException: hostname can't be null
        at java.net.InetSocketAddress.checkHost(InetSocketAddress.java:149) ~[?:?]
        at java.net.InetSocketAddress.<init>(InetSocketAddress.java:216) ~[?:?]
        at org.openhab.binding.knx.internal.handler.IPBridgeThingHandler.initialize(IPBridgeThingHandler.java:98) ~[?:?]
        at jdk.internal.reflect.GeneratedMethodAccessor113.invoke(Unknown Source) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
        at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
        at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:829) [?:?]
16:37:31.310 [ERROR] [.core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing 'knx:ip:bridge': hostname can't be null
java.lang.IllegalArgumentException: hostname can't be null
        at java.net.InetSocketAddress.checkHost(InetSocketAddress.java:149) ~[?:?]
        at java.net.InetSocketAddress.<init>(InetSocketAddress.java:216) ~[?:?]
        at org.openhab.binding.knx.internal.handler.IPBridgeThingHandler.initialize(IPBridgeThingHandler.java:98) ~[?:?]
        at jdk.internal.reflect.GeneratedMethodAccessor113.invoke(Unknown Source) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
        at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
        at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:829) [?:?]
16:37:31.319 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'knx:ip:bridge' changed from INITIALIZING to UNINITIALIZED (HANDLER_INITIALIZING_ERROR): hostname can't be null

The configuration of the Thing is:

Bridge knx:ip:bridge   [ 
    type="ROUTER"
] {
    Thing device generic [
    ]
    { ...... 
  }
}

The thing configuration doesn’t have any hostname to set. What am I missing?

Thanks for the help.

At least you have to set localIpAddress to the IP-Address of openHAB itself (neither fqdn nor localhost allowed, just set the IP)

From the binding documentation, with a “ROUTER” we don’t need to set anything else. Although I set localIp (not `localIpAddress, as you mentioned), but nothing changed.

Meanwhile I did change the hostname of the machine, and the problem went away. Today I rebooted the machine, and the problem is back again. With this error the knx binding does not work at all!

Any more thoughts?

Yes, you’re right, wasn’t at home…

or the problem as is, I have no Idea at all. It’s very strange and I’ve never had such a problem. What type of hardware/os do you use?

I had the binding working for at least 1 year, without issues on a RPI3. Now I moved to RPI4 (CM4 on a dual lan carrier board), and since then I’m having this issue. I didn’t touch the configuration when I did the hardware upgrade.

However I might have found the culprit. In the Network settings of openhab no primary interface was selected. Since I selected it the problem went away, at least for now.

Anyways, I’m astonished why this setting has so much impact on the binding, if the relation exists!

Well, if you are using two LAN ports, localIp is not longer optional. Did you setup the network for openHAB itself? http://ip.of.your.pi:8080/settings/services/org.openhab.network

Correct

Hmm… Could you please (just to ensure…) deactivate the second LAN port? If the error is gone, I would guess it’s an issue, if it’s still there, the two LAN ports aren’t the problem.

(Reminder: LAN + WLAN simultaneously isn’t a problem at all)