Monday.com API Connect Error - Forcibly Closed

I would consider that I have a pretty hefty monday.com script that is creating, moving, updating, etc. around 8k items. I occasionally run into errors indicating that my new board was not created correctly. Normally if I just run the script again, it’s fixed. I’d assume this is just due to latency. I’ve also put time.sleep() functions throughout my script to make sure I am not hitting any limits. I’ve had a couple successful runs.

However, I recently ran into this error: [Errno 10054] An existing connection was forcibly closed by the remote host. Through stack exchange and other community platforms, it seems that this is actually due to being connected to monday’s API for too long??? My script is taking on average about 2 hours to run. Sometimes my computer will “fall asleep”, could this be an issue?

Has anyone else come upon this error or have any suggestions?

Currently trying this method to hone down on where the error might be coming from, or if it’s consistent.

try:
    r = requests.post(url=apiUrl, headers=headers, json=data, timeout=60) # make request
except:
    print('Monday.com Error | location of error | Sleeping for 60 seconds')
    time.sleep(60)
    r = requests.post(url=apiUrl, headers=headers, json=data, timeout=60) # make request

As far as I know, monday.com does not support http/2 or keep-alive on its API server. But that could have changed. My understanding is that your script should have to establish a new connection each time it makes a call. So none should be getting too old.

Falling asleep would definitely be an issue though.

That said, there is a rate limit of 5000 connections per minute from a single IP address thats not well documented.

2 Likes

I changed my setting to “Never” fall asleep and ran the process again, no error this time. Though those type of connection error or data manipulation errors seem rather random.

Thanks for the additional rate limit information. I’d be very surprised to hit that in a single minute. It takes about a second for each manipulation operation. So unless I put multiprocessing back in, I should be in the clear.

Is there a standard method to test if I am hitting limits. Is there a specific status.code for that or…?

When running testing data for my project, everything works correctly, but as soon as I put in the multi-hour process, data starts to get “skipped” like I’m hitting a limit, but it’s not clear what that limit is.

You need to check your responses for a “data” key, if its missing - log it the respons. something is throwing an error that isn’t coming back as a status code other than 200.

1 Like