Builds getting stuck every time

netlify site name: alexandrechampagne.netlify.app

My builds have started getting stuck recently. Restarting them and they run fine. Any idea why this is happening?

log when getting stuck:

5:58:48 PM: Build ready to start
5:58:51 PM: build-image version: fd3b56fcdbaad56e70919e8a4b2da9b411ec3532 (xenial)
5:58:51 PM: build-image tag: v3.10.1
5:58:51 PM: buildbot version: 1166b873df3086892bcef41356ad6efa7b9e401d
5:58:51 PM: Fetching cached dependencies
5:58:51 PM: Starting to download cache of 157.4MB
5:58:52 PM: Finished downloading cache in 1.505353625s
5:58:52 PM: Starting to extract cache
5:58:56 PM: Finished extracting cache in 3.898845961s
5:58:56 PM: Finished fetching cache in 5.450335161s
5:58:56 PM: Starting to prepare the repo for build
5:58:57 PM: Preparing Git Reference refs/heads/master
5:58:58 PM: Parsing package.json dependencies
5:58:58 PM: Starting build script
5:58:58 PM: Installing dependencies
5:58:58 PM: Python version set to 2.7
5:58:59 PM: Started restoring cached node version
5:59:02 PM: Finished restoring cached node version
5:59:03 PM: v12.18.0 is already installed.
5:59:03 PM: Now using node v12.18.0 (npm v6.14.4)
5:59:04 PM: Started restoring cached build plugins
5:59:04 PM: Finished restoring cached build plugins
5:59:04 PM: Attempting ruby version 2.7.1, read from environment
5:59:05 PM: Started restoring cached ruby version
5:59:05 PM: Finished restoring cached ruby version
5:59:07 PM: Using ruby version 2.7.1
5:59:08 PM: Using PHP version 5.6
5:59:08 PM: Installing Hugo 0.86.1
5:59:08 PM: hugo v0.86.1-F6821B88+extended linux/amd64 BuildDate=2021-07-30T10:13:35Z VendorInfo=gohugoio
5:59:08 PM: Started restoring cached go cache
5:59:08 PM: Finished restoring cached go cache
5:59:08 PM: go version go1.14.4 linux/amd64
5:59:08 PM: go version go1.14.4 linux/amd64
5:59:08 PM: Installing missing commands
5:59:08 PM: Verify run directory
5:59:10 PM: ​
5:59:10 PM: ────────────────────────────────────────────────────────────────
5:59:10 PM:   Netlify Build                                                 
5:59:10 PM: ────────────────────────────────────────────────────────────────
5:59:10 PM: ​
5:59:10 PM: ❯ Version
5:59:10 PM:   @netlify/build 18.24.0
5:59:10 PM: ​
5:59:10 PM: ❯ Flags
5:59:10 PM:   baseRelDir: true
5:59:10 PM:   buildId: 6196daa8933b8a00082dc399
5:59:10 PM:   deployId: 6196daa8933b8a00082dc39b
5:59:10 PM: ​
5:59:10 PM: ❯ Current directory
5:59:10 PM:   /opt/build/repo
5:59:10 PM: ​
5:59:10 PM: ❯ Config file
5:59:10 PM:   /opt/build/repo/netlify.toml
5:59:10 PM: ​
5:59:10 PM: ❯ Context
5:59:10 PM:   production
5:59:10 PM: ​
5:59:10 PM: ❯ Loading plugins
5:59:10 PM:    - netlify-plugin-hugo-cache-resources@0.2.1 from netlify.toml
5:59:10 PM: ​
5:59:10 PM: ────────────────────────────────────────────────────────────────
5:59:10 PM:   1. netlify-plugin-hugo-cache-resources (onPreBuild event)     
5:59:10 PM: ────────────────────────────────────────────────────────────────
5:59:10 PM: ​
5:59:11 PM: Checking if resources exist at "resources"
5:59:11 PM: Restored cached resources folder. Total files: 2
5:59:11 PM: ---
5:59:11 PM: 1. /opt/build/repo/resources
5:59:11 PM: 2. /opt/build/repo/resources/_gen
5:59:11 PM: ​
5:59:11 PM: (netlify-plugin-hugo-cache-resources onPreBuild completed in 275ms)
5:59:11 PM: ​
5:59:11 PM: ────────────────────────────────────────────────────────────────
5:59:11 PM:   2. build.command from netlify.toml                            
5:59:11 PM: ────────────────────────────────────────────────────────────────
5:59:11 PM: ​
5:59:11 PM: $ hugo --gc --minify -b $URL
5:59:11 PM: Start building sites …
5:59:11 PM: hugo v0.86.1-F6821B88+extended linux/amd64 BuildDate=2021-07-30T10:13:35Z VendorInfo=gohugoio

