mosquitto Error: Address already in use Topic is solved

Having issues with your DietPi installation or found a bug? Post it here.
Ian
Posts: 29
Joined: Thu Feb 28, 2019 12:45 pm

mosquitto Error: Address already in use

Post by Ian »

Hello,

Just did an apt upgrade and mosquitto seems to have a problem. I tried un and reinstalling but still the same.

In dietpi-services status mosquitto is running ok

Any ideas?

Ian

Code: Select all

1616098490: mosquitto version 2.0.9 starting
1616098490: Using default config.
1616098490: Starting in local only mode. Connections will only be possible from clients running on this machine.
1616098490: Create a configuration file which defines a listener to allow remote access.
1616098490: Opening ipv4 listen socket on port 1883.
1616098490: Error: Address already in use
1616098490: Opening ipv6 listen socket on port 1883.
1616098490: Error: Address already in use
User avatar
Joulinar
Posts: 5115
Joined: Sat Nov 16, 2019 12:49 am

Re: mosquitto Error: Address already in use

Post by Joulinar »

you can run following to check which ports are in use and by which application

Code: Select all

ss -tulpn | grep LISTEN
as well you might be impacted by this viewtopic.php?f=9&t=8816
because I see following on your output

Code: Select all

Starting in local only mode. Connections will only be possible from clients running on this machine.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Ian
Posts: 29
Joined: Thu Feb 28, 2019 12:45 pm

Re: mosquitto Error: Address already in use

Post by Ian »

Thanks,

My grep listen returns that it's mosquitto doing the listening.

I'll as you said in the link take it up with mosquito

Code: Select all

tcp    LISTEN     0      100    127.0.0.1:26002                 *:*                   users:(("nxnode.bin",pid=1281,fd=7))
tcp    LISTEN     0      128       *:22                    *:*                   users:(("dropbear",pid=624,fd=3))
tcp    LISTEN     0      128       *:1880                  *:*                   users:(("node-red",pid=5345,fd=21))
tcp    LISTEN     0      128    127.0.0.1:8088                  *:*                   users:(("influxd",pid=5354,fd=3))
tcp    LISTEN     0      128    127.0.0.1:7002                  *:*                   users:(("nxnode.bin",pid=1281,fd=19))
tcp    LISTEN     0      100    127.0.0.1:1883                  *:*                   users:(("mosquitto",pid=5337,fd=5))
tcp    LISTEN     0      50        *:445                   *:*                   users:(("smbd",pid=5313,fd=32))
tcp    LISTEN     0      100       *:4000                  *:*                   users:(("nxd",pid=807,fd=3))
tcp    LISTEN     0      100    127.0.0.1:21024                 *:*                   users:(("nxserver.bin",pid=481,fd=8))
tcp    LISTEN     0      100    127.0.0.1:12002                 *:*                   users:(("nxnode.bin",pid=1281,fd=16))
tcp    LISTEN     0      100    127.0.0.1:25002                 *:*                   users:(("nxclient.bin",pid=1318,fd=7))
tcp    LISTEN     0      50        *:139                   *:*                   users:(("smbd",pid=5313,fd=33))
tcp    LISTEN     0      32       :::21                   :::*                   users:(("proftpd",pid=5292,fd=0))
tcp    LISTEN     0      128      :::8086                 :::*                   users:(("influxd",pid=5354,fd=306))
tcp    LISTEN     0      128      :::22                   :::*                   users:(("dropbear",pid=624,fd=4))
tcp    LISTEN     0      128      :::3001                 :::*                   users:(("grafana-server",pid=5362,fd=12))
tcp    LISTEN     0      128     ::1:7002                 :::*                   users:(("nxnode.bin",pid=1281,fd=17))
tcp    LISTEN     0      100     ::1:1883                 :::*                   users:(("mosquitto",pid=5337,fd=6))
tcp    LISTEN     0      50       :::445                  :::*                   users:(("smbd",pid=5313,fd=30))
tcp    LISTEN     0      100      :::4000                 :::*                   users:(("nxd",pid=807,fd=4))
tcp    LISTEN     0      50       :::139                  :::*                   users:(("smbd",pid=5313,fd=31))
User avatar
Joulinar
Posts: 5115
Joined: Sat Nov 16, 2019 12:49 am

Re: mosquitto Error: Address already in use

Post by Joulinar »

Did you tried to reboot your system?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Ian
Posts: 29
Joined: Thu Feb 28, 2019 12:45 pm

Re: mosquitto Error: Address already in use

Post by Ian »

Yes, a couple of times.
User avatar
Joulinar
Posts: 5115
Joined: Sat Nov 16, 2019 12:49 am

Re: mosquitto Error: Address already in use

Post by Joulinar »

and still same error message on mosquitto error log?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Ian
Posts: 29
Joined: Thu Feb 28, 2019 12:45 pm

Re: mosquitto Error: Address already in use

Post by Ian »

Yes unfortunately still the same.

Is it worth a try to install mosquitto's 2.0.9 from their site (mosquitto1~buster1_amd64.deb)

Code: Select all

1616235035: mosquitto version 2.0.9 starting
1616235035: Using default config.
1616235035: Starting in local only mode. Connections will only be possible from clients running on this machine.
1616235035: Create a configuration file which defines a listener to allow remote access.
1616235035: Opening ipv4 listen socket on port 1883.
1616235035: Error: Address already in use
1616235035: Opening ipv6 listen socket on port 1883.
1616235035: Error: Address already in use
User avatar
Joulinar
Posts: 5115
Joined: Sat Nov 16, 2019 12:49 am

Re: mosquitto Error: Address already in use

Post by Joulinar »

DietPi is doing nothing else than performing an apt install.

If you are ok. You could purge it completely by runningapt purge mosquitto.

Usually mosquitto should be gone afterwards. Better to check after a reboot. To reinstall just do apt install mosquitto
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Ian
Posts: 29
Joined: Thu Feb 28, 2019 12:45 pm

Re: mosquitto Error: Address already in use

Post by Ian »

I did un and reinstall through dietpi-software previously, would apt purge be more thorough?
User avatar
Joulinar
Posts: 5115
Joined: Sat Nov 16, 2019 12:49 am

Re: mosquitto Error: Address already in use

Post by Joulinar »

dietpi-software reinstall will just apply the package over the existing install. While an apt purge should remove everything. Same as running uninstall via dietpi-software
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply