NrgXnat / xnat-docker-compose

Build an XNAT server configuration with Docker Compose
Other
82 stars 85 forks source link

Fresh install crashes immediately upon launch #34

Closed waltman closed 4 years ago

waltman commented 4 years ago

I just did a fresh git-clone of the repo. I cd'd into the directory and ran docker-compose up -d. It downloaded a number of packages and seemed fine, but then it crashed with a python error. Here's the end of the output:

Successfully built 8b880479e1a0                                                      
Successfully tagged xnat-docker-compose_xnat-web:latest                                                                                                                    WARNING: Image for service xnat-web was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Building xnat-nginx
Step 1/3 : FROM nginx:1.12-alpine-perl                                               
1.12-alpine-perl: Pulling from library/nginx
550fe1bea624: Pull complete       
20a55c7b3b0e: Pull complete                                                          
552be5624b14: Pull complete                                                                                                                                                
40fc04944e91: Pull complete                                                          
Digest: sha256:b7970b06de2b70acca1784ab92fb06d60f4f714e901a55b6b5211c22a446dbd2
Status: Downloaded newer image for nginx:1.12-alpine-perl                                                                                                                  
 ---> b6a456f1d7ae                   
Step 2/3 : RUN rm /etc/nginx/conf.d/default.conf                             
 ---> Running in 57caeecfb592
Removing intermediate container 57caeecfb592                                 
 ---> eedecbc82178         
Step 3/3 : COPY nginx.conf /etc/nginx                                                
 ---> 6bb4c0d604d6                                                                   
Successfully built 6bb4c0d604d6                                                                                                                                            
Successfully tagged xnat-docker-compose_xnat-nginx:latest
WARNING: Image for service xnat-nginx was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Creating xnat-docker-compose_xnat-db_1 ... done
Creating xnat-docker-compose_xnat-web_1 ...                                

ERROR: for xnat-docker-compose_xnat-web_1  a bytes-like object is required, not 'str'            

ERROR: for xnat-web  a bytes-like object is required, not 'str'                                                                                                            
Traceback (most recent call last):                                                   
  File "/usr/lib/python3/dist-packages/docker/api/client.py", line 261, in _raise_for_status
    response.raise_for_status()
  File "/usr/lib/python3/dist-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http+docker://localhost/v1.22/containers/6a2f94643b89a7aec22c3c14a129b076b5efd41637081d94e8
3204fdb77de6e8/start                                                                 

During handling of the above exception, another exception occurred:

