1

I have a docker and DDEV setup running on a linux/amd64 machine.

While all commands are working as expected, does ddev drush ... not.

This error is given:

/mnt/ddev_config/.global_commands/web/drush: line 14: /var/www/html/vendor/bin/drush: Permission denied Failed to run drush : exit status 126 I have read about the expirimental features but am not able to disbale them.

Due to this article I created a daemon.json in /etc/docker

{
  "experimental": false
}

but did didn't resolve my problem

info:

// docker version
Client:
 Version:           20.10.14+dfsg1
 API version:       1.41
 Go version:        go1.18
 Git commit:        a224086
 Built:             Wed Mar 30 16:07:00 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

rfay
  • 9,963
  • 1
  • 47
  • 89
Joehoe
  • 183
  • 3
  • 13
  • Exit code 126 probably means that /var/www/html/vendor/bin/drush is not executable. Please check inside the container and see if it is. `ls -l /var/www/html/vendor/bin/drush`. Then look on the host side. Is it executable there? `ls -l vendor/bin/drush`. If not, something probably happened to your repo files. – rfay May 02 '22 at 18:36
  • What is the correct permission? inside the container is 666/rw-rw-rw and 644/-rw-r--r-- on the host. I'm only able to run `ddev drush cr` if executable is set to `chmod 777 vendor/bin/drush` – Joehoe May 02 '22 at 20:17
  • The normal permission would be 755. It has to be executable. 777 should be fine as well. `chmod 777 vendor/bin/drush` is fine, so is `chmod +x vendor/bin/drush` – rfay May 02 '22 at 20:45
  • You seem to have somehow removed the executable bit from vendor/bin/drush... but if you did that via a git problem or something else, you'll likely have trouble with other things as well, so beware. – rfay May 02 '22 at 20:46
  • I will keep that in mind. Might indeed have a git problem. thnx for the help. – Joehoe May 02 '22 at 20:56

1 Answers1

3

The reason for your problem is that vendor/bin/drush has somehow gotten its executable bit removed (apparently on the host side), so when ddev drush tries to execute it, it fails... because it's not executable.

The error message tried to explain this: "/var/www/html/vendor/bin/drush: Permission denied Failed to run drush : exit status 126" and the exit code 126 is about executable status.

The fix is chmod +x vendor/bin/drush

rfay
  • 9,963
  • 1
  • 47
  • 89