Syntax Error when deploying Flask App to sever
klongbeard opened this issue · 1 comments
klongbeard commented
Ubuntu: 20.04
Python: 3.8.5
Flask 1.1.2
marshmallow: 3.10.0
SQLAlchemy: 1.3.22
marshmallow-sqlalchemy: 0.24.1
Following this tutorial on setting a Flask app up on a server. Seemingly is all working however I receive a 500 error when attempting to view the server in browser, checking the logs it says the following:
==> /var/log/apache2/error.log <==
[Tue Jan 19 13:03:07.447664 2021] [wsgi:error] [pid 82542:tid 140296339048192] [client 86.25.43.81:50302] mod_wsgi (pid=82542): Failed to exec Python script file '/var/www/ProductService/ProductService.wsgi'.
[Tue Jan 19 13:03:07.447962 2021] [wsgi:error] [pid 82542:tid 140296339048192] [client 86.25.43.81:50302] mod_wsgi (pid=82542): Exception occurred processing WSGI script '/var/www/ProductService/ProductService.wsgi'.
[Tue Jan 19 13:03:07.448121 2021] [wsgi:error] [pid 82542:tid 140296339048192] [client 86.25.43.81:50302] Traceback (most recent call last):
[Tue Jan 19 13:03:07.448247 2021] [wsgi:error] [pid 82542:tid 140296339048192] [client 86.25.43.81:50302] File "/var/www/ProductService/ProductService.wsgi", line 9, in <module>
[Tue Jan 19 13:03:07.448419 2021] [wsgi:error] [pid 82542:tid 140296339048192] [client 86.25.43.81:50302] from ProductService import app as application
[Tue Jan 19 13:03:07.448520 2021] [wsgi:error] [pid 82542:tid 140296339048192] [client 86.25.43.81:50302] File "/var/www/ProductService/ProductService/__init__.py", line 2, in <module>
[Tue Jan 19 13:03:07.448630 2021] [wsgi:error] [pid 82542:tid 140296339048192] [client 86.25.43.81:50302] from flask_marshmallow import Marshmallow
[Tue Jan 19 13:03:07.448733 2021] [wsgi:error] [pid 82542:tid 140296339048192] [client 86.25.43.81:50302] File "/var/www/ProductService/venv/lib/python3.8/site-packages/flask_marshmallow/__init__.py", line 12, in <module>
[Tue Jan 19 13:03:07.448816 2021] [wsgi:error] [pid 82542:tid 140296339048192] [client 86.25.43.81:50302] from marshmallow import fields as base_fields, exceptions, pprint
[Tue Jan 19 13:03:07.448884 2021] [wsgi:error] [pid 82542:tid 140296339048192] [client 86.25.43.81:50302] File "/var/www/ProductService/venv/lib/python3.8/site-packages/marshmallow/__init__.py", line 1, in <module>
[Tue Jan 19 13:03:07.448959 2021] [wsgi:error] [pid 82542:tid 140296339048192] [client 86.25.43.81:50302] from marshmallow.schema import Schema, SchemaOpts
[Tue Jan 19 13:03:07.449046 2021] [wsgi:error] [pid 82542:tid 140296339048192] [client 86.25.43.81:50302] File "/var/www/ProductService/venv/lib/python3.8/site-packages/marshmallow/schema.py", line 132
[Tue Jan 19 13:03:07.449110 2021] [wsgi:error] [pid 82542:tid 140296339048192] [client 86.25.43.81:50302] klass: type,
[Tue Jan 19 13:03:07.449157 2021] [wsgi:error] [pid 82542:tid 140296339048192] [client 86.25.43.81:50302] ^
[Tue Jan 19 13:03:07.449200 2021] [wsgi:error] [pid 82542:tid 140296339048192] [client 86.25.43.81:50302] SyntaxError: invalid syntax
Any help would be greatly appreciated!
peterschutt commented
I responded to your other issue here: marshmallow-code/flask-marshmallow#213 (comment).
As an FYI you're more likely to get prompt help on stackoverflow for this sort of thing.