log when i click β€œclear cache & retry build” and it builds successfully:

6:05:41 PM: Waiting for other deploys from your team to complete. Check the queue: https://app.netlify.com/teams/champagnealexandre/builds
6:05:56 PM: Build ready to start
6:05:58 PM: build-image version: fd3b56fcdbaad56e70919e8a4b2da9b411ec3532 (xenial)
6:05:58 PM: build-image tag: v3.10.1
6:05:58 PM: buildbot version: 1166b873df3086892bcef41356ad6efa7b9e401d
6:05:58 PM: Building without cache
6:05:58 PM: Starting to prepare the repo for build
6:05:59 PM: No cached dependencies found. Cloning fresh repo
6:05:59 PM: git clone https://github.com/champagnealexandre/alexandrechampagne.io
6:06:01 PM: Preparing Git Reference refs/heads/master
6:06:03 PM: Parsing package.json dependencies
6:06:03 PM: Starting build script
6:06:03 PM: Installing dependencies
6:06:03 PM: Python version set to 2.7
6:06:05 PM: v12.18.0 is already installed.
6:06:06 PM: Now using node v12.18.0 (npm v6.14.4)
6:06:06 PM: Started restoring cached build plugins
6:06:06 PM: Finished restoring cached build plugins
6:06:06 PM: Attempting ruby version 2.7.1, read from environment
6:06:07 PM: Required ruby-2.7.1 is not installed - installing.
6:06:08 PM: Searching for binary rubies, this might take some time.
6:06:08 PM: Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/16.04/x86_64/ruby-2.7.1.tar.bz2
6:06:08 PM: Checking requirements for ubuntu.
6:06:09 PM: Requirements installation successful.
6:06:09 PM: ruby-2.7.1 - #configure
6:06:09 PM: ruby-2.7.1 - #download
6:06:09 PM: ruby-2.7.1 - #validate archive
6:06:16 PM: ruby-2.7.1 - #extract
6:06:19 PM: ruby-2.7.1 - #validate binary
6:06:20 PM: ruby-2.7.1 - #setup
6:06:20 PM: ruby-2.7.1 - #gemset created /opt/buildhome/.rvm/gems/ruby-2.7.1@global
6:06:21 PM: ruby-2.7.1 - #importing gemset /opt/buildhome/.rvm/gemsets/global.gems........................................
6:06:21 PM: ruby-2.7.1 - #generating global wrappers........
6:06:21 PM: ruby-2.7.1 - #gemset created /opt/buildhome/.rvm/gems/ruby-2.7.1
6:06:21 PM: ruby-2.7.1 - #importing gemsetfile /opt/buildhome/.rvm/gemsets/default.gems evaluated to empty gem list
6:06:22 PM: ruby-2.7.1 - #generating default wrappers........
6:06:22 PM: Using /opt/buildhome/.rvm/gems/ruby-2.7.1
6:06:23 PM: Using ruby version 2.7.1
6:06:23 PM: Using PHP version 5.6
6:06:23 PM: Installing Hugo 0.86.1
6:06:24 PM: hugo v0.86.1-F6821B88+extended linux/amd64 BuildDate=2021-07-30T10:13:35Z VendorInfo=gohugoio
6:06:24 PM: Started restoring cached go cache
6:06:24 PM: Finished restoring cached go cache
6:06:24 PM: go version go1.14.4 linux/amd64
6:06:24 PM: go version go1.14.4 linux/amd64
6:06:24 PM: Installing missing commands
6:06:24 PM: Verify run directory
6:06:26 PM: ​
6:06:26 PM: ────────────────────────────────────────────────────────────────
6:06:26 PM:   Netlify Build                                                 
6:06:26 PM: ────────────────────────────────────────────────────────────────
6:06:26 PM: ​
6:06:26 PM: ❯ Version
6:06:26 PM:   @netlify/build 18.24.0
6:06:26 PM: ​
6:06:26 PM: ❯ Flags
6:06:26 PM:   baseRelDir: true
6:06:26 PM:   buildId: 6196dc45af9d9024d3d34331
6:06:26 PM:   deployId: 6196dc45af9d9024d3d34333
6:06:26 PM: ​
6:06:26 PM: ❯ Current directory
6:06:26 PM:   /opt/build/repo
6:06:26 PM: ​
6:06:26 PM: ❯ Config file
6:06:26 PM:   /opt/build/repo/netlify.toml
6:06:26 PM: ​
6:06:26 PM: ❯ Context
6:06:26 PM:   production
6:06:26 PM: ​
6:06:26 PM: ❯ Installing plugins
6:06:26 PM:    - netlify-plugin-hugo-cache-resources@0.2.1
6:06:28 PM: ​
6:06:28 PM: ❯ Loading plugins
6:06:28 PM:    - netlify-plugin-hugo-cache-resources@0.2.1 from netlify.toml
6:06:29 PM: ​
6:06:29 PM: ────────────────────────────────────────────────────────────────
6:06:29 PM:   1. netlify-plugin-hugo-cache-resources (onPreBuild event)     
6:06:29 PM: ────────────────────────────────────────────────────────────────
6:06:29 PM: ​
6:06:29 PM: Checking if resources exist at "resources"
6:06:29 PM: No cache found for resources folder
6:06:29 PM: ​
6:06:29 PM: (netlify-plugin-hugo-cache-resources onPreBuild completed in 216ms)
6:06:29 PM: ​
6:06:29 PM: ────────────────────────────────────────────────────────────────
6:06:29 PM:   2. build.command from netlify.toml                            
6:06:29 PM: ────────────────────────────────────────────────────────────────
6:06:29 PM: ​
6:06:29 PM: $ hugo --gc --minify -b $URL
6:06:31 PM: hugo: downloading modules …
6:06:33 PM: hugo: collected modules in 3721 ms
6:06:33 PM: Start building sites …
6:06:33 PM: hugo v0.86.1-F6821B88+extended linux/amd64 BuildDate=2021-07-30T10:13:35Z VendorInfo=gohugoio
6:06:34 PM:                    | EN
6:06:34 PM: -------------------+-----
6:06:34 PM:   Pages            | 50
6:06:34 PM:   Paginator pages  |  3
6:06:34 PM:   Non-page files   |  2
6:06:34 PM:   Static files     |  8
6:06:34 PM:   Processed images | 32
6:06:34 PM:   Aliases          |  4
6:06:34 PM:   Sitemaps         |  1
6:06:34 PM:   Cleaned          |  0
6:06:34 PM: Total in 5174 ms
6:06:34 PM: ​
6:06:34 PM: (build.command completed in 5.2s)
6:06:34 PM: ​
6:06:34 PM: ────────────────────────────────────────────────────────────────
6:06:34 PM:   3. netlify-plugin-hugo-cache-resources (onPostBuild event)    
6:06:34 PM: ────────────────────────────────────────────────────────────────
6:06:34 PM: ​
6:06:34 PM: Saved resources folder to cache. Total files: 6
6:06:34 PM: ---
6:06:34 PM: 1. /opt/build/repo/resources/_gen/assets/scss/scss/main.scss_ad7c01202310d8f56313e4e954344ccc.content
6:06:34 PM: 2. /opt/build/repo/resources/_gen/assets/scss/scss/main.scss_ad7c01202310d8f56313e4e954344ccc.json
6:06:34 PM: 3. /opt/build/repo/resources/_gen/images/authors/admin/avatar_hua6c58f55857c3c82d0b0a535b9cd5f59_1206013_270x270_fill_q75_lanczos_center.jpeg
6:06:34 PM: 4. /opt/build/repo/resources/_gen/images/media/icon_hu596e7d8e77747822293aa37f5834b15a_11313_180x180_fill_lanczos_center_3.png
6:06:34 PM: Creating deploy upload records
6:06:34 PM: 5. /opt/build/repo/resources/_gen/images/media/icon_hu596e7d8e77747822293aa37f5834b15a_11313_32x32_fill_lanczos_center_3.png
6:06:34 PM: 6. /opt/build/repo/resources/_gen/images/media/icon_hu596e7d8e77747822293aa37f5834b15a_11313_512x512_fill_lanczos_center_3.png
6:06:34 PM: ​
6:06:34 PM: (netlify-plugin-hugo-cache-resources onPostBuild completed in 62ms)
6:06:34 PM: ​
6:06:34 PM: ────────────────────────────────────────────────────────────────
6:06:34 PM:   4. Deploy site                                                
6:06:34 PM: ────────────────────────────────────────────────────────────────
6:06:34 PM: ​
6:06:34 PM: Starting to deploy site from 'public'
6:06:34 PM: Creating deploy tree 
6:06:35 PM: 0 new files to upload
6:06:35 PM: 0 new functions to upload
6:06:35 PM: Site deploy was successfully initiated
6:06:35 PM: ​
6:06:35 PM: (Deploy site completed in 188ms)
6:06:35 PM: ​
6:06:35 PM: ────────────────────────────────────────────────────────────────
6:06:35 PM:   Netlify Build Complete                                        
6:06:35 PM: ────────────────────────────────────────────────────────────────
6:06:35 PM: ​
6:06:35 PM: (Netlify Build completed in 8.5s)
6:06:35 PM: Starting post processing
6:06:35 PM: Post processing - HTML
6:06:35 PM: Caching artifacts
6:06:35 PM: Started saving build plugins
6:06:35 PM: Finished saving build plugins
6:06:35 PM: Started saving pip cache
6:06:35 PM: Finished saving pip cache
6:06:35 PM: Started saving emacs cask dependencies
6:06:35 PM: Post processing - header rules
6:06:35 PM: Finished saving emacs cask dependencies
6:06:35 PM: Started saving maven dependencies
6:06:35 PM: Finished saving maven dependencies
6:06:35 PM: Post processing - redirect rules
6:06:35 PM: Started saving boot dependencies
6:06:35 PM: Finished saving boot dependencies
6:06:35 PM: Started saving rust rustup cache
6:06:35 PM: Finished saving rust rustup cache
6:06:35 PM: Started saving go dependencies
6:06:35 PM: Post processing done
6:06:35 PM: Finished saving go dependencies
6:06:35 PM: Site is live ✨
6:06:38 PM: Cached ruby version 2.7.1
6:06:38 PM: Build script success
6:06:59 PM: Finished processing build request in 1m0.63678378s

