Hello all. I’m deploying serverless Functions from my local machine using doctl. Most of the times, it finishes deployment without a problem. Sometimes, I am getting an error on an arbitrary Function like this:
Error: While deploying action 'app/transcribe' (running remote build): The function exceeded its time limits of 120000 milliseconds.
While I do have timeout limits defined for every Function in the project.yml file, I understand these definitions apply to runtime, not deployment, of the Function, and my timeout figures are different anyway.
I think I never had these errors when I had just a couple of Functions. However, since my 6th or 7th Function it started to appear. I’m concerned I will always fail deployment soon as more Functions are added…
So, I’d like to better understand where is that deployment timeout definition coming from, do I have control over it, and why would it sometimes work and sometimes timeout?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hey!
As you’ve correctly noted, the timeout settings in your
project.yml
file are for runtime execution, not for the build time for remote builds. The build time limit for remote builds is different from the timeout configuration in your project yaml.According to the Serverless functions limitations docs page, the maximum build time for remote builds is 2 minutes, which matches the error that you are seeing (120000 milliseconds is 2 minutes):
When you had fewer functions, you might not have hit resource or concurrency limits that are now being reached with more functions. This can cause deployments to take longer and potentially time out.
One option here is to try using the
watch
command instead of thedeploy
command:It will run until interrupted. It will watch the directory (which should be one you initialized for serverless development) and will deploy the contents to the cloud incrementally as it detects changes.
You need to run the command in a separate window and leave it running.
Let me know how it goes!
Best,
Bobby