I have a circle.yml
file like so:
dependencies: override: - meteor || curl https://install.meteor.com | /bin/sh deployment: production: branch: "master" commands: - ./deploy.sh
When I push to Github, I get the error:
/home/ubuntu/myproject/deploy.sh returned exit code 126 bash: line 1: /home/ubuntu/myproject/deploy.sh: Permission denied Action failed: /home/ubuntu/myproject/deploy.sh
When I run the commands that live inside deploy.sh
outside of the file (under commands
) everything runs fine.
Everything in the circle.yml
file seems to be in line with the examples in the CircleCI docs.. What am I doing wrong?
Solution to fix the bash: ./program_name: permission denied error. chmod u+x program_name– In this line, the chmod command will change the access mode to execute, denoted by x. only the file's owner will have the permission to execute the file.
To fix the permission denied error in Linux, one needs to change the file permission of the script. Use the “chmod” (change mode) command for this purpose.
The Bash permission denied error indicates you are trying to execute a file which you do not have permission to run. To fix this issue, use the chmod u+x command to give yourself permissions. If you cannot use this command, you may need to contact your system administrator to get access to a file.
For solving this error, you need to add the correct permissions to the file to execute. However, you need to be a “root” user or have sudo access for changing the permission. For changing the permission, Linux offers a chmod command.
Several possible problems:
chmod +x deploy.sh
would fix this)If the first doesn't work, can we please see the contents of deploy.sh?
I was having the same issue. I added sh to the front of my commands section to get it to work.
deployment: production: branch: "master" commands: - sh ./deploy.sh
Hopefully that fix saves everyone sometime going forward.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With