setup on Bitnami Redash 8.0.0 - Virtual Machine
Here is a very simple query with parameter.
select * from redash_inbound where cust=’{{ clientid }}'
This query is working fine and it displays the list of clients and accordingly the output.
Next step is to try the API (json) and while executing it in GET, it give the standard result.
"message": "No cached result found for this query.
**You have requested this URI [/api/queries/56/results.json] **
**but did you mean /api/queries/<query_id>/results **
**or /api/query_results **
or /api/queries/<query_id>/refresh ?"
So far so good.
We went through the portal help page (https://redash.io/help/user-guide/integrations-and-api/api) and we understand that now we need to try the same in POST method.
In POST method, we added below text in json body
{
“parameters”: {
“clientid”: “CLIENT0001”
},
“max_age”:0
}
When we test this API (using POST method), it throws an error
{ “message”: “Internal Server Error” }
We have tried:
… adding “SQLALCHEMY_ENABLE_POOL_PRE_PING: true” to “.env” file in /opt/bitnami/apps/redash/htdocs
… tried different simple queries with other parameters
… checked this thread “Unable to get query results with parameters via API - #2 by k4s1m”
… checked “public URL” of embedded query (its working fine like the query)
But it looks like that the First Request itself is not getting through redash server.
When we checked the log, it says that “post() got an unexpected keyword argument ‘filetype’”
Need help !!
Here is the log extract.
TypeError: post() got an unexpected keyword argument ‘filetype’
[2021-09-07 14:50:15,749][PID:6165][INFO][metrics] method=POST path=/api/queries/56/results.json endpoint=query_result status=500 content_type=application/json content_length=36 duration=0.91 quer$[2021-09-07 14:51:33,434] ERROR in app: Exception on /api/queries/56/results.json [POST]
Traceback (most recent call last):
File “/opt/bitnami/apps/redash/htdocs/venv/lib/python2.7/site-packages/flask/app.py”, line 1612, in full_dispatch_request
rv = self.dispatch_request()
File “/opt/bitnami/apps/redash/htdocs/venv/lib/python2.7/site-packages/flask/app.py”, line 1598, in dispatch_request
return self.view_functionsrule.endpoint
File “/opt/bitnami/apps/redash/htdocs/venv/lib/python2.7/site-packages/flask_restful/init.py”, line 477, in wrapper
resp = resource(*args, **kwargs)
File “/opt/bitnami/apps/redash/htdocs/venv/lib/python2.7/site-packages/flask_login/utils.py”, line 228, in decorated_view
return func(*args, **kwargs)
File “/opt/bitnami/apps/redash/htdocs/venv/lib/python2.7/site-packages/flask/views.py”, line 84, in view
return self.dispatch_request(*args, **kwargs)
File “/opt/bitnami/apps/redash/htdocs/redash/handlers/base.py”, line 31, in dispatch_request
return super(BaseResource, self).dispatch_request(*args, **kwargs)
File “/opt/bitnami/apps/redash/htdocs/venv/lib/python2.7/site-packages/flask_restful/init.py”, line 587, in dispatch_request
resp = meth(*args, **kwargs)
File “/opt/bitnami/apps/redash/htdocs/redash/permissions.py”, line 67, in decorated
return fn(*args, **kwargs)
TypeError: post() got an unexpected keyword argument ‘filetype’
[2021-09-07 14:51:33,434][PID:6165][INFO][metrics] method=POST path=/api/queries/56/results.json endpoint=query_result status=500 content_type=application/json content_length=36 duration=0.82 quer$[
Rituraj Pankaj