Questions tagged [drush]

Use it for questions about the command line shell and Unix scripting interface for Drupal (a.k.a. Drush).

Filter by
Sorted by
Tagged with
1
vote
1answer
36 views

Error: Call to undefined function drush_shift()

We recently moved to Drupal 9.3.0 with a composer file layout and Drush 11.0. We make use of Drush Scripts to execute website functions from Crontab. One specific case is sending a newsletter email ...
0
votes
0answers
22 views

How to prevent drush migrate:import from updating existing content?

Drush migrate:import (version 10.3.6) seems to be updating existing content regardless if the --update option is used or not. What could be the problem? I've tested it both with and without the --...
-1
votes
0answers
19 views

Deprecated drush methods [closed]

drush_get_option('force-rebuild', FALSE); The code above is deprecated, any workable suggestions will be appreciated.
3
votes
1answer
77 views

Status page shows "Mismatched Entity.." for a Paragraph field but Drush entup give error "..storage cannot change the schema for an existing field"

I'm stuck in a loop. The Drupal 9.3 status page shows the following error: Mismatched entity and/or field definitions The following changes were detected in the entity type and field definitions. ...
-2
votes
0answers
16 views

Issues TypeError: Return value of Drush\Drush::drushReadDrushInfo() must be of the type array

Problem/Motivation After moving the website from local to a shared hosting, I can't view the /admin/modules "Extend" GUI Content of drush.info inside vendor/drush/drush/: drush_version=10.6....
-2
votes
0answers
34 views

Problem with site install and database with drush [closed]

I am setting up a new user and domain (with DirectAdmin) and am trying to install D8. However, this fails with the following error: myuser@s2:~/public_html$ drush si --db-url=mysql://myuser_drupal:...
2
votes
1answer
53 views

How do I run the drush tests in docker?

I'm trying to improve drush, and the drush contributing guidelines state: Drush's own tests may be run within provided Docker containers (see docker-compose.yml): Start containers: docker-compose up -...
1
vote
0answers
23 views

Problems in collations when restoring

I'm quite lost with this issue I'm experiencing, so any clue will be appreciated. Let's start with the "symptoms". Whenever I restore a Drupal 7 site that has been previously backed up with ...
2
votes
1answer
36 views

How do I switch user account in drush to test permissions?

I'm playing around with the D9 Groups module and I want to test the access control in drush, either using drush php or writing a script and using drush scr. In drush 8 I would always use drush -u to ...
0
votes
1answer
56 views

Is it possible to use WSL-based Drush on a Windows 10 XAMPP and if so how?

I currently use Drupal 9 but concepts about Drupal 10 may be useful. I use Windows 10 Home with XAMPP and C:/xampp/htdocs is my web application root. I want to establish a minimal Drupal development ...
2
votes
0answers
35 views

drush cr on replicated servers

I am the administrator of a Drupal site replicated on 4 servers, behind a load balancer. There is only one database that is shared by the 4 instances. When I run drush cr, is it necessary to run it on ...
0
votes
1answer
31 views

SQL Error when trying to remove content type field

I was trying to create a new Content Type for my site and I chose a field name ("description") that already used for other content types. The problem occurred when saving changes as the ...
-1
votes
1answer
54 views

Options for pml command with Drush 10

I just install a Drupal 9.2 site and Drush 10 to manage it. Usually I use Drush 9 and Drupal 8.9. It appear option for pml command seem not to work in Drush 10 as it do in Drush 9. Example: drush @...
0
votes
0answers
33 views

Adding custom field generated by drush to available fields on node

I have an existing custom module on my D9 website and I need to make some changes inside it. I want to add a field (boolean) into any content type page edit without doing it manually. So I need my ...
2
votes
1answer
66 views

Drush script memory problem

I'm running a long drush script and its causing memory problems. Then I tried debbuging it and I have this very simple code: $query = \Drupal::entityTypeManager()->getStorage('user'); foreach ($...
0
votes
0answers
39 views

Drush 10 sql-sync and multi site --uri not working

I am doing some D8 to D9 migrations and having a problem with a multisite. I upgraded my local version to drush 10 as well as on my dev server and included the drush/sites/us2.site.yml file. I can sql-...
1
vote
1answer
185 views

How can I fix this query error with drush sql-sync?

