https://prefect.io logo
Title
s

Stéphan Taljaard

02/14/2022, 11:35 AM
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
k

Kevin Kho

02/14/2022, 2:59 PM
Yeah this looks like the query is really just too long. You can increase the read_timeout though on Server.
See this
I think it just might be related to latency downloading the output from a remote location?
s

Stéphan Taljaard

02/14/2022, 4:34 PM
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
k

Kevin Kho

02/14/2022, 4:35 PM
I think using the interactive API tab might add limits by default but your query doesnt have any?
s

Stéphan Taljaard

02/14/2022, 4:42 PM
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
👍 1
I did not get a chance to look at this today
k

Kevin Kho

02/15/2022, 6:46 PM
No worries 😆