Is the behaviour same when you remove the hugo cache plugin?

I would guess so ; i do i do that?

Could you try removing the plugin? You can find it in the site’s plugins section or in your netlify.toml.

I have the following lines in my netlify.toml,

[[plugins]]
  package = "netlify-plugin-hugo-cache-resources"
  [plugins.inputs]
    debug = true

do I simply remove them?

Yes, that would be a good starting point.

Hi I am also having the same issue as OP where my hugo builds recently started getting stuck at:

11:46:26 AM: $ hugo --gc --minify
11:46:26 AM: Start building sites …
11:46:26 AM: hugo v0.88.1-5BC54738+extended linux/amd64 BuildDate=2021-09-04T09:39:19Z VendorInfo=gohugoio

It sometimes is resolved after clearing the cache and rebuilding, but not always.

I also have no plugins installed, here is my netlify.toml:

[build.environment]
  HUGO_VERSION = "0.88.1"
  GO_VERSION = "1.17"

What site is this regarding @markphelps?

@hrishikesh objective-lewin-eed8b3 / markphelps.me

Note: I did later install the netlify-plugin-hugo-cache-resources plugin, but I was running into this issue before installing it as well

Could you share the links to the deploys where you didn’t have this plugin?

Sure, here’s one right now where I first uninstall the plugin: Netlify App

