Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with 'make start' on Ubuntu 23.04 with NGINX Proxy Manage as Terminator #3478

Closed
electr0nnn opened this issue Jan 26, 2024 · 4 comments · Fixed by #3495
Closed

Issues with 'make start' on Ubuntu 23.04 with NGINX Proxy Manage as Terminator #3478

electr0nnn opened this issue Jan 26, 2024 · 4 comments · Fixed by #3495
Assignees

Comments

@electr0nnn
Copy link

electr0nnn commented Jan 26, 2024

0.0.0.0:8042 Failed to bind, gateway-1 failed to start

I've followed all the docs, and created/used both docker-compose.override.yml & .env.override\

Here are those files...

SHELLHUB_HTTP_PORT=8042
SHELLHUB_HTTPS_PORT=4342
SHELLHUB_SSH_PORT=2242
version: '3.7'
services:
  gateway:
      ports:
       - "127.0.0.1:8042:80"
  mongo:
    volumes:
      - /usr/local/mogo/data:/data/db

Make Start displays the following

Starting ShellHub in production mode...
INFO: Loading ./.env.override
WARN[0000] The "SHELLHUB_TELEMETRY" variable is not set. Defaulting to a blank string.
WARN[0000] The "SHELLHUB_TELEMETRY_SCHEDULE" variable is not set. Defaulting to a blank string. 
WARN[0000] The "SHELLLHUB_ANNOUNCEMENTS" variable is not set. Defaulting to a blank string.  
[+] Running 6/7

â� �  Container shellhub-ui-1       Running                                   0.0s           
â� �  Container shellhub-ssh-1      Running                                   0.0s           
â� �  Container shellhub-redis-1    Running                                   0.0s           
â� �  Container shellhub-mongo-1    Running                                   0.0s           
â� �  Container shellhub-api-1      Running                                   0.0s           
â� �  Container shellhub-cli-1      Running                                   0.0s           
â ¼ Container shellhub-gateway-1  Startin...                                0.4s            
Error response from daemon: driver failed programming external connectivity on endpoint shellhub-gateway-1 (d01152a542aae4117497c103a9e8527fc00c0b4d768aa6495e4295ec8b0f8e13): Error starting userland proxy: listen tcp4 0.0.0.0:8042: bind: address already in use make: *** [Makefile:43: start] Error 

I tried this without SHELLHUB_HTTP_PORT, and it essentially did the same thing, is there something I am missing to where shellhub-gateway-1 isn't able to start? I do not have anything bound to 8042 except for this specific container, etc.
I also removed and started from scratch literally everything before attempting again with 8042 instead of 80

I did input the NGINX Proxy Configs into my NGINX Proxy Manager container im running that is in charge of all my other stuff.

Do I have to modify NGINX.conf in shellhub/gateway/ ?

Edition

Community

Version

v0.14.1

@electr0nnn
Copy link
Author

Sorry if the Issue setup is kind've jank, I am used to writing emails not creating issues on GitHub haha

@henrybarreto
Copy link
Member

Hi, @electr0nnn.

I have been working on your issue, and I think I have reached a solution.

In #3495, we have defined an env variable dedicated to the gateway's bind address. This way, you could set what network interface you would like to bind, avoiding this port's error.

@henrybarreto
Copy link
Member

To check by yourself, you could apply this diff. It should allow you to start the ShellHub without problem.

diff --git a/docker-compose.yml b/docker-compose.yml
index 082d77bb..cbd2d5f9 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -89,7 +89,7 @@ services:
       - api
       - ui
     ports:
-      - ${SHELLHUB_HTTP_PORT}:80
+      - 127.0.0.1:${SHELLHUB_HTTP_PORT}:80
     networks:
       - shellhub
   cli:

@electr0nnn
Copy link
Author

Now I am getting

validating /root/git/shellhub/docker-compose.override.yml: services.gateway.ports array items[0,1] must be unique
make: *** [Makefile:43: start] Error 15

I have this as my .env.override & docker-compose.override.yml

docker-compose.override.yml
version: '3.7'
services:
gateway:
ports:
- "${SHELLHUB_BIND_ADDRESS}:${SHELLHUB_HTTP_PORT}:80"
mongo:
volumes:
- /usr/local/mongo/data:/data/db

When I change :80 to :8042 it sort of works but says the port is already allocated which is false because I haven't even used it yet, same if I make it different from SHELLHUB_HTTP_PORT.

.env.override
SHELLHUB_SSH_PORT=2242
SHELLHUB_HTTP_PORT=8042
SHELLHUB_HTTPS_PORT=4442
SHELLHUB_BIND_ADDRESS=127.0.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants