monarch-initiative / biolink-api

API for linked biological knowledge
https://api.monarchinitiative.org/api/
BSD 3-Clause "New" or "Revised" License
64 stars 25 forks source link

Gunicorn cryptically fails when a remote resource fails to load at startup #272

Open kshefchek opened 5 years ago

kshefchek commented 5 years ago

Steps to reproduce:

Give bad url to ontobio yaml config, eg: owlsim2: url: "https://httpstat.us/404" timeout: 10

Start biolink with gunicorn, eg: gunicorn -k gevent --log-level=info --timeout 90 --worker-connections 5 --bind 127.0.0.1:8888 wsgi:app

Biolink cycles through starting/stopping, with the logs:

[2019-04-29 12:37:53 -0700] [16283] [INFO] Starting gunicorn 19.9.0
[2019-04-29 12:37:53 -0700] [16283] [INFO] Listening at: http://127.0.0.1:8888 (16283)
[2019-04-29 12:37:53 -0700] [16283] [INFO] Using worker: gevent
[2019-04-29 12:37:53 -0700] [16286] [INFO] Booting worker with pid: 16286
2019-04-29 12:37:55,926 - root - INFO - LOADING FROM: /opt/biolink-api/venv/lib/python3.6/site-packages/ontobio/config.yaml
2019-04-29 12:37:55,937 - root - INFO - Using pre-loaded object: <ontobio.config.Config object at 0x7efc9b3f2518>
2019-04-29 12:37:55,937 - root - INFO - Using pre-loaded object: <ontobio.config.Config object at 0x7efc9b3f2518>
/opt/biolink-api/venv/lib/python3.6/site-packages/flask_limiter/extension.py:640: UserWarning: global_limits was a badly name configuration since it is actually a default limit and not a  globally shared limit. Use default_limits if you want to provide a default or use application_limits  if you intend to really have a global shared limit
  " if you intend to really have a global shared limit", UserWarning
[2019-04-29 12:37:56 -0700] [16283] [INFO] Shutting down: Master
[2019-04-29 12:37:56 -0700] [16283] [INFO] Reason: Worker failed to boot.

This is likely logging issues in ontobio (likely code I wrote), but we should also make sure BioLink has informative logging for these cases.