This is for self-hosted customers only and that the example is in the context of an AWS EC2 deployment
Query flow:
This tutorial tracks what happens to your query when clicking "Run" in your app:
- When viewing your application on the Frontend and you click 'Run' on a query, it travels to the Retool's backend wherever your Retool instance is hosted (i.e. EC2).
- This then tells your Retool instance to send the request to the
api_container
. - The
api_container
will then send the request todb_connector
container - From here, the request is sent out to your query's endpoint to complete the request.
- Once the information is obtained from the API endpoint, the response of your query gets returned back to the
db_connector
→api_container
→ back to you on the frontend within your app.
Example:
-
Run your query from your Retool app
-
SSH into your Retool instance containers
-
cd
intoretool-onpremise-master
Inspecting your api_container:
4. Run sudo docker-compose logs --tail 10 api
. This is telling docker to give me the logs of the last 10 container logs from the api
container
- Within the
api_container
, look out forREQUEST_BEGIN
andREQUEST_FINISH
. This is the request being processed before sent to thedb_connector
Inspecting your DB-CONNECTOR
container:
5. Run sudo docker-compose logs --tail 10 db-connector
. This is telling docker to give me the logs of the last 10 container logs from the db-connector
container
- Within the
db_connector
, look out forQUERY_REQUEST
,QUERY_COMPLETE
, andRESPONSE_SENT
. This is the request being processed before being sent to your API endpoint.
Extra Notes:
- [Grab specific logs] You can run something like
sudo docker-compose logs --tail 1000 | grep '<your_query_request_id>'
with the query's requestId to grab the result:sudo docker-compose logs --tail 1000 | grep '0fea6611-7479-4c33-a5e4-a4dff0c1e921'
- [Axios] Retool is using node fetch/axios - failure of this library can be seen from
DB_CONNECTOR
- Example error:
request to https://www.sdkfjhsjkfhsjhf.com/ failed, reason: getaddrinfo ENOTFOUND www.sdkfjhsjkfhsjhf.com
. This is due to the library throwing an error because it couldn't reach the endpoint/find DNS forhttps://www.sdkfjhsjkfhsjhf.com
- Example error:
- [DB_CONNECTOR returns Success] -
DB_CONNECTOR
can show a success, even if the query actually returned "fail" from the API endpoint