Question

Error deploying Functions due to timeout

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?


Submit an answer


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!

Sign In or Sign Up to Answer

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.

Bobby Iliev
Site Moderator
Site Moderator badge
March 13, 2024

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):

https://docs.digitalocean.com/products/functions/details/limits/

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 the deploy command:

doctl serverless watch . --remote-build

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

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel