On a related note, my attempt to fix this bug was thrown off by the fact that when the webpage says that a new deploy is live, it seems that it is actually the previous deploy that is used to serve requests for a minute or two afterwards.
I hope this information is helpful. If it’s me who have misunderstood something, please let me know.
SQLAlchemy >=1.4 dropped support for postgres:// in favor of postgresql://. This causes an issue with Render supplied database connection strings (as well as other cloud platform Postgres providers). There’s futher discussion in this GitHub issue: https://github.com/sqlalchemy/sqlalchemy/issues/6083
A workaround for this could be to update the connection string in code, something like:
import osrender_database_uri = os.getenv("DATABASE_URL") # or the env var containing your connection stringif render_database_uri.startswith("postgres://"): database_uri = uri.replace("postgres://", "postgresql://", 1)# then use database_uri with SQLAlchemy