databio / bedhost

API and UI for BEDbase
http://api.bedbase.org
BSD 2-Clause "Simplified" License
2 stars 1 forks source link

infinite loop #9

Closed nsheff closed 5 years ago

nsheff commented 5 years ago

when running the docker command:

Cannot connect to database back end. Aborting startup.
[2019-10-29 11:58:50 +0000] [127] [INFO] Booting worker with pid: 127
email-validator not installed, email fields will be treated as str.
To install, run: pip install email-validator
[2019-10-29 11:58:50 +0000] [121] [INFO] Worker exiting (pid: 121)
{"loglevel": "info", "workers": 8, "bind": "0.0.0.0:8000", "workers_per_core": 1.0, "host": "0.0.0.0", "
port": "8000"}
Cannot connect to database back end. Aborting startup.
email-validator not installed, email fields will be treated as str.
To install, run: pip install email-validator
email-validator not installed, email fields will be treated as str.
To install, run: pip install email-validator
[2019-10-29 11:58:50 +0000] [128] [INFO] Booting worker with pid: 128
[2019-10-29 11:58:51 +0000] [122] [INFO] Worker exiting (pid: 122)
{"loglevel": "info", "workers": 8, "bind": "0.0.0.0:8000", "workers_per_core": 1.0, "host": "0.0.0.0", "
port": "8000"}
Cannot connect to database back end. Aborting startup.
email-validator not installed, email fields will be treated as str.
To install, run: pip install email-validator
[2019-10-29 11:58:51 +0000] [129] [INFO] Booting worker with pid: 129
[2019-10-29 11:58:51 +0000] [123] [INFO] Worker exiting (pid: 123)
{"loglevel": "info", "workers": 8, "bind": "0.0.0.0:8000", "workers_per_core": 1.0, "host": "0.0.0.0", "
port": "8000"}
Cannot connect to database back end. Aborting startup.
[2019-10-29 11:58:51 +0000] [124] [INFO] Worker exiting (pid: 124)
{"loglevel": "info", "workers": 8, "bind": "0.0.0.0:8000", "workers_per_core": 1.0, "host": "0.0.0.0", "
port": "8000"}
Cannot connect to database back end. Aborting startup.
[2019-10-29 11:58:51 +0000] [130] [INFO] Booting worker with pid: 130
email-validator not installed, email fields will be treated as str.
To install, run: pip install email-validator
email-validator not installed, email fields will be treated as str.
To install, run: pip install email-validator
[2019-10-29 11:58:51 +0000] [131] [INFO] Booting worker with pid: 131
[2019-10-29 11:58:51 +0000] [125] [INFO] Worker exiting (pid: 125)
{"loglevel": "info", "workers": 8, "bind": "0.0.0.0:8000", "workers_per_core": 1.0, "host": "0.0.0.0", "
port": "8000"}
Cannot connect to database back end. Aborting startup.
...

(it goes on forever)

oddodaoddo commented 5 years ago

What does your config.yaml say about database host? Is elastic up and running?

nsheff commented 5 years ago

yeah, it's running, but apparently not connecting.

I changed config to:

path_config:
  bedstat_pipeline_output_path: /home/nsheff/code/bedstat/output/results_pipeline

database:
  host : localhost

server:
  host: 0.0.0.0
  port: 8000

But my point is that even if it can't connect, it shouldn't loop infinitely...

nsheff commented 5 years ago

Ok I was able to get it to work! can't explain the infinite loop though.

oddodaoddo commented 5 years ago

Ah, OK - yes, I agree. Not sure what in the code makes it do that since there are no loops in the code.

oddodaoddo commented 5 years ago

I tested the setup in the following two instances, WITHOUT elasticsearch running (either in local or docker form):

  1. Start server with uvicorn from command line: It looped 5 times and quit. This is probably a feature of the Python's elasticsearch-dsl module - to try and connect a few times before quitting.
  2. Start server with docker command: I found this issue https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker/issues/13