-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.15.0 creates an issue during initialization (python 3.8, aws beanstalk graviton) #261
Comments
Seeing the same issue on our end. |
Hi there, thanks for reporting this! Could you also let me know the version numbers of the relevant packages you're using? |
Hi @sirosen, i have the same Problem, i think it is related with this Update: https://github.com/sqlalchemy/sqlalchemy/releases/tag/rel_2_0_9 Because this change got also Backported to v1.4.48. |
|
|
It seems very likely that most of these issues stem from the fact that support for flask-sqlalchemy<3 was dropped. This was not correctly documented in the changelog before (sorry!), which has been fixed in the repo and will update on readthedocs with the next release. There are two comments here which indicate flask-sqlalchemy v2, which supports this guess. I have pretty limited availability the next few days to respond or work on things, so I'm just going to brain dump some thoughts (hopefully informative and uncontroversial):
That last point is not meant to put blame on anyone seeing problems -- if someone is having a bad time because this broke their app I'm genuinely sorry -- but to help make sure that folks walk away with the right conclusions. If you're not pinning dependencies, you're going to experience breakage sooner or later. |
I've been able to reproduce the initial report using flask-sqlalchemy 2.5.1, and confirm that it's fixed with flask-sqlalchemy 3.0.3. Here's my reproducer for reference: import flask
from flask_marshmallow import Marshmallow
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
ma = Marshmallow()
def create_app() -> flask.Flask:
app = flask.Flask("extapp")
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///:memory:"
db.init_app(app)
ma.init_app(app)
return app
app = create_app() |
The recent release of flask-marshmallow caused my processes in AWS beanstalk to fail with the following errors:
| 2023-04-05T22:49:58.290+03:00 | Apr 5 19:49:58 ip-172-31-46-77 web: self.SQLAlchemySchema.OPTIONS_CLASS.session = db.session
| 2023-04-05T22:49:58.290+03:00 | Apr 5 19:49:58 ip-172-31-46-77 web: AttributeError: '_SQLAlchemyState' object has no attribute 'session'
The issue is resolved once I locked version 0.14.0 in my pipfile:
flask-marshmallow = "==0.14.0"
This is what I think is relevant out of my app init code:
Fuller call stack:
The text was updated successfully, but these errors were encountered: