Scenario

The script is there and refuses to run

The release script is where it should be, its mode is fine, /bin/bash exists, and running it answers required file not found. Through bash it works.

Release deploys broke after a colleague edited the script from their laptop. The wrapper /opt/deploy/run.sh that CI calls fails at the very first step. The file it points at is there, its permissions are ordinary, and the colleague insists that "it runs fine for me".

The symptom

The entry point does not work and says it could not find some file. Both files it could possibly mean exist. And through bash the script runs.

$ sudo /opt/deploy/run.sh
/opt/deploy/run.sh: line 4: /opt/deploy/release.sh: cannot execute: required file not found
$ echo $?
127

$ ls -l /opt/deploy/release.sh /bin/bash
-rwxr-xr-x 1 root   root   1446024 Mar 31  2024 /bin/bash
-rwxr-xr-x 1 deploy deploy     135 Aug 18 09:26 /opt/deploy/release.sh

$ bash /opt/depl
Free with account

Finish this lesson with a free account

This lesson is free once you sign in. Create an account to keep reading and open the lab.

Create a free account

Already have an account? Sign in