java.net.BindException: Address already in use (Bind failed)

Hi,

i’ve updated to OpenHAB 2.5.5 and now it seems to work but the persistence not. I’ve got this errors in log:

2020-06-01 14:30:43.030 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model ‘mysql.persist’
2020-06-01 14:30:47.201 [ERROR] [thome.model.lsp.internal.ModelServer] - Error starting the Language Server
java.net.BindException: Die Adresse wird bereits verwendet (Bind failed)

I don’t understand. Could anyone help me please?

Best regards
Chris

This normally means that the port is already in use by (another) software.
Logon to the openhab server and execute

sudo lsof -i :5007

or

sudo netstat -tulpe | grep 5007

Was fange ich damit an?
sudo lsof -i :5007

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 1828 root 53u IPv6 36663 0t0 TCP *:5007 (LISTEN)

sudo netstat -tulpe | grep 5007 :
tcp6 0 0 [::]:5007 [::]:* LISTEN root 36663 1828/java

I was thinking of that port 5007 is used by another program - but the output of the commands show that port 5007 is used by java - which is most probably openhab itself.
You can check that by checking what’s behind the curent related PID ( 1828 in this case ).
So unfortunately this does not really help.

Is it possible that openHAB runs twice? I got a different output of the same Dashboard in HABPanel on Smartphone as on Laptop.

What is the difference in the output that you get ?
You can check if there are two instances running by running the command

ps -ef | grep openhab

this should return one row containing /usr/bin/java.
As openhab uses specific ports that the software starts in listen mode it cannot be possible that there is more than one instance listening on the same port.

I get two rows but only one with the content you described. Did you have any other idea?

Thank you.

Do you mind to share a screencopy of the dashboard output on smartphone and laptop ?
There might be other reasons for the difference. Is it just the layout ? Nowadays so called responsive web design is being used to control the layout depending on the size of the display.
See wikipedia ( https://en.wikipedia.org/wiki/Responsive_web_design, https://de.wikipedia.org/wiki/Responsive_Webdesign ).
As I do not use HABPanel I haven’t checked yet if that is the case.

I make a big mistake and load a local copy of HABPanel on this devices. Now i’ve changed the port of language server to 50007 but it takes no effect.

what does this mean ? It’s still listening on the original port or is it listening on the new port number but you still get the same error message ?

Sorry. I try to describe better next time. It is listening on the new port number but i still get the same error messages.

what do you mean by:

You can choose wich HABPanel is loaded on every device. In the smartphoneapp a local copy was loaded instead of the layout wich located on the server. That was the reason why changes on dashboard takes no effect.

I couldn’t reply good news. It doesn’t work. I hope anyone could help. This Problem is the reason why my persistence doesn’t run too.

When i began to work with OpenHAB i’ve installed it on ubuntu via the software AND (i don’t know why) via commandline. I have deinstalled the via software installed OpenHAB and the ERROR was gone and leave the via commandline installated Version.

But there were a lot more problems so i’ve deleted absolutely all and started completely new. A new installation of ubuntu and a proper installation of OpenHAB an all the bindings. Now everything works fine.

1 Like

Christian_Meesters

Jun 7

Is it possible that openHAB runs twice? I got a different output of the same Dashboard in HABPanel on Smartphone as on Laptop.

Today i know at this point i was on the right way but this issue doesn’t affect to the dashboard. It was just a local saved copy. If you have the same problems activate the other on your server saved panel in the settings.