Server could not start listening on port


#1

Hey guys,

i moved into a new home in austria with a new UP Router. Now i wanted to get my reaspberry with homegear and openhab back and running. Unfortunately i now get the following error with homegear:

12/05/17 18:52:30.356 Loading RPC server settings from /etc/homegear/rpcservers.conf
12/05/17 18:52:30.358 Loading RPC client settings from /etc/homegear/rpcclients.conf
12/05/17 18:52:30.359 Starting Homegear...
12/05/17 18:52:30.359 Homegear version 0.7.10-1397
12/05/17 18:52:30.359 Git commit SHA of libhomegear-base: -
12/05/17 18:52:30.359 Git branch of libhomegear-base:     -
12/05/17 18:52:30.359 Git commit SHA of Homegear:         -
12/05/17 18:52:30.359 Git branch of Homegear:             -
12/05/17 18:52:30.361 Info: Setting allowed core file size to "4294967295" for user with id 0 and group with id 0.
12/05/17 18:52:30.361 Info: Core file size now is "4294967295".
12/05/17 18:52:30.361 Info: Setting maximum thread priority to "95" for user with id 0 and group with id 0.
12/05/17 18:52:30.361 Info: Maximum thread priority now is "95".
12/05/17 18:52:30.382 Info: Backing up database...
12/05/17 18:52:30.391 Can't execute "PRAGMA journal_mode=DELETE": database is locked
12/05/17 18:52:30.392 Can't execute "PRAGMA journal_mode=DELETE": database is locked
12/05/17 18:52:30.723 Initializing database...
12/05/17 18:52:30.725 Info: Loading family module mod_miscellaneous.so
12/05/17 18:52:30.729 /etc/homegear/families/miscellaneous.conf
12/05/17 18:52:30.729 Info: Loading family module mod_homematicbidcos.so
12/05/17 18:52:30.742 /etc/homegear/families/homematicbidcos.conf
12/05/17 18:52:30.743 Warning: Running as root. The authors of Homegear recommend running Homegear as user.
12/05/17 18:52:30.743 Warning: Running as root. The authors of Homegear recommend running Homegear as user.
12/05/17 18:52:30.748 Starting script engine server...
12/05/17 18:52:30.756 Initializing licensing controller...
12/05/17 18:52:30.756 Loading licensing controller data...
12/05/17 18:52:30.756 Loading devices...
12/05/17 18:52:30.756 Loading XML RPC devices...
12/05/17 18:52:31.700 Loading device 1
12/05/17 18:52:31.701 Module HomeMatic BidCoS: Info: Central address set to 0xFD43AB.
12/05/17 18:52:31.701 Module HomeMatic BidCoS: Loading peer 1
12/05/17 18:52:31.717 Module HomeMatic BidCoS: Loading peer 2
12/05/17 18:52:31.743 Module HomeMatic BidCoS: Loading peer 3
12/05/17 18:52:31.747 Module HomeMatic BidCoS: Loading peer 4
12/05/17 18:52:31.752 Loading XML RPC devices...
12/05/17 18:52:31.755 Loading device 2
12/05/17 18:52:31.756 Initializing RPC client...
12/05/17 18:52:31.756 Starting XML RPC server RPCServer1 listening on :::2001...
12/05/17 18:52:31.759 Starting XML RPC server RPCServer2 listening on :::2002, SSL enabled...
12/05/17 18:52:31.759 RPC Server (Port 2001): Error: Server could not start listening on port 2001: Address already in use
12/05/17 18:52:31.759 RPC Server (Port 2001): Error: Server could not start listening on port 2001: Address already in use
12/05/17 18:52:31.821 Starting XML RPC server RPCServer3 listening on :::2003, SSL enabled, authentication enabled...
12/05/17 18:52:31.822 RPC Server (Port 2002): Error: Server could not start listening on port 2002: Address already in use
12/05/17 18:52:31.822 RPC Server (Port 2002): Error: Server could not start listening on port 2002: Address already in use
12/05/17 18:52:31.863 Starting CLI server...
12/05/17 18:52:31.864 RPC Server (Port 2003): Error: Server could not start listening on port 2003: Address already in use
12/05/17 18:52:31.864 RPC Server (Port 2003): Error: Server could not start listening on port 2003: Address already in use
12/05/17 18:52:31.864 Initializing event handler...
12/05/17 18:52:31.864 Loading events...
12/05/17 18:52:31.865 Starting flows server...
12/05/17 18:52:31.880 Starting IPC server...
12/05/17 18:52:31.885 Start listening for packets...
12/05/17 18:52:34.286 Startup complete. Waiting for physical interfaces to connect.
12/05/17 18:52:34.286 All physical interfaces are connected now.
12/05/17 18:52:34.287 Starting UPnP server...
12/05/17 18:52:34.289 Info: UPnP server: Binding to address: 192.168.0.45
12/05/17 18:52:34.289 UPnP Server: Info: Started listening.
12/05/17 18:52:36.760 RPC Server (Port 2001): Error: Server could not start listening on port 2001: Address already in use
12/05/17 18:52:36.760 RPC Server (Port 2001): Error: Server could not start listening on port 2001: Address already in use
12/05/17 18:52:36.822 RPC Server (Port 2002): Error: Server could not start listening on port 2002: Address already in use
12/05/17 18:52:36.823 RPC Server (Port 2002): Error: Server could not start listening on port 2002: Address already in use
12/05/17 18:52:36.864 RPC Server (Port 2003): Error: Server could not start listening on port 2003: Address already in use
12/05/17 18:52:36.865 RPC Server (Port 2003): Error: Server could not start listening on port 2003: Address already in use
12/05/17 18:52:41.760 RPC Server (Port 2001): Error: Server could not start listening on port 2001: Address already in use
12/05/17 18:52:41.760 RPC Server (Port 2001): Error: Server could not start listening on port 2001: Address already in use
12/05/17 18:52:41.823 RPC Server (Port 2002): Error: Server could not start listening on port 2002: Address already in use

