Comments (11)
Does this command work, if you run it manually?
ssh -t -o PasswordAuthentication=no <username>@<ip_address> '/home/forge/vendor/bin/drush status -vvv --uri=https://my.website.com
If not, what is the path to the site-local Drush in your remote Drupal site?
from drush.
That command will not work because drush is not located at that path, it is located in the vendor/bin
directory of the local site installation.
In troubleshooting this after opening this ticket, I did determine that if the path to the drush-script is explicitely specified in the site alias file (which means that we are bypassing the drush launcher script (which we do have installed), the site aliases work again.
Guess this means that drush-launcher
is not compatible with Drush 12.
from drush.
It is true that drush-launcher
is not presently compatible with Drush 12.
Drush 12 also adds the requirement that the remote Drush be a site-local Drush. It should assume that Drush is located in vendor/bin
on your remote site, but your initial report showed that Drush was trying to find it in bin
. (n.b. the command I asked you to run was different from the one that you reported as not working only in the location of Drush, which I manually changed from bin
to vendor/bin
.)
You didn't show drush-script
in use in your initial report, but in your most recent comment you imply that you might be using it. The existence of drush-script
is relevant to Drush's behavior here.
from drush.
I think this can be closed, since adding the specific path to the local drush install for each environment defined in the self.site.yml file rectified the problem. But, now this is documented for anyone else that encounters this issue.
Thanks @greg-1-anderson !
from drush.
What did you change to fix it? Is your site local Drush located at vendor/bin
, or somewhere else?
from drush.
The site local drush is in "vendor/bin", I added the following to the drush aliases:
paths:
drush-script: '/home/forge/<my.website.com>/public/vendor/bin/drush'
from drush.
Yes, that workaround will be necessary if your site has the project root at the docroot. It is recommended to put vendor outside of the docroot, e.g. with Drush located at '/home/forge/<my.website.com>/vendor/bin/drush'
from drush.
I'm running into this drush script being incorrect too:
bash: line 1: /var/www/bin/drush: No such file or directory
The drush-script
workaround mentioned above works.
paths:
drush-script: '/var/www/PROJECT_ROOT/vendor/bin/drush'
@greg-1-anderson Do you happen to know where/how that path is derived? I'll dig a bit
from drush.
Tracking it down, seems like the problem happens in
\Drush\SiteAlias\ProcessManager::relativePathToVendorBinDrush
from drush.
What that translates to for me:
prod:
host: www.example.org
user: www
root: /var/www/SITE/current # (PROJECT ROOT)
uri: https://www.example.org
When this runs to join the root and relative path:
Path::join($siteAlias->root(), $this->relativePathToVendorBinDrush());
vendor/drush/drush/src/SiteAlias/ProcessManager.php:73
That ../../bin
in the above screenshot cuts out the SITE/current
and even if I put the root to the Web Root:
/var/www/SITE/current/web # (Web ROOT)
It's still the wrong directory.
Am I doing something wrong in my interpretation of what root
is?
from drush.
Luckily xdebug
allowed me to find the issue was the relative directory wasn’t correct when applied to the remote site alias.
runtime.project
seemed to match better with the goal in the docblock of the method changed in that PR and the only available variable that did… but one thing I’ll note the site alias's root
needs to be the project root
, not the web/doc root
(unless that’s where you’re vendor
directory is…) I had my root
in the site alias set to the webroot
for Drush 11
, and it needed to change...
The example is not clear what root
is.
https://github.com/drush-ops/drush/blob/12.x/examples/example.site.yml#L9
from drush.
Related Issues (20)
- Add support for symfony 7 in 13.x and minimum version of PHP 8.3
- Database update step for `drush deploy` behaves differently than `drush updb --no-cache-clear` HOT 2
- 'Generate generator' command is missing in Drush 12.5+ (present in 13)
- Stop supporting and testing the Windows OS
- Environment variables ignored if the value provided in the configuration file HOT 2
- DrupalFinder drush replacement PR did not fully replaced it in Preflight HOT 3
- Fatal error on cron command help HOT 2
- Twig compile - provide searchpaths argument
- Lexer.php/ParserAbstract.php errors when calling namespaced class in php-cli
- Severe error when `ddev start`
- Symlinks to directories outside project break archive dump.
- Drush dependency throwing Fatal Php Error HOT 6
- Allow Drush site-install to install from recipes
- drush entity:save fails with chunks option HOT 1
- The site:install command with option `--yes` is throwing error HOT 1
- (Un)Intentional usage of self::REQ in QueueCommands class HOT 1
- Cannot set watchdog:show --severity-min level in English ("Warning"), when default language is something else
- pm:enable installs a module even if hook_requirements returns 'severity' => REQUIREMENT_ERROR HOT 3
- Support --limit option in entity:delete command HOT 1
- archive:dump can't handle filenames longer than 100 characters HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from drush.