TruCol / Self-host-GitLab-CI-for-GitHub

Installs your own GitLab CI and runs it on all your GitHub repos, in a single command.
GNU Affero General Public License v3.0
4 stars 3 forks source link

Ensure the resolve the bind: address already in use error. #103

Closed a-t-0 closed 1 year ago

a-t-0 commented 1 year ago

Currently the installation threw an error:

263244687634: Pull complete
Digest: sha256:1d439f1640daab99bb5bb22056a1986c76f32f6041c0c1e0d97971a753d2f27c
Status: Downloaded newer image for gitlab/gitlab-ce:latest
docker: Error response from daemon: driver failed programming external connectivity on endpoint gitlab (13084a1d665cc396e4782059d5bd0bf16e9b1f17e6bd8b4d510d9d31ab3bff16): Error starting userland proxy: listen tcp4 0.0.0.0:443: bind: address already in use.
4cc691d7bab5240dfe0f6a435cfab1f0aa9f40568439a7536220504014cd0890
Error response from daemon: Container 4cc691d7bab5240dfe0f6a435cfab1f0aa9f40568439a7536220504014cd0890 is not running
Error response from daemon: Container 4cc691d7bab5240dfe0f6a435cfab1f0aa9f40568439a7536220504014cd0890 is not running
Error response from daemon: Container 4cc691d7bab5240dfe0f6a435cfab1f0aa9f405684

After the uninstall command was ran.

Determine why this

Error starting userland proxy: listen tcp4 0.0.0.0:443: bind: address already in use.

occured. And resolve it.

Why

Gitlab was (still) running on 0.0.0.0. The gitlab is running/started on 0.0.0.0 or 127.0.0.1 after the stop_docker code. Timed at: group add command.

stop_docker

groupadd: group 'docker' already exists

start_docker
CONTAINER ID   IMAGE                     COMMAND             CREATED         STATUS    PORTS     NAMES
ad15fde73011   gitlab/gitlab-ce:latest   "/assets/wrapper"   8 minutes ago   Created             gitlab

The command used to see when it starts was:

sudo lsof -i -P -n | grep *:*

TODO

a-t-0 commented 1 year ago

Dont do a * delete for all ports, do it with specificity. This is important becasuse the activities also come from user commands. E.g. the ports are included in the --executor = ... command which sets up the GitLab server.

a-t-0 commented 1 year ago

The error does not occur anymore. The way this is dealt with can be improved by parameterising the ports in the gitlab setup command, and in the port activity deletion/termination function(s).