nwtgck/actions-netlify

Times out with no logged errors

narthur opened this issue ยท 12 comments

Except for one time, the action has timed out every time I've used it. Once I removed the timeout for the action and the entire job timed out after an hour. Every time there aren't any logged errors other than to note that it's timed out. It only worked one time. I saw that the Netlify CLI has a DEBUG environment variable that enables more logging, so I tried adding that, but still no longing. Right now I have the timeout set to 3 minutes. How do I go about fixing this?

Run nwtgck/actions-netlify@v1.1
  with:
    publish-dir: ./public
    production-branch: master
    github-token: ***
    deploy-message: Deploy from GitHub Actions
  env:
    NETLIFY_AUTH_TOKEN: ***
    NETLIFY_SITE_ID: ***
    DEBUG: *
##[error]The action has timed out.

It appears that the reason it's timing out is that the finished build contains more than 20,000 files (and it's only going to get bigger! This is a big site). I'm seeing if I can zip the build and deploy that, instead, though I haven't seen anywhere in your docs that this is supported.

As far as I can tell Netlify doesn't have a supported method of uploading a zip to deploy via the CLI, so that's probably out. I'm running out of ideas. The Netlify CLI (which I presume this action uses) does skip unchanged files previously uploaded, but since I'm working on template files it's often a very large chunk of files that have changed at a time.

@narthur Thank you for the report.

The Netlify CLI (which I presume this action uses) does skip unchanged files previously uploaded

Actually, this action uses netlify/js-client, which is also used in Netlify CLI.

Can your built content be deployed from the following Netlify official deploy?
image

Thank you for the information!

If I'm understanding correctly, you're asking if I could let Netlify pull the changes using its git integration instead of using your Netlify action. Yes, this is what I've been doing previously, and it does work. However, I was quickly running out of build minutes on the free plan since the build step can easily take 16 minutes or more for my site (it's pulling a lot of content from an external API). That's why I've been trying to run the build using GitHub Actions and deploy the built files to Netlify instead.

I have found that the Netlify API does support uploading a zip, so trying that solution.

I found an issue which may be related: netlify/js-client#49

I encountered a similar issue with a site with around 60 files.
(Deployment was successful when there were only a few files, but started failing once we increased the number of files.)

I googled and found a thread in Netlify support forum that may be related:
https://community.netlify.com/t/deploys-are-getting-stuck-with-just-a-creating-deploy-upload-records-message/22228/22

In this thread they are claiming that the cause is not using the latest netlify/js-client, though I couldn't find anything that seems to be related in its change log.

Sorry, I found that the latest version of actions-netlify already uses the latest netlify/js-client.
I will try updating actions-netlify in my project and see if it works.

Updating actions-netlify to the latest version solved my problem. Sorry for confusion.

I just ran into this as well - even with the latest version, deploying without a netlify.toml always failed with no error details. I suspect this is due to a some kind of Netlify bug: it times out with the 1 minute timeout from the docs, or eventually throws an unexplained internal server error later.

When I added my netlify.toml though (see httptoolkit/accounts@9294353) it now works perfectly. Doesn't contain much, just my previous build settings, and my Netlify build is now disabled so that shouldn't do anything at all. Regardless, it's fixed the issue reliably for me. Might be worth a shot for others with the same problem. My full setup is here: https://github.com/httptoolkit/accounts/.

@pimterry Thank you so much for the detail explanation!