Symptoms
-
A Bash script configured in the Git Additional Deployment actions fails to execute with a not found error:
application_name:command not found
-
The commands or bash script set under Domains > example.com > Git > Repository Settings > Deploy actions uses absolute paths. For example:
/var/www/vhost/example.com/git/script.sh
-
The SSH Access Type is set to Forbidden or /bin/bash chrooted) under Domains > example.com > Hosting & DNS > Hosting.
Cause
The domain is configured to execute the Git additional deployment actions on a chroot environment while using absolute instead of relative paths.
Resolution
Apply one of the following solutions:
Continue to run deployment actions under chroot environment (Recommended)
-
Go to Domains > example.com > Git > Repository Settings (icon)
-
Change all absolute paths under Deploy actions for relative paths e.g. For an script located in
/var/www/vhost/example.com/git/script.sh
set the path as/git/script.sh
Note: All the commands included inside the script file need to use the relative path.
-
In case the Deploy actions or the script requires to run commands other than basic ones (less, tar, zip) by default these will need to be added into the chrooted shell environment template
Run the deployment actions without restrictions
-
Go to Domains > example.com > Hosting & DNS > Hosting
-
Change the SSH Access Type to
/bin/bash
Warning: The user will obtain all access as an ordinary user, including access to /bin, /user etc., as well as to run any application.
Additional information
What is the difference between options 'Access to the server over SSH' parameter in Plesk?