Do you guys have any suggestion how to fix this. Cause my openhab binding cant get the connection to homegear running anymore.

Thank you very much!


#2

Hi @MaxBec,

it looks like you try to run homegear a second time, this time as root:

12/05/17 18:52:30.392 Can't execute "PRAGMA journal_mode=DELETE": database is locked
...
12/05/17 18:52:30.743 Warning: Running as root. The authors of Homegear recommend running Homegear as user.

Only start/stop the homegear daemon via sudo service homegear start or sudo service homegear stop

What does sudo service homegear status say?

Cheers,
p


#3

It say:

● homegear.service - Homegear
   Loaded: loaded (/lib/systemd/system/homegear.service; enabled; vendor preset:
   Active: active (running) since Tue 2017-12-05 19:39:54 CET; 57min ago
  Process: 423 ExecStartPre=/etc/homegear/homegear-start.sh (code=exited, status
 Main PID: 617 (homegear)
   CGroup: /system.slice/homegear.service
           └─617 /usr/bin/homegear -u homegear -g homegear -p /var/run/homegear/

Dez 05 19:39:51 max-pi systemd[1]: Starting Homegear...
Dez 05 19:39:54 max-pi systemd[1]: Started Homegear.
Dez 05 19:39:56 max-pi homegear[617]: 12/05/17 19:39:56.068 Loading RPC server s
Dez 05 19:39:56 max-pi homegear[617]: 12/05/17 19:39:56.070 Loading RPC client s
lines 1-12/12 (END)

#4

So, you see - homegear itself is running.

Could you make sure, that the ip address you are trying to connect is right?


#5

What do you mean with checking if the ip is correct? The IP of the Raspberry?
And where can I confirm it? Is there a config file?


#6

You have to tell something more about your configuration. Where is openhab running? Where does openhab connect to?

Maybe your Pi just got a new IP from the “new” DHCP-Server on the new router and openhab does not have the correct IP for homegear anymore?

Just thoughts…


#7

The port error is still there… But now openhab and homegear is running.
So everything is ok :wink: