Hi, I have been maintaining a Flask web app for many years and recently had to make some edits due to the Haggis switch. I have two web apps: one is a basic app that is working fine, but the other, which I'll call MYAPP, is currently down due to an issue with Flask and Flask-SQLAlchemy. I'm completely stuck on this.
Here’s the error log:
2025-01-28 19:01:06,255: [2025-01-28 19:01:06,181] ERROR in app: Exception on /pingtest [GET]
2025-01-28 19:01:06,255: Traceback (most recent call last):
2025-01-28 19:01:06,256: File "/home/MYAPP/.local/lib/python3.7/site-packages/flask/app.py", line 1982, in wsgi_app
2025-01-28 19:01:06,257: response = self.full_dispatch_request()
2025-01-28 19:01:06,257: File "/home/MYAPP/.local/lib/python3.7/site-packages/flask/app.py", line 1607, in full_dispatch_request
2025-01-28 19:01:06,258: self.try_trigger_before_first_request_functions()
2025-01-28 19:01:06,258: File "/home/MYAPP/.local/lib/python3.7/site-packages/flask/app.py", line 1654, in try_trigger_before_first_request_functions
2025-01-28 19:01:06,258: func()
2025-01-28 19:01:06,258: File "/home/MYAPP/mysite/main.py", line 1859, in create_tables
2025-01-28 19:01:06,259: db.create_all()
2025-01-28 19:01:06,259: File "/home/MYAPP/.local/lib/python3.7/site-packages/flask_sqlalchemy/__init__.py", line 946, in create_all
2025-01-28 19:01:06,259: self._execute_for_all_tables(app, bind, 'create_all')
2025-01-28 19:01:06,259: File "/home/MYAPP/.local/lib/python3.7/site-packages/flask_sqlalchemy/__init__.py", line 938, in _execute_for_all_tables
2025-01-28 19:01:06,259: op(bind=self.get_engine(app, bind), **extra)
2025-01-28 19:01:06,260: File "/home/MYAPP/.local/lib/python3.7/site-packages/flask_sqlalchemy/__init__.py", line 880, in get_engine
2025-01-28 19:01:06,260: return connector.get_engine()
2025-01-28 19:01:06,260: File "/home/MYAPP/.local/lib/python3.7/site-packages/flask_sqlalchemy/__init__.py", line 540, in get_engine
2025-01-28 19:01:06,260: self._sa.apply_driver_hacks(self._app, info, options)
2025-01-28 19:01:06,260: File "/home/MYAPP/.local/lib/python3.7/site-packages/flask_sqlalchemy/__init__.py", line 845, in apply_driver_hacks
2025-01-28 19:01:06,261: info.database = os.path.join(app.root_path, info.database)
2025-01-28 19:01:06,261: AttributeError: can't set attribute