Drush command from contrib module not recognized

I have installed a new module called “s3fs” using composer.

when i try to execute the below command it says ” command not defined”

I found that i could not run any commands from contrib modules that i installed and enabled

Please advise how to fix this

[root@ip-10-133-48-XXXs3fs]# /root/.composer/vendor/bin/drush drush_s3fs_copy_local Command “drush_s3fs_copy_local” is not defined.

Using a class to call a call a custom drush service

I have created a drush service and I can use it on the command line, but I am trying to use dependency injection to use it from another class. However, it is saying that the service cannot be found. (From the public function __construct) All other regular services can be injected and used, except for the drush service. Can I inject drush services? Is injecting them different from other injection dependencies?

I have add the changes in the composer,json {extra}, created drush.services.yml and the Commands.php file. Everything works except the dependency injection.

I’m using Drupal 8, drush 9

thanks,

Why is drush make installing a D8 library in /sites/all/libraries instead of /libraries?

I am trying to allow prospective users to demo my module on simplytest.me, however, it requires an external javascript library. I recently created a drush make file for the D7 version of this module, and it is working fine. The D8 version is downloading the library, but placing it in drupalroot/sites/all/libraries instead drupalroot/libraries. Is there a way to change this behavior? Here is my make.yml file.

api=2 core = 8.x projects[drupal][type] = core libraries[flot][download][type] = get libraries[flot][download][url] = https://github.com/flot/flot/archive/master.zip libraries[flot][destination] = libraries libraries[flot][directory_name] = flot 

I tried using libraries[flot][destination] = /libraries but that did not change the behavior.

Why did most of my Drush commands disappear?

Drush 9.5.2 with Drupal 8.6.3 (updating to 8.6.6 once I get Drush working again). We manage a lot of Drupal 8 sites, but for some reason, Drush stopped working properly on just one of them.

Most commands are now “not defined.” This includes cr (cache rebuild), updb (update database), status, and anything normally listed under core, entity, role, user, etc. When I run “drush list” it only gives me the following categories: _global, config, pm, sql, theme, and webform. The rest have just disappeared.

Everything else about the site seems to work fine. Normally, I would run “drush status” to see if it was seeing the site properly. But just like the other commands, running it just returns a big red “Command ‘status’ is not defined.”

Where should I start looking to figure out how Drush broke and how to fix it? Thanks in advance!

Why am i getting this Drush error after updating a site?

I use Drush 8.1.17 to update my Drupal 7 sites, and as I have been updating my sites today after the latest security update I have noticed that after I update a site if I try to run any update related command (ex: drush up -n | grep available) I get this error:

The external command could not be executed due to an application error.                                      [error] The command could not be executed successfully (returned: PHP Fatal error:  Uncaught                         [error] TYPO3\PharStreamWrapper\Exception: Unexpected file extension in "phar:///usr/local/bin/drush/includes/.." in /srv/www/htdocs/fac-dev/misc/typo3/drupal-security/PharExtensionInterceptor.php:39 Stack trace: #0 /srv/www/htdocs/fac-dev/misc/typo3/phar-stream-wrapper/src/Behavior.php(72): Drupal\Core\Security\PharExtensionInterceptor->assert('phar:///usr/loc...', 'url_stat') #1 /srv/www/htdocs/fac-dev/misc/typo3/phar-stream-wrapper/src/Manager.php(83): TYPO3\PharStreamWrapper\Behavior->assert('phar:///usr/loc...', 'url_stat') #2 /srv/www/htdocs/fac-dev/misc/typo3/phar-stream-wrapper/src/PharStreamWrapper.php(412): TYPO3\PharStreamWrapper\Manager->assert('phar:///usr/loc...', 'url_stat') #3 /srv/www/htdocs/fac-dev/misc/typo3/phar-stream-wrapper/src/PharStreamWrapper.php(401): TYPO3\PharStreamWrapper\PharStreamWrapper->assert('phar:///usr/loc...', 'url_stat') #4 [internal function]: TYPO3\PharStreamWrapper\PharStreamWrapper->url_stat('phar:///usr/loc...', 2) #5 phar:///usr/local/bin/drush/includes/filesyste in /srv/www/htdocs/fac-dev/misc/typo3/drupal-security/PharExtensionInterceptor.php on line 39 , code: 255) pm-updatestatus failed. 

Does anyone know why this error only appeared after I updated the site and how I can fix it?

How to check for differences in config with drush 8?

Is there any way to check for differences with config in Drush?

I checked the list of drush 8 config commands and I couldn’t find anything.

The reason I need this is that I have a site that runs behat tests via CircleCI, and sometimes I need to import the configuration more than once. So, I wanted to write a bash script that uses Drush to check whether there are any configuration differences, and if so, automatically re-imports the config in a loop until there are no more differences.

I’m stuck on Drush 8 because the behat extension only supports Drush 8.

How to clear all caches with Drush 9?

https://drushcommands.com/drush-9x/cache/cache:clear/ this doesn’t give any option to clear all caches. All you get is to choose from 0-7, old drush cc all or cr all are gone.

Eg.

root@dev:/var/www/example.com/htdocs# drush cc --cache-clear   Choose a cache to clear:   [0] Cancel   [1] drush   [2] theme-registry   [3] router   [4] css-js   [5] render   [6] plugin   [7] bin   [8] views  > 7   [success] 'bin' cache was cleared. 

How to clear all options below with one command? I can’t find it documented.

Drush does not work invoking the local Drush (D8 Composer Installation)

I have installed new D8 on a remote server using this way https://github.com/drupal-composer/drupal-project . I have pulled files from GitHub and I have run ‘composer install’ for getting the all vendor files include the local Drush (/vendor/drush/drush/) When I run ‘drush status’ or ‘drush core-status’ on the root (or ‘/web’) website directory I have:

vagrant@drupalvm8:/var/www/drupalvm/test8$   drush core-status PHP Warning:  pcntl_exec(): Error has occurred: (errno 8) Exec format error in /usr/local/share/drush/includes/startup.inc on line 412 Warning: pcntl_exec(): Error has occurred: (errno 8) Exec format error in /usr/local/share/drush/includes/startup.inc on line 412 Error has occurred executing the Drush script found at /var/www/drupalvm/test8/vendor/bin/drush.launcher (errno 8) Exec format error