Pages - Hugo Build Stopped Working

Deploys were working fine (after resolving my original issue). We started receiving a new error pertaining to our build command.

16:52:30.848	[20:52:30] Starting 'scripts:production'...
16:52:30.904	[20:52:30] Starting 'images'...
16:52:30.907	[20:52:30] Starting 'svg'...
16:52:31.125	[20:52:31] gulp-imagemin: ✔ author/jane-doe.jpg (already optimized)
16:52:31.162	internal/streams/legacy.js:57
16:52:31.162	      throw er; // Unhandled stream error in pipe.
16:52:31.162	      ^
16:52:31.163	
16:52:31.164	Error: EPERM: operation not permitted, chmod '/opt/buildhome/repo/hugo/static/img/author/jane-deo.jpg'
16:52:31.171	npm ERR! code ELIFECYCLE
16:52:31.172	npm ERR! errno 1
16:52:31.173	npm ERR! [email protected] build: `cross-env NODE_ENV=production gulp build`
16:52:31.173	npm ERR! Exit status 1
16:52:31.174	npm ERR! 
16:52:31.174	npm ERR! Failed at the [email protected] build script.
16:52:31.174	npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I took this same repo and put on Netlify to test and had zero build issues. Any ideas on why this operation is not permitted as is on Cloudflare?

You are not alone! I have a JS mono repo with a CLI tool in it. Sometime last week the chmod operation on the bin file (standard part of the npm install of a cli package) in that tool started to fail. This is a part of log from an old commit which has deployed successfully previously. I’m pretty sure something in the environment must have changed:

...
22:55:12.581	.../node_modules/pngquant-bin postinstall:   ✔ pngquant pre-build test passed successfully
22:55:12.589	.../node_modules/pngquant-bin postinstall: Done
22:55:13.249	 ERROR  EPERM: operation not permitted, chmod '/opt/buildhome/repo/packages/compost/bin/compost.js'
22:55:13.250	
22:55:13.250	
22:55:13.250	Failed: build command exited with code: 1

Supposedly a fix is coming today or tomorrow (per a conversation in Discord). Fingers crossed! We can’t go live with a site as is…

Ahh nice. Thanks for the update! didn’t occur to me to check discord.