Firebase-tools: Retry failed function deployment on ETIMEDOUT

Created on 7 Apr 2018  ·  4Comments  ·  Source: firebase/firebase-tools

Every time I deploy functions, at least one function fails to deploy due to ETIMEDOUT. My project has around 50 functions and I'm deploying from a slow internet connection. I would like to request that the failed functions get redeployed when this error is encountered. I do see that some errors are retried, but I'm not sure whether this applies to ETIMEDOUT

https://github.com/firebase/firebase-tools/blob/8f81d88caee57a16b44df868243572c071ec86d6/lib/deploy/functions/release.js#L167-L172

Another possible way to fix this might be to provide an argument to allow deploying functions in batches and waiting for each batch to complete before deploying the next batch of functions. The reason I think this might work is because my functions always deploy successfully when I run a partial deployment of 5-10 functions.

All 4 comments

We do offer the ability to group your functions and deploy individual functions or groups instead of the whole project: https://firebase.google.com/docs/cli/#partial_deploys. At this time we are not going to support batching your functions, since you have the ability to do that yourself.

I believe ETIMEDOUT would be error code 4, so that is retryed.

@laurenzlong is there a way to increase the amount of times the CLI tries to redeploy a function?

Technically it is possible, but it may not be a good idea since a lot of the deployment quotas are time range based (i.e. x number of deploys within x seconds). Retrying right away would actually make the problem worse. So we would not want to make that change in the CLI.

If you have a business case for deploying a lot of functions at at time, you can request for a quota increase on the Cloud Console, the quota you would want to increase is "Write requests per 100 seconds per user".

@laurenzlong we get this quite a lot when deploying (its quite annoying!) - I've looked at increasing the quota you've mentioned but its not editable, any other ideas / work arounds, thanks?

Was this page helpful?
0 / 5 - 0 ratings