Skip to content
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

Working outside of request context. #465

Open
mb7419 opened this issue Oct 21, 2024 · 0 comments
Open

Working outside of request context. #465

mb7419 opened this issue Oct 21, 2024 · 0 comments

Comments

@mb7419
Copy link

mb7419 commented Oct 21, 2024

I upgraded my server to latest ubuntu 24 and python 3.12 and latest Flask from earlier where I was using Flask 1.1.1 on ubuntu 18 with Flask_monitoringdashboard 3.1.0. I upgraded Flask_monitoringdashboard to 3.1.2 to fixe issues owing to changes in flask2 onwards (as noted on the release notes).

My flask app is working fine , however flask_monitoring dashboard does not commit any thing to the database (MySQL). I get the following error from database/_init.py (session_scope()) in my apache logs

"No commit has been made, due to the following error: Working outside of request context." .

The configuration file I am using is given below. Any help or suggestions to fix this ?

[dashboard]
APP_VERSION=1.0
GIT=//.git/
CUSTOM_LINK=dashboard
MONITOR_LEVEL=1
OUTLIER_DETECTION_CONSTANT=2.5
SAMPLING_PERIOD=20
ENABLE_LOGGING=True

[authentication]
USERNAME=admin
PASSWORD=xxxx
SECURITY_TOKEN=xxxxx

[database]
TABLE_PREFIX=fmd
DATABASE=mysql://fmd:xxxx@localhost/fmd

[visualization]
TIMEZONE=Asia/Kolkata

Looking for hints to fix this. Given the error tempted to change code in passing the Flask app context in session_scope() explicitly, however not sure of this approach and if I maybe doing anything else wrong ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant