Hey. Anyone that can point out if there's a gotcha...
# prefect-server
s
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:
Copy code
query GetFlowRunLogs($flow_run_name: String) {
  flow_run(where: {name: {_eq: $flow_run_name}}){
    logs {
      created
      level
      message
    }
  }
}
Variables:
Copy code
{
  "flow_run_name": "stalwart-ostrich"
}
Something like this would probably be more helpful:
Copy code
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
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
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
I think using the interactive API tab might add limits by default but your query doesnt have any?
s
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
No worries 😆