Traceback (most recent call last):                                                   
  File "/usr/lib/python3/dist-packages/compose/service.py", line 625, in start_container
    container.start()                                                                                                                                                      
  File "/usr/lib/python3/dist-packages/compose/container.py", line 241, in start
    return self.client.start(self.id, **options)
  File "/usr/lib/python3/dist-packages/docker/utils/decorators.py", line 19, in wrapped
    return f(self, resource_id, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/docker/api/container.py", line 1095, in start
    self._raise_for_status(res)
  File "/usr/lib/python3/dist-packages/docker/api/client.py", line 263, in _raise_for_status
    raise create_api_error_from_http_exception(e)
  File "/usr/lib/python3/dist-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation)
docker.errors.APIError: 500 Server Error: Internal Server Error ("b'driver failed programming external connectivity on endpoint xnat-docker-compose_xnat-web_1 (7e4d4088a2e
ce5a1d2ae7f80c4488ebdeb3168072b30599220bb4941fc166369): Error starting userland proxy: listen tcp 0.0.0.0:22: bind: address already in use'")

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/docker-compose", line 11, in <module>
    load_entry_point('docker-compose==1.25.0', 'console_scripts', 'docker-compose')() 
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 72, in main
    command()
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 128, in perform_command
    handler(command, command_options)
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 1107, in up
    to_attach = up(False)
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 1088, in up
    return self.project.up(
  File "/usr/lib/python3/dist-packages/compose/project.py", line 565, in up
    results, errors = parallel.parallel_execute(
  File "/usr/lib/python3/dist-packages/compose/parallel.py", line 112, in parallel_execute
    raise error_to_reraise
  File "/usr/lib/python3/dist-packages/compose/parallel.py", line 210, in producer
    result = func(obj)
  File "/usr/lib/python3/dist-packages/compose/project.py", line 548, in do
    return service.execute_convergence_plan(
  File "/usr/lib/python3/dist-packages/compose/service.py", line 545, in execute_convergence_plan
    return self._execute_convergence_create(
  File "/usr/lib/python3/dist-packages/compose/service.py", line 460, in _execute_convergence_create
    containers, errors = parallel_execute( 
  File "/usr/lib/python3/dist-packages/compose/parallel.py", line 112, in parallel_execute
    raise error_to_reraise
  File "/usr/lib/python3/dist-packages/compose/parallel.py", line 210, in producer
    result = func(obj)
  File "/usr/lib/python3/dist-packages/compose/service.py", line 465, in <lambda>
    lambda service_name: create_and_start(self, service_name.number),
  File "/usr/lib/python3/dist-packages/compose/service.py", line 457, in create_and_start
    self.start_container(container)
 File "/usr/lib/python3/dist-packages/compose/service.py", line 627, in start_container
    if "driver failed programming external connectivity" in ex.explanation:
TypeError: a bytes-like object is required, not 'str'
rherrick commented 4 years ago

This is an error somewhere in docker-compose and/or Python. It looks to be similar to the errors described here: https://github.com/docker/compose/issues/6998

What versions of docker-compose and Docker are you running? I think Docker usually comes packaged with its own version of Python, so what you have installed for that shouldn’t matter, but maybe an update to Docker will fix the issue.

-- Rick Herrick Sr. Programmer/Analyst Neuroinformatics Research Group Washington University School of Medicine Phone: +1 (314) 273-1645

From: Walt Mankowski notifications@github.com Reply-To: NrgXnat/xnat-docker-compose reply@reply.github.com Date: Monday, June 22, 2020 at 8:52 AM To: NrgXnat/xnat-docker-compose xnat-docker-compose@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [NrgXnat/xnat-docker-compose] Fresh install crashes immediately upon launch (#34)

I just did a fresh git-clone of the repo. I cd'd into the directory and ran docker-compose up -d. It downloaded a number of packages and seemed fine, but then it crashed with a python error. Here's the end of the output:

Successfully built 8b880479e1a0

Successfully tagged xnat-docker-compose_xnat-web:latest WARNING: Image for service xnat-web was built because it did not already exist. To rebuild this image you must use docker-compose build or docker-compose up --build.

Building xnat-nginx

Step 1/3 : FROM nginx:1.12-alpine-perl

1.12-alpine-perl: Pulling from library/nginx

550fe1bea624: Pull complete

20a55c7b3b0e: Pull complete

552be5624b14: Pull complete

40fc04944e91: Pull complete

Digest: sha256:b7970b06de2b70acca1784ab92fb06d60f4f714e901a55b6b5211c22a446dbd2

Status: Downloaded newer image for nginx:1.12-alpine-perl

---> b6a456f1d7ae

Step 2/3 : RUN rm /etc/nginx/conf.d/default.conf

---> Running in 57caeecfb592

Removing intermediate container 57caeecfb592

---> eedecbc82178

Step 3/3 : COPY nginx.conf /etc/nginx

---> 6bb4c0d604d6

Successfully built 6bb4c0d604d6

Successfully tagged xnat-docker-compose_xnat-nginx:latest

WARNING: Image for service xnat-nginx was built because it did not already exist. To rebuild this image you must use docker-compose build or docker-compose up --build.

Creating xnat-docker-compose_xnat-db_1 ... done

Creating xnat-docker-compose_xnat-web_1 ...

ERROR: for xnat-docker-compose_xnat-web_1 a bytes-like object is required, not 'str'

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

Traceback (most recent call last):

File "/usr/lib/python3/dist-packages/docker/api/client.py", line 261, in _raise_for_status

response.raise_for_status()

File "/usr/lib/python3/dist-packages/requests/models.py", line 940, in raise_for_status

raise HTTPError(http_error_msg, response=self)

requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http+docker://localhost/v1.22/containers/6a2f94643b89a7aec22c3c14a129b076b5efd41637081d94e8

3204fdb77de6e8/start

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/usr/lib/python3/dist-packages/compose/service.py", line 625, in start_container

container.start()

File "/usr/lib/python3/dist-packages/compose/container.py", line 241, in start

return self.client.start(self.id, **options)

File "/usr/lib/python3/dist-packages/docker/utils/decorators.py", line 19, in wrapped

return f(self, resource_id, *args, **kwargs)

File "/usr/lib/python3/dist-packages/docker/api/container.py", line 1095, in start

self._raise_for_status(res)

File "/usr/lib/python3/dist-packages/docker/api/client.py", line 263, in _raise_for_status

raise create_api_error_from_http_exception(e)

File "/usr/lib/python3/dist-packages/docker/errors.py", line 31, in create_api_error_from_http_exception

raise cls(e, response=response, explanation=explanation)

docker.errors.APIError: 500 Server Error: Internal Server Error ("b'driver failed programming external connectivity on endpoint xnat-docker-compose_xnat-web_1 (7e4d4088a2e

ce5a1d2ae7f80c4488ebdeb3168072b30599220bb4941fc166369): Error starting userland proxy: listen tcp 0.0.0.0:22: bind: address already in use'")

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/usr/bin/docker-compose", line 11, in

load_entry_point('docker-compose==1.25.0', 'console_scripts', 'docker-compose')()

File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 72, in main

command()

File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 128, in perform_command

handler(command, command_options)

File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 1107, in up

to_attach = up(False)

File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 1088, in up

return self.project.up(

File "/usr/lib/python3/dist-packages/compose/project.py", line 565, in up

results, errors = parallel.parallel_execute(

File "/usr/lib/python3/dist-packages/compose/parallel.py", line 112, in parallel_execute

raise error_to_reraise

File "/usr/lib/python3/dist-packages/compose/parallel.py", line 210, in producer

result = func(obj)

File "/usr/lib/python3/dist-packages/compose/project.py", line 548, in do

return service.execute_convergence_plan(

File "/usr/lib/python3/dist-packages/compose/service.py", line 545, in execute_convergence_plan

return self._execute_convergence_create(

File "/usr/lib/python3/dist-packages/compose/service.py", line 460, in _execute_convergence_create

containers, errors = parallel_execute(

File "/usr/lib/python3/dist-packages/compose/parallel.py", line 112, in parallel_execute

raise error_to_reraise

File "/usr/lib/python3/dist-packages/compose/parallel.py", line 210, in producer

result = func(obj)

File "/usr/lib/python3/dist-packages/compose/service.py", line 465, in

lambda service_name: create_and_start(self, service_name.number),

File "/usr/lib/python3/dist-packages/compose/service.py", line 457, in create_and_start

self.start_container(container)

File "/usr/lib/python3/dist-packages/compose/service.py", line 627, in start_container

if "driver failed programming external connectivity" in ex.explanation:

TypeError: a bytes-like object is required, not 'str'

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/NrgXnat/xnat-docker-compose/issues/34, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAC2ZUPR2K6DLXTTMI6KUCLRX5O2LANCNFSM4OETUZOQ.


The materials in this message are private and may contain Protected Healthcare Information or other information of a sensitive nature. If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.

waltman commented 4 years ago
$ docker version
Client:
 Version:           19.03.8
 API version:       1.40
 Go version:        go1.13.8
 Git commit:        afacb8b7f0
 Built:             Wed Mar 11 23:42:35 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          19.03.8
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.8
  Git commit:       afacb8b7f0
  Built:            Wed Mar 11 22:48:33 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.3.3-0ubuntu2
  GitCommit:        
 runc:
  Version:          spec: 1.0.1-dev
  GitCommit:        
 docker-init:
  Version:          0.18.0
  GitCommit:        
$ docker-compose version 
docker-compose version 1.25.0, build unknown
docker-py version: 4.1.0
CPython version: 3.8.2
OpenSSL version: OpenSSL 1.1.1f  31 Mar 2020

I've seen that error before on code that had been ported from python 2 to 3. It looks similar to what's being reported at the link you pasted.

rherrick commented 4 years ago

The versions I have for docker are the same other than the OS/arch and containerd values. The version I have for docker-compose is a bit different:

$ docker-compose version docker-compose version 1.25.5, build 8a1c60f6 docker-py version: 4.1.0 CPython version: 3.7.5 OpenSSL version: OpenSSL 1.1.1f 31 Mar 2020

And I’m currently running XNAT from the docker-compose project (albeit on a different feature branch) without issue.

Also, note the location of the error that you’re seeing:

File "/usr/lib/python3/dist-packages/compose/service.py", line 627, in start_container if "driver failed programming external connectivity" in ex.explanation:

And the location of the error in the docker-compose issue report:

File "compose/service.py", line 627, in start_container TypeError: a bytes-like object is required, not 'str' [87400] Failed to execute script docker-compose

I’m guessing this is an issue that was in 1.25.0-rc4 (the version of docker-compose in the issue report), still there in 1.25.0 (your docker-compose version), and fixed before 1.25.5 (my docker-compose version).

-- Rick Herrick Sr. Programmer/Analyst Neuroinformatics Research Group Washington University School of Medicine Phone: +1 (314) 273-1645

From: Walt Mankowski notifications@github.com Reply-To: NrgXnat/xnat-docker-compose reply@reply.github.com Date: Monday, June 22, 2020 at 9:18 AM To: NrgXnat/xnat-docker-compose xnat-docker-compose@noreply.github.com Cc: "Herrick, Rick" jrherrick@wustl.edu, Comment comment@noreply.github.com Subject: Re: [NrgXnat/xnat-docker-compose] Fresh install crashes immediately upon launch (#34)

$ docker version

Client:

Version: 19.03.8

API version: 1.40

Go version: go1.13.8

Git commit: afacb8b7f0

Built: Wed Mar 11 23:42:35 2020

OS/Arch: linux/amd64

Experimental: false

Server:

Engine:

Version: 19.03.8

API version: 1.40 (minimum version 1.12)

Go version: go1.13.8

Git commit: afacb8b7f0

Built: Wed Mar 11 22:48:33 2020

OS/Arch: linux/amd64

Experimental: false

containerd:

Version: 1.3.3-0ubuntu2

GitCommit:

runc:

Version: spec: 1.0.1-dev

GitCommit:

docker-init:

Version: 0.18.0

GitCommit:

$ docker-compose version

docker-compose version 1.25.0, build unknown

docker-py version: 4.1.0

CPython version: 3.8.2

OpenSSL version: OpenSSL 1.1.1f 31 Mar 2020

I've seen that error before on code that had been ported from python 2 to 3. It looks similar to what's being reported at the link you pasted.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/NrgXnat/xnat-docker-compose/issues/34#issuecomment-647548524, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAC2ZUOTOELUGCT4TWRIGLDRX5RZZANCNFSM4OETUZOQ.


The materials in this message are private and may contain Protected Healthcare Information or other information of a sensitive nature. If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.

waltman commented 4 years ago

I followed the instructions at https://docs.docker.com/compose/install/. That downloaded 1.26.0 and it seems to have fixed that problem. Thanks! But now I've got a second issue:

 docker-compose up -d                
Creating network "xnat-docker-compose_default" with the default driver
Creating xnat-docker-compose_xnat-db_1 ... done
Creating xnat-docker-compose_xnat-web_1 ... 
Creating xnat-docker-compose_xnat-web_1 ... error

ERROR: for xnat-docker-compose_xnat-web_1  Cannot start service xnat-web: driver failed programming external connectivity on endpoint xnat-docker-compose_xnat-web_1 (5fd848a6b54a98010f62ce1271828d5f000964921d43421518daae16e2df943d): Error starting userland proxy: listen tcp 0.0.0.0:22: bind: address already in use

ERROR: for xnat-web  Cannot start service xnat-web: driver failed programming external connectivity on endpoint xnat-docker-compose_xnat-web_1 (5fd848a6b54a98010f62ce1271828d5f000964921d43421518daae16e2df943d): Error starting userland proxy: listen tcp 0.0.0.0:22: bind: address already in use
ERROR: Encountered errors while bringing up the project.

Is it ok to remap 22 to an other port, say 2222?

rherrick commented 4 years ago

Just delete the entry for port 22 entirely, it’s not necessary. See also herehttps://github.com/NrgXnat/xnat-docker-compose/issues/32. If you need to access the xnat-web container directly, the better way to do it is:

$ docker exec --interactive --tty xnat-web bash bash-4.4#

I’m going to make this change in the master branch right now actually.

-- Rick Herrick Sr. Programmer/Analyst Neuroinformatics Research Group Washington University School of Medicine Phone: +1 (314) 273-1645

From: Walt Mankowski notifications@github.com Reply-To: NrgXnat/xnat-docker-compose reply@reply.github.com Date: Monday, June 22, 2020 at 10:19 AM To: NrgXnat/xnat-docker-compose xnat-docker-compose@noreply.github.com Cc: "Herrick, Rick" jrherrick@wustl.edu, Comment comment@noreply.github.com Subject: Re: [NrgXnat/xnat-docker-compose] Fresh install crashes immediately upon launch (#34)

I followed the instructions at https://docs.docker.com/compose/install/. That downloaded 1.26.0 and it seems to have fixed that problem. Thanks! But now I've got a second issue:

docker-compose up -d

Creating network "xnat-docker-compose_default" with the default driver

Creating xnat-docker-compose_xnat-db_1 ... done

Creating xnat-docker-compose_xnat-web_1 ...

Creating xnat-docker-compose_xnat-web_1 ... error

ERROR: for xnat-docker-compose_xnat-web_1 Cannot start service xnat-web: driver failed programming external connectivity on endpoint xnat-docker-compose_xnat-web_1 (5fd848a6b54a98010f62ce1271828d5f000964921d43421518daae16e2df943d): Error starting userland proxy: listen tcp 0.0.0.0:22: bind: address already in use

ERROR: for xnat-web Cannot start service xnat-web: driver failed programming external connectivity on endpoint xnat-docker-compose_xnat-web_1 (5fd848a6b54a98010f62ce1271828d5f000964921d43421518daae16e2df943d): Error starting userland proxy: listen tcp 0.0.0.0:22: bind: address already in use

ERROR: Encountered errors while bringing up the project.

Is it ok to remap 22 to an other port, say 2222?

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/NrgXnat/xnat-docker-compose/issues/34#issuecomment-647585258, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAC2ZUO4DHUPH3XTJDGOF23RX5ZBVANCNFSM4OETUZOQ.


The materials in this message are private and may contain Protected Healthcare Information or other information of a sensitive nature. If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.