https://prefect.io logo
Title
f

Farooque Shaikh

10/26/2022, 3:02 PM
Hi All, I keep getting the below Timeout error while fetching data using graphql in a python code for Prefect 1.0 prefect.exceptions.ClientError: [{'path': ['flow_run'], 'message': 'Operation timed out', 'extensions': {'code': 'API_ERROR'}}] Is there any solution to avoid this?
c

Christopher Boyd

10/26/2022, 3:29 PM
That depends on a number of factors. Is this a graphql connection locally, or to prefect cloud? What is your actual request / graphql query, and how much data do you anticipate it returning? What does your network connection look like, and do any other requests succeed
timed out is very generic
f

Farooque Shaikh

10/26/2022, 3:36 PM
To answer your questions: 1. The connection is local and not to cloud 2. I am pulling the flow_run logs for every 4 hours to track all the prefect runs every 4 hours 3. Data wise we usually run approx. 20 odd flows in every 4 hours 4. network connection should be good, as the timeout does not happen for every run, it just happens like one out of 6 runs of the day
c

Christopher Boyd

10/26/2022, 5:28 PM
Hi Farooque, I think there is still some missing information here. If this is local (e.g. prefect server), where is this hosted? How large is the database, how much data are in the flow run logs Are you running sqlite, or postgres? Timed out api error is basically meaning that the database isn’t satisfying the request before the timeout value, which could be a factor of # of simultaneous connections / transactions, database usage, network connectivity to the database
there are a lot of factors here, especially considering that this is self-hosted