We have an issue with Webhook execution on one of out Plesk servers. (On other servers with the same versions this works fine!)
The additional deployment actions are executed in the chroot instead of /bin/bash, if the pull is triggerd via Webhook.
If the repo pull is executed from the ui, the additional deployment actions are executed with /bin/bash.
additional deployment actions (For testing purpose)
/var/log/auth.log contains the following lines after failed webhook execution:
panel.log (pull executed via webhook url)
panel.log ( pull executed from UI)
I think the problem is the following difference, but I can´t figure out why plesk uses /opt/psa/bin/chrootsh on a webhook call.
Plesk Obsidian (Version 18.0.31)
Git (Version 1.1.4-248)
Any ideas appreciated.
The additional deployment actions are executed in the chroot instead of /bin/bash, if the pull is triggerd via Webhook.
If the repo pull is executed from the ui, the additional deployment actions are executed with /bin/bash.
additional deployment actions (For testing purpose)
/var/log/auth.log contains the following lines after failed webhook execution:
Nov 10 17:21:26 plesk06 plesk-chrootsh[391]: execv("/bin/bash") failed
Nov 10 17:21:26 plesk06 plesk-chrootsh[391]: system error: No such file or directory
panel.log (pull executed via webhook url)
[2020-11-10 17:21:24.401] DEBUG [util_exec] [a775bcd5ff0d05c42af670713beeb41b-0] Starting: osdetect, stdin:
[2020-11-10 17:21:24.407] DEBUG [util_exec] [a775bcd5ff0d05c42af670713beeb41b-0] Finished in 0.00554s, Error code: 0, stdout: {"name":"Ubuntu","version":"18.04","short-version":"18.04","arch":"x86_64","pkgtype":"deb","codename":"bionic"}
, stderr:
[2020-11-10 17:21:24.407] DEBUG [extension/git] [5faabe0463773] Starting: '/opt/psa/admin/bin/modules/git/git-helper' 'mydomain' '/var/www/vhosts/mydomain.de/git/repo.git' '--git-dir=/var/www/vhosts/mydomain.de/git/repo.git' 'fetch', stdin:
[2020-11-10 17:21:25.905] DEBUG [extension/git] [5faabe0463773] Finished in 1.49804s, Error code: 0, stdout: , stderr: Public key for the server at 'bitbucket.org' is already known in '/var/www/vhosts/mydomain.de/.ssh/git_known_hosts'.
[2020-11-10 17:21:25.910] DEBUG [extension/git] [5faabe05de430] Starting: '/opt/psa/admin/bin/modules/git/git-helper' 'mydomain' '/var/www/vhosts/mydomain.de/git/repo.git' '--git-dir=/var/www/vhosts/mydomain.de/git/repo.git' '--work-tree=/var/www/vhosts/mydomain.de/repo' 'checkout' '-f', stdin:
[2020-11-10 17:21:25.925] DEBUG [extension/git] [5faabe05de430] Finished in 0.01541s, Error code: 0, stdout: , stderr:
[2020-11-10 17:21:25.946] DEBUG [util_exec] [c66676e7a5d9a00cea19a5ecdfc0d5fd-0] Starting: filemng mydomain file_exists /var/www/vhosts/mydomain.de/bin, stdin:
[2020-11-10 17:21:25.953] DEBUG [util_exec] [c66676e7a5d9a00cea19a5ecdfc0d5fd-0] Finished in 0.00659s, Error code: 0, stdout: 0, stderr:
[2020-11-10 17:21:25.953] DEBUG [util_exec] [dfca0fe796d9119ffadc179f90c78de7-0] Starting: cron_task_executor -u mydomain -c cd 'repo';ls --env SHELL=/opt/psa/bin/chrootsh, stdin:
[2020-11-10 17:21:26.044] DEBUG [util_exec] [dfca0fe796d9119ffadc179f90c78de7-0] Finished in 0.09026s, Error code: 1, stdout: , stderr: execv("/bin/bash") failed
system error: No such file or directory
panel.log ( pull executed from UI)
[2020-11-10 17:24:51.436] DEBUG [util_exec] [5faabed36a7e8] Starting: /opt/psa/admin/bin/php /opt/psa/admin/plib/scripts/task-async-executor.php -task-id 351, stdin:
[2020-11-10 17:24:51.438] DEBUG [util_exec] [5faabed36a7e8] Finished in 0.00225s, Error code: TRUE, stdout: , stderr:
[2020-11-10 17:24:51.529] DEBUG [panel] Task execute: id=351, pid=6565, type=ext-git-task\pull, id=38, referrer=/modules/git/index.php/domain/list, runTaskUnderLogin=admin
[2020-11-10 17:24:51.569] DEBUG [util_exec] [9d7f6aa49ac24a48b4812f044ad11753-0] Starting: osdetect, stdin:
[2020-11-10 17:24:51.575] DEBUG [util_exec] [9d7f6aa49ac24a48b4812f044ad11753-0] Finished in 0.00621s, Error code: 0, stdout: {"name":"Ubuntu","version":"18.04","short-version":"18.04","arch":"x86_64","pkgtype":"deb","codename":"bionic"}
, stderr:
[2020-11-10 17:24:51.575] DEBUG [extension/git] [5faabed38c89f] Starting: '/opt/psa/admin/bin/modules/git/git-helper' 'mydomain' '/var/www/vhosts/mydomain.de/git/repo.git' '--git-dir=/var/www/vhosts/mydomain.de/git/repo.git' 'fetch', stdin:
[2020-11-10 17:24:53.148] DEBUG [extension/git] [5faabed38c89f] Finished in 1.5729s, Error code: 0, stdout: , stderr: Public key for the server at 'bitbucket.org' is already known in '/var/www/vhosts/mydomain.de/.ssh/git_known_hosts'.
[2020-11-10 17:24:53.151] DEBUG [extension/git] [5faabed524e11] Starting: '/opt/psa/admin/bin/modules/git/git-helper' 'mydomain' '/var/www/vhosts/mydomain.de/git/repo.git' '--git-dir=/var/www/vhosts/mydomain.de/git/repo.git' '--work-tree=/var/www/vhosts/mydomain.de/repo' 'checkout' '-f', stdin:
[2020-11-10 17:24:53.165] DEBUG [extension/git] [5faabed524e11] Finished in 0.01472s, Error code: 0, stdout: , stderr:
[2020-11-10 17:24:53.171] DEBUG [util_exec] [5bf3fa06544f832406a5358aa22032eb-0] Starting: cron_task_executor -u mydomain-c cd '/var/www/vhosts/mydomain.de/repo';ls --env SHELL=/bin/bash, stdin:
[2020-11-10 17:24:53.257] DEBUG [util_exec] [5bf3fa06544f832406a5358aa22032eb-0] Finished in 0.08633s, Error code: 0, stdout:
[...output of ls...]
, stderr:
[2020-11-10 17:24:53.268] DEBUG [panel] Task done: id=351, pid=6565, type=ext-git-task\pull, domainId=24, id=38, name=repo.git, referrer=/modules/git/index.php/domain/list, runTaskUnderLogin=admin
I think the problem is the following difference, but I can´t figure out why plesk uses /opt/psa/bin/chrootsh on a webhook call.
Ubuntu 18.04.5 LTSStarting: cron_task_executor -u mydomain -c cd 'repo';ls --env SHELL=/opt/psa/bin/chrootsh, stdin:
Starting: cron_task_executor -u mydomain-c cd '/var/www/vhosts/mydomain.de/repo';ls --env SHELL=/bin/bash, stdin:
Plesk Obsidian (Version 18.0.31)
Git (Version 1.1.4-248)
Any ideas appreciated.