Flutter build.sh Permission Denied Exit Code 126

HI there !

After sorting out how to deploy a flutter web project continuously, I’m running into a frustrating problem.

I’m following this post here

Honestly I’m new to all this ! Just want to figure out a way to get my Flutter Web pages with Netlify ! Love the product.

Here is the whole build output

1:53:31 PM: Build ready to start
1:53:37 PM: build-image version: b0258b965567defc4a2d7e2f2dec2e00c8f73ad6
1:53:37 PM: build-image tag: v3.4.1
1:53:37 PM: buildbot version: fcbc7a79f7372e5995cf02954ef19fc48d20c871
1:53:37 PM: Fetching cached dependencies
1:53:37 PM: Starting to download cache of 2.1KB
1:53:37 PM: Finished downloading cache in 90.103244ms
1:53:37 PM: Starting to extract cache
1:53:37 PM: Finished extracting cache in 7.594446ms
1:53:37 PM: Finished fetching cache in 97.93377ms
1:53:37 PM: Starting to prepare the repo for build
1:53:38 PM: Preparing Git Reference refs/heads/master
1:53:40 PM: Starting build script
1:53:40 PM: Installing dependencies
1:53:40 PM: Python version set to 2.7
1:53:42 PM: v12.18.0 is already installed.
1:53:43 PM: Now using node v12.18.0 (npm v6.14.4)
1:53:43 PM: Started restoring cached build plugins
1:53:43 PM: Finished restoring cached build plugins
1:53:43 PM: Attempting ruby version 2.7.1, read from environment
1:53:45 PM: Using ruby version 2.7.1
1:53:45 PM: Using PHP version 5.6
1:53:45 PM: 5.2 is already installed.
1:53:45 PM: Using Swift version 5.2
1:53:45 PM: Started restoring cached go cache
1:53:45 PM: Finished restoring cached go cache
1:53:45 PM: go version go1.14.4 linux/amd64
1:53:45 PM: go version go1.14.4 linux/amd64
1:53:45 PM: Installing missing commands
1:53:45 PM: Verify run directory
1:53:46 PM: ​
1:53:46 PM: ┌─────────────────────────────┐
1:53:46 PM: │ Netlify Build │
1:53:46 PM: └─────────────────────────────┘
1:53:46 PM: ​
1:53:46 PM: ❯ Version
1:53:46 PM: @netlify/build 3.3.0
1:53:46 PM: ​
1:53:46 PM: ❯ Flags
1:53:46 PM: deployId: 5f4fdc1ad1bad91add669b08
1:53:46 PM: mode: buildbot
1:53:46 PM: ​
1:53:46 PM: ❯ Current directory
1:53:46 PM: /opt/build/repo
1:53:46 PM: ​
1:53:46 PM: ❯ Config file
1:53:46 PM: /opt/build/repo/netlify.toml
1:53:46 PM: ​
1:53:46 PM: ❯ Context
1:53:46 PM: production
1:53:46 PM: ​
1:53:46 PM: ┌────────────────────────────────────┐
1:53:46 PM: │ 1. build.command from netlify.toml │
1:53:46 PM: └────────────────────────────────────┘
1:53:46 PM: ​
1:53:46 PM: $ ./build.sh
1:53:46 PM: bash: ./build.sh: Permission denied
1:53:46 PM: ​
1:53:46 PM: ┌─────────────────────────────┐
1:53:46 PM: │ “build.command” failed │
1:53:46 PM: └─────────────────────────────┘
1:53:46 PM: ​
1:53:46 PM: Error message
1:53:46 PM: Command failed with exit code 126: ./build.sh
1:53:46 PM: ​
1:53:46 PM: Error location
1:53:46 PM: In build.command from netlify.toml:
1:53:46 PM: ./build.sh
1:53:46 PM: ​
1:53:46 PM: Resolved config
1:53:46 PM: build:
1:53:46 PM: command: ./build.sh
1:53:46 PM: commandOrigin: config
1:53:46 PM: publish: /opt/build/repo/build/web
1:53:47 PM: Caching artifacts
1:53:47 PM: Started saving build plugins
1:53:47 PM: Finished saving build plugins
1:53:47 PM: Started saving pip cache
1:53:47 PM: Finished saving pip cache
1:53:47 PM: Started saving emacs cask dependencies
1:53:47 PM: Finished saving emacs cask dependencies
1:53:47 PM: Started saving maven dependencies
1:53:47 PM: Finished saving maven dependencies
1:53:47 PM: Started saving boot dependencies
1:53:47 PM: Finished saving boot dependencies
1:53:47 PM: Started saving go dependencies
1:53:47 PM: Finished saving go dependencies
1:53:50 PM: Error running command: Build script returned non-zero exit code: 1
1:53:50 PM: Failing build: Failed to build site
1:53:50 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 1
1:53:50 PM: Finished processing build request in 13.764158317s

hey there,

this isn’t the 100% exact same error code, but if you are getting a permissions error, you might be able to follow this pattern of chmod’ing the file:

Love how on point you guys are. I’m trying it now and will let you know what the results are ! I hope we can crack the nut on this ! I know there are people really interested in Flutter Web + Netlify

1 Like

thanks! It’s super interesting - we (the support team) unfortunately don’t really have time to dig into it, but i bet there will be quite a few folks who are interested in this.

Let us know what you find!

Got ourselves a working site ! I saw this post too but I just overlooked it cause I tried something similar. Thank you !

1 Like