The build ran for 3+ minutes before I canceled it

Did you try running a clear cache and deploy after uninstalling the plugin? Maybe the plugin had cached some stuff and that cache is in a weird state?

After clearing cache for the first build after uninstalling the plugin, I think the subsequent ones should work fine.

hey I still have the same problem, this is annoying, are you still investigating this @hrishikesh ?

I have the same issue.
I even tried to delete cache before the build command:

[build]
publish = "public"
command = "rm -rf /opt/build/cache && hugo --gc --minify"

Sadly didn’t solve anything.
Deployment is still stuck and can’t go ahead unless you manually stop and click Clear Cache and deploy site

I would also like to point out that there are issues with Hugo versions as well:

10:14:43 AM: Build ready to start
10:14:46 AM: build-image version: a6bb34428a07e7de82f4df5dfe1843fbde91f670 (focal)
10:14:46 AM: build-image tag: v4.5.1
10:14:46 AM: buildbot version: 5284b4d1b8b4cf691b29019968d8e4eb3089acdd
10:14:47 AM: Fetching cached dependencies
10:14:47 AM: Starting to download cache of 111.2MB
10:14:48 AM: Finished downloading cache in 1.356565392s
10:14:48 AM: Starting to extract cache
10:14:51 AM: Finished extracting cache in 3.386578635s
10:14:51 AM: Finished fetching cache in 4.779807493s
10:14:51 AM: Starting to prepare the repo for build
10:14:52 AM: Preparing Git Reference refs/heads/master
10:14:53 AM: Parsing package.json dependencies
10:14:53 AM: Different build command detected, going to use the one specified in the Netlify configuration file: 'rm -rf /opt/build/cache && hugo --gc --minify' versus 'hugo' in the Netlify UI
10:14:54 AM: Starting build script
10:14:54 AM: Installing dependencies
10:14:54 AM: Python version set to 2.7
10:14:54 AM: Started restoring cached node version
10:14:57 AM: Finished restoring cached node version
10:14:57 AM: v16.13.1 is already installed.
10:14:58 AM: Now using node v16.13.1 (npm v8.1.2)
10:14:58 AM: Started restoring cached build plugins
10:14:58 AM: Finished restoring cached build plugins
10:14:58 AM: Attempting ruby version 2.7.2, read from environment
10:15:01 AM: Using ruby version 2.7.2
10:15:01 AM: Using PHP version 8.0
10:15:01 AM: Installing Hugo 0.89.4
10:15:03 AM: hugo v0.89.4-AB01BA6E+extended linux/amd64 BuildDate=2021-11-17T08:24:09Z VendorInfo=gohugoio
10:15:03 AM: Started restoring cached go cache
10:15:03 AM: Finished restoring cached go cache
10:15:03 AM: go version go1.16.5 linux/amd64
10:15:03 AM: go version go1.16.5 linux/amd64
10:15:03 AM: Installing missing commands
10:15:03 AM: Verify run directory
10:15:05 AM: ​
10:15:05 AM: ────────────────────────────────────────────────────────────────
10:15:05 AM:   Netlify Build                                                 
10:15:05 AM: ────────────────────────────────────────────────────────────────
10:15:05 AM: ​
10:15:05 AM: ❯ Version
10:15:05 AM:   @netlify/build 20.3.1
10:15:05 AM: ​
10:15:05 AM: ❯ Flags
10:15:05 AM:   baseRelDir: true
10:15:05 AM:   buildId: 61b9b203e059df0008c59a9b
10:15:05 AM:   deployId: 61b9b203e059df0008c59a9d
10:15:05 AM: ​
10:15:05 AM: ❯ Current directory
10:15:05 AM:   /opt/build/repo
10:15:05 AM: ​
10:15:05 AM: ❯ Config file
10:15:05 AM:   /opt/build/repo/netlify.toml
10:15:05 AM: ​
10:15:05 AM: ❯ Context
10:15:05 AM:   production
10:15:05 AM: ​
10:15:05 AM: ❯ Installing plugins
10:15:05 AM:    - netlify-plugin-submit-sitemap@0.2.3
10:15:05 AM:    - @netlify/plugin-sitemap@0.8.1
10:15:10 AM: ​
10:15:10 AM: ❯ Loading plugins
10:15:10 AM:    - netlify-plugin-submit-sitemap@0.2.3 from netlify.toml
10:15:10 AM:    - @netlify/plugin-sitemap@0.8.1 from netlify.toml
10:15:10 AM: ​
10:15:10 AM: ────────────────────────────────────────────────────────────────
10:15:10 AM:   1. build.command from netlify.toml                            
10:15:10 AM: ────────────────────────────────────────────────────────────────
10:15:10 AM: ​
10:15:10 AM: $ rm -rf /opt/build/cache && hugo --gc --minify
10:15:11 AM: Start building sites …
10:15:11 AM: hugo v0.85.0-724D5DB5+extended linux/amd64 BuildDate=2021-07-05T10:46:28Z VendorInfo=gohugoio
10:20:22 AM: Canceling deploy

