Error trying to deploy to AWS

Try stopping all running containers/services on the EC2 instance first. Then attempt again.

Already tried this. Even tried with a completely fresh EC2 instance, and I get the same error.

Also could try changing the port to 8080 (remember to make corresponding changes AWS side) in docker-compose.yml see if that rectifies it?

SSH in and run:

docker ps

and see what is using port 80 and run (to stop the offending Container):

docker stop CONTAINER ID

Tried port 8080 but then I just get:

ERROR: for b24d7eac65d8_benchmark__staging_web_1  Cannot start service web: driver failed programming external connectivity on endpoint benchmark__sta
ging_web_1 (fab077a6fc9bf74aa4dff5446864c82ac85301f9f833beef12c9680eee2d4ec3): Bind for 0.0.0.0:8080 failed: port is already allocated

Also, I’ve already tried deleting all containers, networks, volumes, etc. I’ve tried both a complete reset of Docker on the instance and tried a completely fresh EC2 instance. Both gave the exact same error.

What Wappler version are you on?

I am running Wappler v3.9.9.

It seems that the ports you want to use are already in use at your server. Is there something else running on it?

Make sure you set the AWS security group you are using to allow for traffic to port 8080.

I got the error even with a completely fresh EC2 instance with nothing yet running on it.

@Dave not sure about the security group settings, will try it.

It is one of the reasons you could see the error (with setting 8080 in the docker-compose.yml file and not in your AWS security group configuration for the user accessing the instance) you are witnessing @Anders

Allowing traffic through port 8080 didn’t help resolve the issue. It’s still the same:

Bind for 0.0.0.0:8080 failed: port is already allocated

Very strange you would think an entirely new Instance and all the above would resolve the issue one way or another. Could it be a local conflict with Docker Desktop? Thinking aloud… Is it worth recreating your Targets? Although I can’t see that making much of a difference… Or removing the Local Target if you have one, try clearing the old Containers out of your Local Docker environment? Again thinking out aloud here…

Really appreciate you taking your time to help me resolve this!

I asked a colleague to try to deploy from his machine and he got the same error for what it’s worth.

I’m relatively new to Docker and AWS so unfortunately don’t have a great deal of experience to go on but will continue to pick my brain and Stack Overflow for alternative answers.

Do you have multiple projects running on the same docker server?

Do you use Traefik for SSL?

No this is the only project running on the Docker server and yes, I use Traefik for SSL (installed using Wappler).

That is the problem then - there is a catch when using Trafiek - you have to leave the project web ports empty as Traefik takes care of all.

It is actually in the docs:

1 Like

Ah thank you so much! I’ll look into this during the day and report back.

Thank you taking your time with this issue, much appreciated!

Removing the assigned port for the web server in target settings resolved all my issues, thank you so much for the help.

However, I was wondering what might have caused this in the first place? The configuration me and my team use did not change, yet this error appeared for the first time last Tuesday. Before that, we had been deploying without issues using Traefik even with the port specified. Did anything change in version 3.9.9 or do you have any other idea of what might have caused this in the first place?