View in #prefect-server on Slack
@Stéphan_Taljaard: Hey. Anyone that can point out if there’s a gotcha I missed here?
I created a flow to get a flow run (by name)'s logs and email them to a user.
I figured out the GQL query in the Interactive API
tab on the Server page.
I then moved it to my flow. When running the flow, I’m getting ReadTimeoutError: HTTPConnectionPool(host='localhost', port=4200): Read timed out. (read timeout=15)
It’s strange to me, because I’m using default port/other settings, and expect it to work since the Interactive API
gives a result almost immediately
Query in question:
query GetFlowRunLogs($flow_run_name: String) {
flow_run(where: {name: {_eq: $flow_run_name}}){
logs {
created
level
message
}
}
}
Variables:
{
"flow_run_name": "stalwart-ostrich"
}
Something like this would probably be more helpful:
query GetFlowRunLogs($flow_run_name: String) {
flow_run(where: {name: {_eq: $flow_run_name}}){
task_runs(order_by: {start_time: asc}){
task{
name
slug
id
}
start_time
logs(order_by: {timestamp: asc}){
level
message
}
}
}
}
But the timeout still happens
@Kevin_Kho: Yeah this looks like the query is really just too long. You can increase the read_timeout though on Server.
See this
GitHub: Increase Prefect Client HTTP Request Timeout by AndrewHannigan · Pull Request #4119 · PrefectHQ/prefect
I think it just might be related to latency downloading the output from a remote location?
@Stéphan_Taljaard: I can try out tomorrow and see what happens if I up the timeout
But it still feels strange to me.
Through the Prefect Server, it still communicates with the server through graphql, same as in the flow. It follows the same route. Both go to and from the same locations
@Kevin_Kho: I think using the interactive API tab might add limits by default but your query doesnt have any?
@Stéphan_Taljaard: I guess that’s possible, but I’ll need to dig through Server’s code to find if that is the case
I’ll let you know tomorrow if I find something