Curious if anyone has ever run into this before or may know what's going on here. I'm using the execWidget plugin (https://github.com/marionnewlevant/craft-exec_widget) to run a script from Craft's dashboard that does a composer install when the lock file has changed.

Here is the configuration for the plugin:

return [
  '*' => [
  'local' => [
    'commands' => [
      'composer install' => '../scripts/ed-day_composer.sh',
      'pull assets from production' => '../scripts/pull_assets.sh',
  'staging' => [
    'commands' => [
      'composer install' => '../scripts/ed-day_composer.sh',
      'push everything production' => '../scripts/push_all.sh',

Here is the composer install script:


# Get the directory of the currently executing script
DIR="$(dirname "${BASH_SOURCE[0]}")"

# Include files
    if [ -f "${DIR}/${INCLUDE_FILE}" ]
        source "${DIR}/${INCLUDE_FILE}"
        echo "File ${DIR}/${INCLUDE_FILE} is missing, aborting."
        exit 1

(cd "${LOCAL_ROOT_PATH}/craft"; HOME=${LOCAL_HOME} composer install)

I get a returned 127 error from the queue.log and the scrip does not actually work:

2018-06-25 14:10:12 [][1][-][info][craft\queue\QueueLogBehavior::beforeExec]  [45] ExecWidget Task (attempt: 1) - Started
2018-06-25 14:10:12 [][1][-][info][marionnewlevant\execwidget\jobs\ExecWidgetTask::log] executing ../scripts/ed-day_composer.sh
2018-06-25 14:10:12 [][1][-][info][marionnewlevant\execwidget\jobs\ExecWidgetTask::log] returned 127

Based on testing I've done, I'm almost certain the issue is with composer because I get a success error message when I remove just the composer part of the line.

Composer works when SSHing in. Any idea what might be causing the issue?

  • If you SSH in and execute scripts/ed-day_composer.sh directly, do you get the same error response?
    – Brad Bell
    Commented Jun 25, 2018 at 22:31
  • Hey @BradBell - good suggestion! So if I SSH in and execute the script, it works, but still gives the same error when attempting to run it via the Craft control panel. Any idea as to what that means or where to investigate further?
    – dpayne
    Commented Jun 26, 2018 at 15:02
  • Update here - seems likely this is tied to some sort of permissions issue as I get this error when I attempt to install a plugin from the plugin store: Error: file_put_contents(/home/ediscoveryday/www/stage/craft/composer.json): failed to open stream: Permission denied. Working to find the exact permissions I need to adjust.
    – dpayne
    Commented Jun 26, 2018 at 15:31

1 Answer 1


The problem seems to be tied to Composer not having the correct permissions. Will work with our IT team to update so Composer can write appropriately when initiated from Craft.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.