You can see it here:

10:15:01 AM: Installing Hugo 0.89.4
10:15:03 AM: hugo v0.89.4-AB01BA6E+extended linux/amd64 BuildDate=2021-11-17T08:24:09Z VendorInfo=gohugoio

However it then uses a different version to build:

10:15:10 AM: $ rm -rf /opt/build/cache && hugo --gc --minify
10:15:11 AM: Start building sites …
10:15:11 AM: hugo v0.85.0-724D5DB5+extended linux/amd64 BuildDate=2021-07-05T10:46:28Z VendorInfo=gohugoio
10:20:22 AM: Canceling deploy

While of course in the netlify.toml the correct version is specified:

[context.production.environment]
HUGO_VERSION = "0.89.4"
GO_VERSION = "1.17.3"
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"

I only have two plugins installed:

[[plugins]]
package = "@netlify/plugin-sitemap"

[[plugins]]
  package = "netlify-plugin-submit-sitemap"

And I had the very same issue even BEFORE when I had many plugins.
I went over in the last weeks and deleted all of them but these two.

Can you help us? It’s getting very annoying having to go to the pipeline and make sure it didn’t get stuck at some point again.

Hi, @champagnealexandre. I see that the plugin was removed from this site and that there were two successful build in a row, the first of which loaded a cache which was 162.4 MB in size. In other words, it looks like the issue is resolved.

If not, would you please trigger a new deploy that does hang and let us know what time that happened (or what the deploy id is)?

Hi, @alberto98fx. We would be happy to take a look at your site as well. However, you didn’t tell us which site that is. Would you please tell us the site subdomain or its API ID?

You can post that information publicly or you can private message (PM) that to one of our support staff. I’ve confirmed that PMs are enabled for your forum login. Please keep in mind that only one person can see the PM and this will likely mean a slower reply than posting the information publicly. Please feel free to reply to however you prefer though.

Hi @luke,
Thank you for your reply!

Here’s my site ID: 52a2dd86-b092-49c0-8ac5-1b493d5b4b09

Thank you

not at all, see cancelled deploy at Dec 13 at 8:33 PM

Well in that case, could any one of you (or more), share their repos? We would like to have a reproduction for this in case we were to escalate this to the engineers.