Error about Farmbot-Web-App_mqtt_1

Thanks for taking the time to read first.
I’m a beginner for Farmbot. Because the limitation of environment, I can not let the hardware link to the cloud for web app. When the first time I tried to build on off-line server on Ubuntu, I got the error message for MQTT service:

++++++++++++++ERROR MESSAGE++++++++++++++
Creating farmbot-web-app_mqtt_1 … error

ERROR: for farmbot-web-app_mqtt_1 Cannot start service mqtt: driver failed programming external connectivity on endpoint farmbot-web-app_mqtt_1 (6ae52068f772ea9e124bdd503598b1986297dcf6def0be430fb8db81f8e13e32): Error starting userland proxy: listen tcp 0.0.0.0:1883: bind: address already in use

ERROR: for mqtt Cannot start service mqtt: driver failed programming external connectivity on endpoint farmbot-web-app_mqtt_1 (6ae52068f772ea9e124bdd503598b1986297dcf6def0be430fb8db81f8e13e32): Error starting userland proxy: listen tcp 0.0.0.0:1883: bind: address already in use
ERROR: Encountered errors while bringing up the project.
++++++++++++++ERROR MESSAGE++++++++++++++

How can I fix it? Please help me to overcome the problem, thanks (bow).

This is probably your issue, although there may be other issues at play:

tcp 0.0.0.0:1883: bind: address already in use

FarmBot needs to open (listen on) port 1883. It cannot do so because something else (probably another FarmBot server) is still running. A possible solution is to deactivate any other instances of FarmBot and try again:

sudo docker-compose down
sudo docker-compose up

Thank you, Rick.
After I made compose down and set the port 1883 open (as “sudo ufw allow 1883/tcp”), I still got the same error message.

BTW, I’ve tried different way to install the Mosquitto MQTT Broker before the Docker, Is this step leading the Farmbot Web App Server to confusion?
or should I post my ENV file for this problem?

On the other hand, I’ve experienced similar problems as “7.0.2-beta and AMQP connection timeouts” in March. After I reinstall the Ubuntu and update the file to the newest version, the problem became the title.
Is there any relationship between the two problems?

Thanks again.

Hi @AstrayAA, that AMQP issue was fixed in the 7.0.2-beta FBOS released on commit 205542d0 at around April-4. I notice that the 7.0.2 release is now available.

@AstrayAA, you could try sudo netstat -nap and look for the Linux pid using that port already.

Hello, jsimmonds.
After I used the command “netstat -tulpn | grep :1883” to check the port, the system answer these information:

It seems not being used for another software. Should I read all line-to-line informations from “sudo netstat -nap” ? Or I can use specific order to check? Thanks.

BTW again, why I mention the problem about “AMQP connection timeouts” is: after the problem fixed and I update the Web-App as I thought, the MQTT problem begin to show and can not solve.

@AstrayAA, you need the sudo before the netstat . . to get Linux pids, you need to “be root”

@AstrayAA If you installed mosquitto, it was most likely added as a system service and is running in the background on every boot (and also using port 1883). I ran the setup instructions for the latest version (released Friday, April 5th 2019) and did not hit any issues with MQTT ports, so my hunch is that there is a local configuration problem at play.

I will re-run the installer again just to be sure though. Also, what do you see when you run git log -1?

@RickCarlino Thanks.
After I re-install all the system for Farmbot Web App minimum requires, the original problem, “Creating farmbot-web-app_mqtt_1 … error” had gone immediately. I think the problem is this:

I install Mosquitto MQTT Broker before Docker and let the installation step as the ubuntu_example.sh said.
After I re-install all the system, I try the minimum way to follow the step for build the server. It seems the change will let the 1883 port in use, I’m not sure why.

BTW, because my system now is in the simplest state without all software (only firefox and Frambot Web App), what I type “netstat” would not show any information for me. I also disable firewall (by default, it would not enable until you manual on it).
And the “git log -1” gave me this:
fatal: not a git repository (or any of the parent directories): .git

Now, I stuck at the step as the picture:


It looks like the “sudo docker-compose up” command fail to connect service. I’m not sure why, I’ll try to read more post and fix it.

Thanks a lot.

@AstrayAA

fatal: not a git repository (or any of the parent directories): .git

You are seeing this error because you are not in the project. git commands must be run from the project directory.

looks like the “sudo docker-compose up” command fail to connect service.

You should wait a while (sometimes as long as 3 minutes on older machines) for asset compilation to finish.

The app won’t work until you see a message similar to this:

parcel_1       | ✨  Built in 58.14s.

In the screenshot above, I do not see any problematic error messages, so you most likely need to wait for compilation to finish. After that, you should see the app at http://localhost:3000.

@RickCarlino `Thank you for your patient response.
After I saw the line as “Built in XX.XXs.”, the system repeats

rabbit_jobs_1 | Connecting to broker in 3 seconds.


until I close terminal and could not use

http://localhost:3000.

to connect the web pages. Should I bring the hardware of Farmbot on before the command of compose -up?

BTW, this problem happens on VM or real PC.
Thanks a lot.

until I close terminal and could not use

Do you mean to say that you closed the terminal after running setup? The terminal must stay open for the server to work. You cannot close it. If you don’t like having the window open, you can run sudo docker-compose up -d instead. This will run the server in the background.

this problem happens on VM or real PC.

This morning I set up a virtual machine and ran the instructions from ubuntu_example.sh. The server ran fine, so my guess at this point is that there is an issue with your local network.