<p>In the error message you presented your system is reporting port 443 is already in use. You need to confirm which ports you have in use for other services.</p>

<blockquote>
  <p>listen tcp 0.0.0.0:443: bind: address already in use</p>
</blockquote>

<p>For what it is worth I recommend you use a nginx reverse proxy. Please reference <a href="https://stackoverflow.com/questions/46195852/how-to-run-gitlab-in-docker-container-with-nginx-proxy-over-ssl-with-letsencrypt">https://stackoverflow.com/questions/46195852/how-to-run-gitlab-in-docker-container-with-nginx-proxy-over-ssl-with-letsencrypt</a> for further details.</p>

CC BY-SA 4.0
2019-12-07T02:13:16.330Z
2019-12-07T02:13:16.330Z
Steven K7FAQ
<p>I'm installing <strong>Gitlab</strong> on my server using <strong>docker-compose</strong> based on <a href="https://docs.gitlab.com/omnibus/docker/#install-gitlab-using-docker-compose" rel="noreferrer">Docker Docs</a>.
My SSH port is not the default one (22) and I have changed it to something else like 2228. So the YML file became like this:</p>
<pre><code>web:
  image: 'gitlab/gitlab-ce:latest'
  restart: always
  hostname: 'gitlab.mydomain.com'
  environment:
    GITLAB_OMNIBUS_CONFIG: |
      external_url 'https://gitlab.mydomain.com'
      gitlab_rails['gitlab_shell_ssh_port'] = 2228
  ports:
    - '80:80'
    - '443:443'
    - '2228:22'
  volumes:
    - '/srv/gitlab/config:/etc/gitlab'
    - '/srv/gitlab/logs:/var/log/gitlab'
    - '/srv/gitlab/data:/var/opt/gitlab'
</code></pre>
<p>When I run the <code>docker-compose up -d</code>, I receive this result and errors:</p>
<pre><code>Starting docker_web_1 ...

ERROR: for docker_web_1  a bytes-like object is required, not 'str'

ERROR: for web  a bytes-like object is required, not 'str'
Traceback (most recent call last):
  File &quot;site-packages/docker/api/client.py&quot;, line 261, in _raise_for_status
  File &quot;site-packages/requests/models.py&quot;, line 940, in raise_for_status
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http+docker://localhost/v1.21/containers/9d4483106cf1683f46b5158a9550f9b4375d7c147ecb8b07df533840ad0806b6/start

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File &quot;compose/service.py&quot;, line 625, in start_container
  File &quot;compose/container.py&quot;, line 241, in start
  File &quot;site-packages/docker/utils/decorators.py&quot;, line 19, in wrapped
  File &quot;site-packages/docker/api/container.py&quot;, line 1095, in start
  File &quot;site-packages/docker/api/client.py&quot;, line 263, in _raise_for_status
  File &quot;site-packages/docker/errors.py&quot;, line 31, in create_api_error_from_http_exception
docker.errors.APIError: 500 Server Error: Internal Server Error (&quot;b'driver failed programming external connectivity on endpoint docker_web_1 (9b32d28cc2f635e085e82a2ef9f4d1fd3afc76f7693e279405ada5f61b96d215): Error starting userland proxy: listen tcp 0.0.0.0:443: bind: address already in use'&quot;)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File &quot;bin/docker-compose&quot;, line 6, in &lt;module&gt;
  File &quot;compose/cli/main.py&quot;, line 72, in main
  File &quot;compose/cli/main.py&quot;, line 128, in perform_command
  File &quot;compose/cli/main.py&quot;, line 1107, in up
  File &quot;compose/cli/main.py&quot;, line 1103, in up
  File &quot;compose/project.py&quot;, line 570, in up
  File &quot;compose/parallel.py&quot;, line 112, in parallel_execute
  File &quot;compose/parallel.py&quot;, line 210, in producer
  File &quot;compose/project.py&quot;, line 556, in do
  File &quot;compose/service.py&quot;, line 568, in execute_convergence_plan
  File &quot;compose/service.py&quot;, line 510, in _execute_convergence_start
  File &quot;compose/parallel.py&quot;, line 112, in parallel_execute
  File &quot;compose/parallel.py&quot;, line 210, in producer
  File &quot;compose/service.py&quot;, line 508, in &lt;lambda&gt;
  File &quot;compose/service.py&quot;, line 620, in start_container_if_stopped
  File &quot;compose/service.py&quot;, line 627, in start_container
TypeError: a bytes-like object is required, not 'str'
[5738] Failed to execute script docker-compose
</code></pre>
<p>I'm new in Docker and docker-compose, but I did everything as it is written in the official documentation. May you help me plesae to solve this issue?</p>

