Skip to content

Setup failed during elasticsearch initializaiton: No route to host #32

@djhshih

Description

@djhshih

I followed the setup instructions, but it didn't work out of the box:

$ git clone git@github.com:dfci/matchminer-api.git
$ cd matchminer-api
$ ./setup.sh

I ran into and resolved two errors:

  1. An error due to the mongo executable not being shipped with the mm-mongo container (mongo image). So, I replaced it with mongosh.
  2. An error due to numpy 1.23.3 not being available when the mm-api container tried to run pip install -r requirements.txt.

Resolved these with

--- a/requirements.txt
+++ b/requirements.txt
@@ -91,7 +91,8 @@ nose==1.3.7
     # via
     #   -r requirements.in
     #   oncotreenx
-numpy==1.23.3
+numpy==1.21.6
    # via pandas
 oauth2client==2.0.2
     # via -r requirements.in


--- a/setup.sh
+++ b/setup.sh
@@ -24,7 +24,7 @@ echo "*****************"
 sleep 5

 echo "Add dev user to database to bypass authentication"
-docker-compose exec mm-mongo mongo matchminer --eval 'db.user.replaceOne({
+docker-compose exec mm-mongo mongosh matchminer --eval 'db.user.replaceOne({

But now,

$ ./setup
...
Using Mongosh:          1.6.1
...
 ⠿ Container mm-elastic  Started                                                                [382/530]
[WARNING] settings:
[WARNING] settings: mongodb://mm-mongo:27017/matchminer
/matchminerAPI/cerberus1/cerberus.py:1272: UserWarning: No validation schema is defined for the arguments
 of rule 'consented'
  "'%s'" % '_'.join(method_name.split('_')[2:]))
/matchminerAPI/cerberus1/cerberus.py:1272: UserWarning: No validation schema is defined for the arguments
 of rule 'match'
  "'%s'" % '_'.join(method_name.split('_')[2:]))
/matchminerAPI/cerberus1/cerberus.py:1272: UserWarning: No validation schema is defined for the arguments
 of rule 'normalized'
  "'%s'" % '_'.join(method_name.split('_')[2:]))
/matchminerAPI/cerberus1/cerberus.py:1272: UserWarning: No validation schema is defined for the arguments
 of rule 'unique'
  "'%s'" % '_'.join(method_name.split('_')[2:]))
/usr/local/lib/python3.7/site-packages/cerberus/validator.py:1402: UserWarning: No validation schema is d
efined for the arguments of rule 'consented'
  "'%s'" % method_name.split('_', 2)[-1])
/usr/local/lib/python3.7/site-packages/cerberus/validator.py:1402: UserWarning: No validation schema is d
efined for the arguments of rule 'match'
  "'%s'" % method_name.split('_', 2)[-1])
/usr/local/lib/python3.7/site-packages/cerberus/validator.py:1402: UserWarning: No validation schema is d
efined for the arguments of rule 'normalized'
  "'%s'" % method_name.split('_', 2)[-1])
[WARNING] NO AUTHENTICATION IS ENABLED - SKIPPING HIPAA LOGGING
[WARNING] settings:
[WARNING] settings: mongodb://mm-mongo:27017/matchminer
/usr/local/lib/python3.7/site-packages/eve/flaskapp.py:310: UserWarning: XML setting is deprecated and wi
ll be removed in future release. Please use RENDERERS instead.
  warnings.warn(msg.format("XML"))
[INFO] reset_elasticsearch
[INFO] http://mm-elastic:9200/matchminer
[INFO]
[INFO]
[INFO] delete_elasticsearch_index
[WARNING] DELETE http://mm-elastic:9200/matchminer [status:N/A request:3.052s]
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 159, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py", line 80, in create_connection
    raise err
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py", line 70, in create_connection
    sock.connect(sa)
OSError: [Errno 113] No route to host

Any suggestions?

Additionally, what version of mongo was docker-compose supposed to retrieve?
docker-compose.yml did not specify a version number, and the current matchminer-api setup is apparently not compatible with the latest version of mongo, because it relies on the deprecated mongo executable rather than mongosh.

$ uname -a
Linux durus 6.1.4-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 07 Jan 2023 15:10:07 +0000 x86_64 GNU/Linux
$ docker version
Client:
 Version:           20.10.22
 API version:       1.41
 Go version:        go1.19.4
 Git commit:        3a2c30b63a
 Built:             Tue Dec 20 20:43:40 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server:
 Engine:
  Version:          20.10.22
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.19.4
  Git commit:       42c8b31499
  Built:            Tue Dec 20 20:42:46 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.6.14
  GitCommit:        9ba4b250366a5ddde94bb7c9d1def331423aa323.m
 runc:
  Version:          1.1.4
  GitCommit:
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
$ docker-compose version
Docker Compose version 2.14.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions