Yes, I will let you know if we see it again. I found that we actually do a lot more the 40 API calls. We are doing a balena deploy and then query the devices every second if they are on the right commit and the supervisor is idle. In API calls this is
2021-03-16 11:56:27,651 [DEBUG] caddeploy.device.CADAMI-Server: [WAIT] - Not on right commit or supervisor not idle.
2021-03-16 11:56:28,657 [DEBUG] urllib3.connectionpool: Starting new HTTPS connection (1): api.balena-cloud.com:443
2021-03-16 11:56:28,738 [DEBUG] urllib3.connectionpool: [https://api.balena-cloud.com:443](https://api.balena-cloud.com/) "GET /v5/device?$filter=uuid%20eq%20'dDEVICE_ID' HTTP/1.1" 200 None
2021-03-16 11:56:28,744 [DEBUG] urllib3.connectionpool: Starting new HTTPS connection (1): api.balena-cloud.com:443
2021-03-16 11:56:28,827 [DEBUG] urllib3.connectionpool: [https://api.balena-cloud.com:443](https://api.balena-cloud.com/) "GET /v5/device?$filter=uuid%20eq%20'DEVICE_ID' HTTP/1.1" 200 None
2021-03-16 11:56:28,834 [DEBUG] urllib3.connectionpool: Starting new HTTPS connection (1): api.balena-cloud.com:443
2021-03-16 11:56:28,909 [DEBUG] urllib3.connectionpool: [https://api.balena-cloud.com:443](https://api.balena-cloud.com/) "GET /v5/application?$filter=id%20eq%20'APP_IDb' HTTP/1.1" 200 633
2021-03-16 11:56:28,916 [DEBUG] urllib3.connectionpool: Starting new HTTPS connection (1): api.balena-cloud.com:443
2021-03-16 11:56:28,999 [DEBUG] urllib3.connectionpool: [https://api.balena-cloud.com:443](https://api.balena-cloud.com/) "GET /v5/application?$filter=app_name%20eq%20'OTAcast-server-test' HTTP/1.1" 200 633
2021-03-16 11:56:29,008 [DEBUG] urllib3.connectionpool: Starting new HTTPS connection (1): api.balena-cloud.com:443
2021-03-16 11:56:29,448 [DEBUG] urllib3.connectionpool: [https://api.balena-cloud.com:443](https://api.balena-cloud.com/) "POST /supervisor/v1/device HTTP/1.1" 200 370
Traceback if the error happens
Traceback (most recent call last):
File "/cadedge_tools/caddeploy_pkg/caddeploy/utils.py", line 66, in run_parallel
return_values.append(task.result())
File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 433, in result
return self.__get_result()
File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 389, in __get_result
raise self._exception
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/cadedge_tools/caddeploy_pkg/caddeploy/utils.py", line 23, in wrapper
return func(obj, *args, **kwargs)
File "/cadedge_tools/caddeploy_pkg/caddeploy/device.py", line 150, in wait_for_release
while retries > 0 and not (self.balena.is_on_right_commit() and self.balena.is_idle()):
File "/cadedge_tools/caddeploy_pkg/caddeploy/balena_device_adapter.py", line 153, in is_on_right_commit
app_commit = self.balena.models.application.get(self.application_name)["commit"]
File "/usr/local/lib/python3.9/site-packages/balena/models/application.py", line 146, in get
apps = self.base_request.request(
File "/usr/local/lib/python3.9/site-packages/balena/base_request.py", line 197, in request
raise exceptions.RequestError(response._content)
balena.exceptions.RequestError: b'Too Many Requests'