I crafted my drush/sites/self.site.yml like below* and verified that drush rsync @prod:%files @self:%files worked. However, drush sql-sync @prod @self results in the following error: The command &...
1
vote
1answer
96 views

Can't change PHP version during Drush update database command

My server currently is using PHP 7.1 but I need to run PHP 7.4 during my drush commands on one of my sites. The following works for almost all commands: /path/to/my/php74 ../vendor/bin/drush cr /path/...
0
votes
1answer
91 views

Is there any way to revert the changes done by "drush cim"?

I usually take backup of the entire database before importing new configurations, but this time I didn't and now I need to double check something with old version of database. Is it possible to just ...
0
votes
0answers
31 views

ddev Too many arguments, expected arguments "command" "key"

I'm trying to run ddev exec drush state:set system.maintenance_mode 1 With MAMP drush state:set system.maintenance_mode 1 works fine. With ddev I get the error: Too many arguments, expected ...
0
votes
1answer
25 views

Calling setExposedInput() from a Drush command doesn't have any effect

We have a custom Drush command implemented using the following code. class JobApplicationExportCommands extends DrushCommands { /** * Exports Dorea Job Applications since the last run to csv *...
0
votes
1answer
30 views

Custom Migration Plugin MySQL Error

I've run into the following error when running the command drush migrate-import custom_spotlight where custom_spotlight is the name of the plugin. I've been following along with this guide: https://...
0
votes
1answer
105 views

Drush fails with PHP 8 due to padraic/humbug_get_contents requirements

I'm sure there is a simple fix, but I can't figure it out. This is my error every time I try to run drush updatedb $ drush updatedb Box Requirements Checker ======================== > Using PHP ...
0
votes
1answer
232 views

Uninstalling Lightning causes an error

I am trying to uninstall Lightning. When I run drush pm:uninstall lightning, it throws this error. In PmCommands.php line 196: lightning: The Lightning module is required How can I resolve this?
1
vote
0answers
35 views

How do I migrate product fields?

I'm migrating Drupal 7 commerce products to Drupal 9 and I'm using: Drush (10.5.0) migrate_plus migrate_tools commerce_migrate_commerce commerce_migrate I have successfully migrated nodes, but I ...
3
votes
1answer
67 views

Exclude settings from a contrib module on export

I've two environment, dev and staging. I'm using the ReCaptcha module. In the developpement environment, I have some api keys a other config which until now, are exported thanks to drush cex inside ...
0
votes
0answers
53 views

Using Drush 10 and sql-sync with path based sites not working

We have two websites running off a single domain: https://www.mywebsite.com https://www.mywebsite.com/mywebsitetools Both websites have their own databases and are hosted by Acquia. We've been using ...
0
votes
0answers
19 views

Encoding problems in drush 7 running on Windows

I am not very familiar with PHP, Drupal and drush but I inherited a site running on Windows Server 2019 (in the process of being migrated from Ubuntu). When I want to download some webforms using ...
3
votes
2answers
1k views

How can I fix the "The specified database connection is not defined: default" error?

I installed PHP 7.4.21, then Drupal 9.2.1, and Drush 10.5.0 with Composer as well. Running Drush without arguments, I get the list of all the available commands. Running drush cr gives me the ...
1
vote
1answer
74 views

Bulk user creation and email notification

I want to bulk create about 2-300 users with Drush on a Drupal 8 site. I want each of them to receive a welcome email and be forced to set up their own passwords. This can be done trivially with the &...
4
votes
1answer
120 views

drush config-status on translation / language config files?

Similar with but not the same as How to use drush config:set for translations?, is there a way to scan for a site's language config changes via drush or so? I have a lot of sites on the same server (...
0
votes
0answers
74 views

Drush 10 is not working - seems unable to properly find the site

Greetings to all of you. Drush seems unable to properly find the site. The output of vendor/drush/drush/drush status PHP binary : /usr/bin/php PHP ...
0
votes
0answers
110 views

$container not initialized after installation from sources (code and database)

I'm working on a site installed with Composer. After the local installation broke, I'm trying to reinstall the project from source code and the MySQL database. All the sources are versioned on Git (...
0
votes
2answers
42 views

How to export 1 or several specific rules?

I want to export one or more specific rules or components using Drush. I do have a script to export all the rules and components. drush --pipe rules-list | xargs -I{} sh -c "drush rules-export '{...
0
votes
1answer
42 views

Drush won't run, 'status' shows web directory twice

I have a multi-site Drupal 8 install and Drush has stopped working. All Drush commands fail with a "Bootstrap failed" error. "Drush status" shows the /web dir twice as the root. ...
-2
votes
1answer
89 views

I am unable to run "drush site-install" without getting errors

When I open Terminal on the david/Sites/animals directory, and I run drush site-install --db-url=mysql://david:root@localhost:3306/animals, the get the following error. In SiteInstallCommands.php ...
0
votes
1answer
36 views

Drush issue duplicating includes/ directory

Using drush either globally or with a composer installed version, I get this double includes showing up in my fatal error (/includes/includes/): include_once(/srv/www/htdocs/sites/drupal/includes/...
1
vote
2answers
235 views

PHP Fatal error: Uncaught ArgumentCountError on Drush run

After I updated my site to Drupal 8.9.16 and Drush to 10.5.0 I get the following error PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function when running any Drush command. This ...
0
votes
0answers
28 views

How do I install Drupal with multiple custom languages using drush?

I know I can install a new Drupal web site with single custom language using: $ drush si standard \ --db-url='mysql://[db_user]:[db_pass]@localhost/[db_name]' \ --account-name=admin --account-...
0
votes
0answers
33 views

How can I make composer-managed Drush 8 available to www-data?

I have an internal Drupal 7 app. The app uses php exec() to execute Drush 8.x commands after certain files are uploaded to the server via a custom form. In order for it to work we downloaded drush....
1
vote
0answers
69 views

Drush can't find commands inside vagrant VM

I have a new install of Drupal 9.1.8, with drush 10.5 installed through composer inside a Vagrant VM. But drush list gives: Available commands: help Displays help for a command list Lists ...
0
votes
1answer
102 views

Import configuration in CI/CD script does not work

I have a Drupal 8.9.13. I wanted to install a new module, for example the google_tag. But in my case I do that in my CI/CD process. So to do that I did the following actions: edit the composer.json ...
1
vote
2answers
89 views

Messing with several versions of drush

When I run drush --version I get next output: count(): Parameter must be an array or an object that implements [warning] Countable Table.php:789 Drush Version : 7.4.0 For getting rid of the ...
0
votes
0answers
154 views

Deadlock on Semaphore table results intermittent service denial of the site

Experience deadlock on Semaphore table frequently, which result in service denial of the site. Site configuration Drupal version : 8.8.6 Apache version: Apache/2.4.46 PHP 7.2.33 Drush version : 10.3....
0
votes
0answers
74 views

"drush updatedb" failes with "The provided host name is not valid for this server"

I run my site with Drupal 9.1.6 on Strato Webhosting. The site is well accessible via Webbroser either under mydomain.tld or www.mydomain.tld. I can perform a database update running update.php, but ...
0
votes
1answer
104 views

RuntimeException when running drush commands in root folder

I am setting up a local site for development on a ubuntu server 18.04 VM. I pull our repo into my windows machine and then mount this onto the VM as a shared folder. I run composer install and it ...
1
vote
1answer
100 views

"drush config-split:export" returns "Not enough arguments (missing: 'split')."

I recently upgraded from Drupal 8 to Drupal 9. I've used drush config-split:export (drush csex) quite often. After the upgrade, it keeps throwing an error which is very vague. Not enough arguments (...
0
votes
0answers
57 views

Drush Error: environment settings not found or configured for Drush command

I'm working on a legacy project and am trying to see if Drush can be set up properly. I installed the drush executable locally, I'm not sure if that is the issue. But when I go to run a basic command ...
1
vote
1answer
45 views

How do I create nodes with comments enabled using drush?

I have a drupal 9.1.5 site with a custom node type. I can create test content for it using drush by running; drush genc 1 --bundles=mynode --authors=test However, half of the content has comments ...
0
votes
0answers
27 views

It's not allowed to store backups inside the Drupal root directory

I must be missing something because I can't determine what I'm doing wrong. I've got a D7 site, and we're running Drush 8.1.10 I'm trying to run through some updates but I keep running into this error:...

1
2 3 4 5
40