CC BY-SA 4.0
2019-12-07T10:42:16.653Z
`listen tcp 0.0.0.0:443: bind: address already in use` It seems that the 443 port on your system is not available. Please check whether this port is available before starting these docker images or choose another port.
030
CC BY-SA 4.0
2020-09-24T19:56:51.420Z
why would this prevent building the image?  I can see that it would impact running a container.
Nicholas Saunders
<docker><docker-compose><gitlab>
Internal Server Error while running docker-compose to install Gitlab
Mohammad Saberi
# Internal Server Error while running docker-compose to install Gitlab

(Asked by: username_0 on 2019-12-06)

I'm installing Gitlab on my server using docker-compose based on Docker Docs.
My SSH port is not the default one (22) and I have changed it to something else like 2228. So the YML file became like this:
web:
  image: 'gitlab/gitlab-ce:latest'
  restart: always
  hostname: 'gitlab.mydomain.com'
  environment:
    GITLAB_OMNIBUS_CONFIG: |
      external_url 'https://gitlab.mydomain.com'
      gitlab_rails['gitlab_shell_ssh_port'] = 2228
  ports:
    - '80:80'
    - '443:443'
    - '2228:22'
  volumes:
    - '/srv/gitlab/config:/etc/gitlab'
    - '/srv/gitlab/logs:/var/log/gitlab'
    - '/srv/gitlab/data:/var/opt/gitlab'

When I run the docker-compose up -d, I receive this result and errors:
Starting docker_web_1 ...

ERROR: for docker_web_1  a bytes-like object is required, not 'str'

ERROR: for web  a bytes-like object is required, not 'str'
Traceback (most recent call last):
  File "site-packages/docker/api/client.py", line 261, in _raise_for_status
  File "site-packages/requests/models.py", line 940, in raise_for_status
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http+docker://localhost/v1.21/containers/9d4483106cf1683f46b5158a9550f9b4375d7c147ecb8b07df533840ad0806b6/start

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "compose/service.py", line 625, in start_container
  File "compose/container.py", line 241, in start
  File "site-packages/docker/utils/decorators.py", line 19, in wrapped
  File "site-packages/docker/api/container.py", line 1095, in start
  File "site-packages/docker/api/client.py", line 263, in _raise_for_status
  File "site-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
docker.errors.APIError: 500 Server Error: Internal Server Error ("b'driver failed programming external connectivity on endpoint docker_web_1 (9b32d28cc2f635e085e82a2ef9f4d1fd3afc76f7693e279405ada5f61b96d215): Error starting userland proxy: listen tcp 0.0.0.0:443: bind: address already in use'")

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "bin/docker-compose", line 6, in 
  File "compose/cli/main.py", line 72, in main
  File "compose/cli/main.py", line 128, in perform_command
  File "compose/cli/main.py", line 1107, in up
  File "compose/cli/main.py", line 1103, in up
  File "compose/project.py", line 570, in up
  File "compose/parallel.py", line 112, in parallel_execute
  File "compose/parallel.py", line 210, in producer
  File "compose/project.py", line 556, in do
  File "compose/service.py", line 568, in execute_convergence_plan
  File "compose/service.py", line 510, in _execute_convergence_start
  File "compose/parallel.py", line 112, in parallel_execute
  File "compose/parallel.py", line 210, in producer
  File "compose/service.py", line 508, in 
  File "compose/service.py", line 620, in start_container_if_stopped
  File "compose/service.py", line 627, in start_container
TypeError: a bytes-like object is required, not 'str'
[5738] Failed to execute script docker-compose

I'm new in Docker and docker-compose, but I did everything as it is written in the official documentation. May you help me plesae to solve this issue?

**Tags:** docker, docker-compose, gitlab

> **Comments:**
> **username_1**: `listen tcp 0.0.0.0:443: bind: address already in use` It seems that the 443 port on your system is not available. Please check whether this port is available before starting these docker images or choose another port.  
> **username_2**: why would this prevent building the image?  I can see that it would impact running a container.  

---

## 1 answers

### Answer by username_3 on 2019-12-07. Score: 4

In the error message you presented your system is reporting port 443 is already in use. You need to confirm which ports you have in use for other services.

> listen tcp 0.0.0.0:443: bind: address already in use

For what it is worth I recommend you use a nginx reverse proxy. Please reference <https://stackoverflow.com/questions/46195852/how-to-run-gitlab-in-docker-container-with-nginx-proxy-over-ssl-with-letsencrypt> for further details.


---

