OpenMined / PyGrid-deprecated---see-PySyft-

A Peer-to-peer Platform for Secure, Privacy-preserving, Decentralized Data Science
Apache License 2.0
616 stars 216 forks source link

Old Werkzeug version on requirements making dev server not starting #585

Closed pedroespindula closed 4 years ago

pedroespindula commented 4 years ago

Description

When I cloned the project, installed all the dependencies and tried to start dev-server, it showed the following stack trace:

[2020-06-19 16:19:21 -0300] [1734739] [INFO] Starting gunicorn 19.9.0
[2020-06-19 16:19:21 -0300] [1734739] [INFO] Listening at: http://127.0.0.1:5000 (1734739)
[2020-06-19 16:19:21 -0300] [1734739] [INFO] Using worker: flask_sockets.worker
[2020-06-19 16:19:21 -0300] [1734739] [INFO] Server is ready. Spawning PyGrid Gateway workers
/usr/lib/python3.8/os.py:1023: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used
  return io.open(fd, *args, **kwargs)
[2020-06-19 16:19:21 -0300] [1734742] [INFO] Booting worker with pid: 1734742
[2020-06-19 16:19:21 -0300] [1734742] [INFO] Worker spawned (pid: 1734742)
[2020-06-19 16:19:21 -0300] [1734742] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/home/pedro/.local/lib/python3.8/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
    worker.init_process()
  File "/home/pedro/.local/lib/python3.8/site-packages/gunicorn/workers/ggevent.py", line 203, in init_process
    super(GeventWorker, self).init_process()
  File "/home/pedro/.local/lib/python3.8/site-packages/gunicorn/workers/base.py", line 129, in init_process
    self.load_wsgi()
  File "/home/pedro/.local/lib/python3.8/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/home/pedro/.local/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/home/pedro/.local/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
    return self.load_wsgiapp()
  File "/home/pedro/.local/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/home/pedro/.local/lib/python3.8/site-packages/gunicorn/util.py", line 362, in import_app
    app = eval(obj, vars(mod))
  File "<string>", line 1, in <module>
  File "/home/pedro/repos/data-science/python/openmined/PyGrid/grid/app/__init__.py", line 58, in create_app
    app = Flask(__name__)
  File "/home/pedro/.local/lib/python3.8/site-packages/flask/app.py", line 601, in __init__
    self.add_url_rule(
  File "/home/pedro/.local/lib/python3.8/site-packages/flask/app.py", line 98, in wrapper_func
    return f(self, *args, **kwargs)
  File "/home/pedro/.local/lib/python3.8/site-packages/flask/app.py", line 1277, in add_url_rule
    self.url_map.add(rule)
  File "/home/pedro/.local/lib/python3.8/site-packages/werkzeug/routing.py", line 1386, in add
    rule.bind(self)
  File "/home/pedro/.local/lib/python3.8/site-packages/werkzeug/routing.py", line 730, in bind
    self.compile()
  File "/home/pedro/.local/lib/python3.8/site-packages/werkzeug/routing.py", line 794, in compile
    self._build = self._compile_builder(False).__get__(self, None)
  File "/home/pedro/.local/lib/python3.8/site-packages/werkzeug/routing.py", line 945, in _compile_builder
    code = compile(module, "<werkzeug routing>", "exec")
TypeError: required field "type_ignores" missing from Module
[2020-06-19 16:19:21 -0300] [1734742] [INFO] Worker exiting (pid: 1734742)
[2020-06-19 16:19:21 -0300] [1734739] [INFO] Shutting down: Master
[2020-06-19 16:19:21 -0300] [1734739] [INFO] Reason: Worker failed to boot.

How to Reproduce

  1. Clone the project;
  2. Install requirements.txt with pip;
  3. Run ./dev-server.sh.

Expected Behavior

The dev-server should run normally.

Additional Context

Flask, on Python 3.8 needs dependency werkzeug to have a version >= 0.15.5

System Information

Fix

Currently on requirements.txt, werkzeug dependency version is equal to 0.15.3. Bumping the version of this dependency to 0.15.5 fixes this bug.

pedroespindula commented 4 years ago

I will submit a PR with this fix

monuelo commented 4 years ago

Well noticed, @pedroespindula. Thanks for that! :rocket: