I've been battling with this for an hour now, and can't seem to figure out what's going on...
I just deployed my app, and everything works fine - except for SQLAlchemy database operations. When i go to register a new user (or login, or anything else that uses a SQLa model), i get a 500 Server Error front-end, and the KeyError pasted in the title in my error log (number changes every time).
Here's a full stack trace, thanks in advance! Looking forward to getting things up and running:
2018-04-20 20:05:05,876: Traceback (most recent call last):
2018-04-20 20:05:05,876: File "/home/dellitsni/.virtualenvs/konsent_3/lib/python3.5/site-packages/sqlalchemy/util/_collections.py", line 999, in __call__
2018-04-20 20:05:05,876: return self.registry[key]
2018-04-20 20:05:05,876: KeyError: 140291498702720
2018-04-20 20:05:05,876:
2018-04-20 20:05:05,876: During handling of the above exception, another exception occurred:
2018-04-20 20:05:05,877:
2018-04-20 20:05:05,877: Traceback (most recent call last):
2018-04-20 20:05:05,877: File "/home/dellitsni/.virtualenvs/konsent_3/lib/python3.5/site-packages/flask/app.py", line 1982, in wsgi_app
2018-04-20 20:05:05,877: response = self.full_dispatch_request()
2018-04-20 20:05:05,877: File "/home/dellitsni/.virtualenvs/konsent_3/lib/python3.5/site-packages/flask/app.py", line 1614, in full_dispatch_request
2018-04-20 20:05:05,877: rv = self.handle_user_exception(e)
2018-04-20 20:05:05,877: File "/home/dellitsni/.virtualenvs/konsent_3/lib/python3.5/site-packages/flask/app.py", line 1517, in handle_user_exception
2018-04-20 20:05:05,877: reraise(exc_type, exc_value, tb)
2018-04-20 20:05:05,877: File "/home/dellitsni/.virtualenvs/konsent_3/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
2018-04-20 20:05:05,878: raise value
2018-04-20 20:05:05,878: File "/home/dellitsni/.virtualenvs/konsent_3/lib/python3.5/site-packages/flask/app.py", line 1612, in full_dispatch_request
2018-04-20 20:05:05,878: rv = self.dispatch_request()
2018-04-20 20:05:05,878: File "/home/dellitsni/.virtualenvs/konsent_3/lib/python3.5/site-packages/flask/app.py", line 1598, in dispatch_request
2018-04-20 20:05:05,878: return self.view_functions[rule.endpoint](**req.view_args)
2018-04-20 20:05:05,878: File "/home/dellitsni/Konsent/konsent/__init__.py", line 321, in register
2018-04-20 20:05:05,878: user_exists = User.query.filter(User.username == username).first()
2018-04-20 20:05:05,878: File "/home/dellitsni/.virtualenvs/konsent_3/lib/python3.5/site-packages/flask_sqlalchemy/__init__.py", line 514, in __get__
2018-04-20 20:05:05,878: return type.query_class(mapper, session=self.sa.session())
2018-04-20 20:05:05,878: File "/home/dellitsni/.virtualenvs/konsent_3/lib/python3.5/site-packages/sqlalchemy/orm/scoping.py", line 74, in __call__
2018-04-20 20:05:05,879: return self.registry()
2018-04-20 20:05:05,879: File "/home/dellitsni/.virtualenvs/konsent_3/lib/python3.5/site-packages/sqlalchemy/util/_collections.py", line 1001, in __call__
2018-04-20 20:05:05,879: return self.registry.setdefault(key, self.createfunc())
2018-04-20 20:05:05,879: File "/home/dellitsni/.virtualenvs/konsent_3/lib/python3.5/site-packages/sqlalchemy/orm/session.py", line 2950, in __call__
2018-04-20 20:05:05,879: return self.class_(**local_kw)
2018-04-20 20:05:05,879: File "/home/dellitsni/.virtualenvs/konsent_3/lib/python3.5/site-packages/flask_sqlalchemy/__init__.py", line 142, in __init__
2018-04-20 20:05:05,879: track_modifications = app.config['SQLALCHEMY_TRACK_MODIFICATIONS']
2018-04-20 20:05:05,879: KeyError: 'SQLALCHEMY_TRACK_MODIFICATIONS'