Comments (9)
FWIW I ran into a similar issue today, and it turned out to be that the "/grouped" url can be a bit long (my wsgi had a limit to 4096 characters) - so setting buffer-size=32768 in wsgi settings solved it
Hope this helps
from flask-profiler.
actually you are not supposed to do anything to get summary info. I will check this.
if your database does not contain sensitive data, could you please send it here?
or could you send responses of the ajax request of the summary page?
from flask-profiler.
I've been running this in a test environment so there's no sensitive data. Here's the DB: https://drive.google.com/file/d/0B-gm7xa66enOWEFEQlJfQ2xDN3M/view?usp=sharing
As an unrelated question: what's the impact of running this on a production server?
from flask-profiler.
thanks for the db.
I downloaded and started flask-profiler with it; it works for me. I am able to see the summary info on the dashboard page.
Can you check the ajax request using chrome's developer console? And what do you get when make the request below?
Yes you can use this on a production server with securing it using basic authentication. There is not any significant impact. When you are done with it, you can turn it off easily.
app.config["flask_profiler"] = {
"verbose": True,
"enabled": app.config["DEBUG"],
"storage": {
"engine": "sqlite"
},
"basicAuth": {
"enabled": True,
"username": "admin",
"password": "admin"
}
}
from flask-profiler.
Ok, I think that's where the problem is.
For some reason, the URL requested in my instance of flask profiler looks like this: grouped?draw=1(...)
, which returns an empty response. Yours looks like this: ?draw=1(...)
.
I found that simply adding a slash ( grouped/?draw=1(...)
) returns as expected.
Here's a screenshot: http://imgur.com/BSgi6zu
from flask-profiler.
Hi @alejoar
I am not able to reproduce the issue so that I cannot come up with a solution.
from flask-profiler.
@muatik unfortunately I moved on to logstash to get the same kind of stats so I can't give you any more feedback for flask-profiler. I have no idea why the requested url had that difference in my server, I didn't alter the code at all.
The problem I had was that I have several servers running flask and I needed something centralized so I moved my data recollection to the load balancers.
from flask-profiler.
ohh ok, thanks anyway.
from flask-profiler.
I just ran on this issue today and indeed there is a mismatch between the js ajax call to and the route declaration.
From the Werkzeug Rule documentation:
URL rules that end with a slash are branch URLs, others are leaves. If you have strict_slashes enabled (which is the default), all branch URLs that are matched without a trailing slash will trigger a redirect to the same URL with the missing slash appended.
The route declaration has a slash at the end:
@fp.route("/api/measurements/grouped/".format(urlPath))
While the ajax request don't:
192.168.21.1 - - [04/Aug/2017 18:29:31] "GET /flask-profiler/api/measurements/grouped?draw=...
This generate a HTTP 500 error with following traceback:
Traceback (most recent call last):
File "/opt/app/.pyenv/versions/3.6.2/envs/0.0.0/lib/python3.6/site-packages/flask/app.py", line 1997, in __call__
return self.wsgi_app(environ, start_response)
File "/opt/app/.pyenv/versions/3.6.2/envs/0.0.0/lib/python3.6/site-packages/flask/app.py", line 1985, in wsgi_app
response = self.handle_exception(e)
File "/opt/app/.pyenv/versions/3.6.2/envs/0.0.0/lib/python3.6/site-packages/flask/app.py", line 1540, in handle_exception
reraise(exc_type, exc_value, tb)
File "/opt/app/.pyenv/versions/3.6.2/envs/0.0.0/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
raise value
File "/opt/app/.pyenv/versions/3.6.2/envs/0.0.0/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/opt/app/.pyenv/versions/3.6.2/envs/0.0.0/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/opt/app/.pyenv/versions/3.6.2/envs/0.0.0/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/opt/app/.pyenv/versions/3.6.2/envs/0.0.0/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
raise value
File "/opt/app/.pyenv/versions/3.6.2/envs/0.0.0/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/opt/app/.pyenv/versions/3.6.2/envs/0.0.0/lib/python3.6/site-packages/flask/app.py", line 1590, in dispatch_request
self.raise_routing_exception(req)
File "/opt/app/.pyenv/versions/3.6.2/envs/0.0.0/lib/python3.6/site-packages/flask/app.py", line 1573, in raise_routing_exception
raise request.routing_exception
File "/opt/app/.pyenv/versions/3.6.2/envs/0.0.0/lib/python3.6/site-packages/flask/ctx.py", line 294, in match_request
self.url_adapter.match(return_rule=True)
File "/opt/app/.pyenv/versions/3.6.2/envs/0.0.0/lib/python3.6/site-packages/werkzeug/routing.py", line 1534, in match
safe='/:|+') + '/', query_args))
werkzeug.routing.RequestRedirect: 301 Moved Permanently: None
I manually edited(remove the slash) the flask_profiler.py
in the site package and it work as expected.
By removing the trailing slash it will ensure that the route work with either Werkzeug strict_slashes
enabled or not (or any other WSGI server in production).
PR #68 should to fix this issue.
from flask-profiler.
Related Issues (20)
- Support Redis as storage option
- TypeError: Object of type 'Resource' class is not JSON serializable
- NULL result in a non-nullable column - Snowflake as storage
- AttributeError partially initialized module (most likely due to a circular import thrown during flask_profiler import
- Allow defining SQLite3 location HOT 1
- New release
- Endpoint call fails, if `flask-profiler` has error HOT 1
- RuntimeError: dictionary keys changed during iteration
- Text of Modal body with description of the API is overflowing.
- API body response is escaped with backslash
- Is Flask-SocketIO supported?
- pymongo 4.x not support ensure_index HOT 1
- Show variables in endpoints on dashboard
- ValueError: Empty module name HOT 1
- I only want an uncompressed JavaScript file to modify the page myself
- sqlite3.ProgrammingError: Recursive use of cursors not allowed HOT 8
- mysql has no index!!!!
- "before_first_request"
- TypeError: Object of type 'UUID' is not JSON serializable when url param is of type uuid
- "Dump current database" not workable for mongodb HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flask-profiler.