gridsome icon indicating copy to clipboard operation
gridsome copied to clipboard

Netlify Build Failing on Processing Images

Open danvega opened this issue 3 years ago • 8 comments

Description

I have a lot of images but to be fair I always have. I was able to build last week and all of a sudden it's failing. I can build locally but on Netlify I am seeing this in the logs before it times out. I really need to get a post up, is there something I can do to fix this quickly or manually deploy?

10:51:42 AM: Render HTML (258 files) - 3.72s
10:51:42 AM: Process files (1 files) - 0.23s
10:58:05 AM: Processing images (1047 images) - 0%Processing images (1047 images) - 2%Processing images (1047 images) - 5%Processing images (1047 images) - 7%Processing images (1047 images) - 10%Processing images (1047 images) - 12%Processing images (1047 images) - 14%Processing images (1047 images) - 17%Processing images (1047 images) - 19%Processing images (1047 images) - 21%Processing images (1047 images) - 24%Processing images (1047 images) - 26%Processing images (1047 images) - 29%Processing images (1047 images) - 31%Processing images (1047 images) - 33%Processing images (1047 images) - 36%Processing images (1047 images) - 38%Processing images (1047 images) - 40%Processing images (1047 images) - 43%Processing images (1047 images) - 45%Processing images (1047 images) - 48%Processing images (1047 images) - 50%Processing images (1047 images) - 52%Processing images (1047 images) - 55%Processing images (1047 images) - 57%Processing images (1047 images) - 60%Processing images (1047 images) - 62%Processing images (1047 images) - 64%Processing images (1047 images) - 67%Processing images (1047 images) - 69%Processing images (1047 images) - 71%Processing images (1047 images) - 74%Processing images (1047 images) - 76%Processing images (1047 images) - 79%Processing images (1047 images) - 81%Processing images (1047 images) - 83%Processing images (1047 images) - 86%Processing images (1047 images) - 88%Processing images (1047 images) - 90%

Expected result

It should build

Actual result

Build fails and times out

Environment

System: OS: macOS 12.1 CPU: (10) arm64 Apple M1 Max Binaries: Node: 14.18.3 - ~/.nvm/versions/node/v14.18.3/bin/node npm: 6.14.15 - ~/.nvm/versions/node/v14.18.3/bin/npm Browsers: Chrome: 97.0.4692.99 Safari: 15.2 npmPackages: @gridsome/plugin-sitemap: ^0.4.0 => 0.4.0 @gridsome/source-filesystem: ^0.6.2 => 0.6.2 @gridsome/transformer-remark: ^0.6.4 => 0.6.4 gridsome: ^0.7.23 => 0.7.23 gridsome-plugin-remark-codesandbox: ^0.4.2 => 0.4.2 gridsome-plugin-remark-shiki: ^0.6.0 => 0.6.0 gridsome-plugin-remark-twitter: ^0.2.1 => 0.2.1 gridsome-plugin-remark-youtube: ^1.0.1 => 1.0.1 gridsome-plugin-rss: ^1.2.0 => 1.2.0 gridsome-plugin-sentry: ^1.1.0 => 1.1.0 npmGlobalPackages: @gridsome/cli: 0.3.4

danvega avatar Jan 24 '22 16:01 danvega

I was able to run a build locally and deploy that to Netlify for the time being. I still need to figure out why my builds on Netlify are failing.

danvega avatar Jan 24 '22 16:01 danvega

@danvega did you find out what caused the issue beside the image size? I have the same issue, and it worked for me when I reduced some image sizes. But its not fixed, only postponed until I have more pictures I assume.

RSchlenker avatar Sep 27 '22 18:09 RSchlenker

@RSchlenker No, I never found an answer to this problem. I have to manually build and deploy my site each time now. I am hopefully going to move it over to Nuxt soon so that is why I haven't spent much time on it.

danvega avatar Sep 28 '22 13:09 danvega

@danvega I just migrated my build process to github actions. For me its more practical as I do not always have a good enough internet connection to deploy from my local machine. Integrating actions was quite easy. (Just to give you a second option)

RSchlenker avatar Oct 17 '22 08:10 RSchlenker

Good thinking @RSchlenker Do you have an example workflow I can look at?

danvega avatar Oct 17 '22 13:10 danvega

Sure, mine looks something like this:

.github/workflows/deploy-to-netlify.yml


name: Deploy
on:
  push:
    branches:
      - main
concurrency:
  group: main
  cancel-in-progress: true
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: 14
          cache: 'yarn'
      - name: Install netlify
        run: yarn global add netlify-cli
      - name: Install JS dependencies
        run: yarn install
      - name: Build
        run: yarn build
      - name: Deploy to netlify
        env:
          NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_TOKEN }}
          NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
        run: netlify deploy --prod

I added the concurrency constraint to ensure that always the most recent commit is going to be deployed to netlify. The "yarn build" command will execute "gridsome build". The yarn installation should be cached which will improve the speed of similar builds, as long as no new JS-Dependencies are added.

I hope it will help :)

RSchlenker avatar Oct 18 '22 12:10 RSchlenker

Thank you so much @RSchlenker - I got it to work for my site as well. Appreciate the help 🤩

danvega avatar Oct 29 '22 18:10 danvega

Thanks @RSchlenker, i had the same problem, netlify timeouts with lots of image processing.

absentees avatar Nov 19 '22 10:11 absentees