Deploys failing - Failed during stage 'building site': Build script returned non-zero exit code: 2

I have a blog on and am using the stackbit/Netlify integration, which is using Hugo. This has been up and running for a while and working beautifully. As of Feb 19th, my deployments have failed with the error: Failed during stage ‘building site’: Build script returned non-zero exit code: 2 and in the logs it says:

1:17:17 PM: $ ./
1:17:17 PM: curl -s -X POST > /dev/null
1:17:18 PM: if [[ -z "${STACKBIT_API_KEY}" ]]; then
1:17:18 PM:     echo "WARNING: No STACKBIT_API_KEY environment variable set, skipping stackbit-pull"
1:17:18 PM: else
1:17:18 PM:     npx @stackbit/stackbit-pull --stackbit-pull-api-url=
1:17:18 PM: fi
1:17:20 PM: npx: installed 11 in 2.011s
1:17:20 PM: fetching data for project from
1:17:22 PM: Error: Failed to build project, statusCode: 500, response: {}
1:17:22 PM:     at IncomingMessage.res.on (/opt/buildhome/.npm/_npx/1488/lib/node_modules/@stackbit/stackbit-pull/stackbit-pull.js:50:35)
1:17:22 PM:     at IncomingMessage.emit (events.js:203:15)
1:17:22 PM:     at endReadableNT (_stream_readable.js:1145:12)
1:17:22 PM:     at process._tickCallback (internal/process/next_tick.js:63:19)

I have tried running this locally and I get the same error running on my local setup, and I am struggling to know what logs/debugging info is available to help me get to the bottom of this.

The only difference I can see between the failing deployments and the previous ones that worked are the following - working was using 9.1.2 and all the failing ones have 9.1.3.

1:17:17 PM: ────────────────────────────────────────────────────────────────
1:17:17 PM: Netlify Build
1:17:17 PM: ────────────────────────────────────────────────────────────────
1:17:17 PM: ​
1:17:17 PM: ❯ Version
1:17:17 PM: @netlify/build 9.1.2

So, is there a way to specify the build version so that I can try and see if it is the version that is causing my problems?

It looks like the issue resolved itself. When I retried just now, it published ok.

Hi there, @094459 ,

Welcome to Netlify Forums! Sorry for the delayed response.

I am glad to see that this issue has resolved itself! Please do not hesitate to post a question in the future should you encounter other questions.