Questions tagged [drush]
Use it for questions about the command line shell and Unix scripting interface for Drupal (a.k.a. Drush).
2,001
questions
0
votes
1
answer
53
views
Database update doesn't work after update from 9.2 to 9.3
I have unfortunately not found anything that seems to solve my issue. My Google-fu may be defunct.
I have upgraded a Drupal site from 9.2 to 9.3. This works as expected with composer (I use drupal/...
1
vote
0
answers
41
views
Custom commands aren't recognized [closed]
I have a custom module that has all the defined drush commands. For some reason it works on other machine where he installed drush via another method. I've installed drush via composer.
Do you need to ...
0
votes
0
answers
35
views
How to change TIMEOUT for Drush command
I am working on a website with an extremely heavy database.
As a result, the command drush sql-cli < [db_filename] takes more than default value of 14400 seconds.
I need to find a way how to change ...
0
votes
1
answer
34
views
How to run drush using locally modified repo (from github fork)
I have my own drush repo forked from https://github.com/drush-ops/drush and have a local clone of this, as I want to start modifying and potentially push back to add a new function. How do I configure ...
1
vote
1
answer
44
views
Testing Drush Commands
How to test custom implemented Drush Commands ? Are there any Open Source Examples for Drush Commands with Unit Tests or something like that ?
0
votes
1
answer
51
views
Without site aliases, "drush sql:sync" fails
I run into an issue that the use of an alias returns correct values, but without alias or from remote, I miss the DB connection. Furthermore, the root directory is wrong.
The missing DB connection ...
0
votes
2
answers
470
views
I've just installed drush and am getting this error. What to do?
So I've just installed drush 11.2.0 with Drupal 9.4.6 and the first time I executed drush si, I got PHP Fatal error: Declaration of Drush\Application::setLogger(Psr\Log\LoggerInterface $logger) must ...
-1
votes
1
answer
32
views
How to install a theme with the command line?
I am trying to install the theme Adaptivetheme.
I have tried this
composer require drupal/adaptivetheme
and then:
vendor/bin/drush theme:enable adaptivetheme
But I got:
Unknown themes: ...
0
votes
1
answer
48
views
How to use Drush remote site aliases with web service or other account?
Developers are not allowed to have direct access to the Production Drupal servers, which are Linux. But, I need for developers to be able to run a limited set of Drush commands via remote site aliases....
0
votes
0
answers
79
views
Import config on Drush install with config in non-standard directory
I've got a site set up with its config sync in a directory outside of web root; specifically ../config/sync (relative to the Drupal root). I have that path set for $settings['config_sync_directory'] ...
-2
votes
1
answer
57
views
drush puts my website in a subdirectory named 'web' [closed]
I use shared web hosting with Cpanel, LAMP and Composer.
I have installed Drupal with Drush on a registered web domain (example.com).
My website is accessible via example.com/web/ but I would expect ...
-3
votes
1
answer
69
views
Access denied in Drush but granted in GUI [closed]
I am trying to install Drupal on a CentOS based shared server environment (namecheap.com) with mysql, ssh and Composer.
I have created a database username and a database with the same name and a ...
4
votes
2
answers
155
views
How can I run the inbuilt Drush 10.x commands as user #1?
I have a Drupal Queue worker class that fetches the Entity objects from Drupal to index to Elasticsearch.
The following command is causing the lesser documents to show up in Elasticsearch since by ...
0
votes
1
answer
123
views
Update the text format and process the body field of existing nodes programmatically
I am trying to resave a number of nodes to apply the text format changes to the body field. I’ve written a drush command to do this. The command does update the text format, but the text in the body ...
2
votes
1
answer
101
views
Why would loading nodes by UUID not work in a drush command?
I have a simple bit of test code to load nodes by UUID:
$uuids = ['5e331255-adf6-423e-a355-dc02c621ffcd'];
$nids = \Drupal::entityTypeManager()->getStorage('node')
->getQuery()
->...
0
votes
1
answer
225
views
Core Update 9.4.1->9.4.2 breaks drush command updatedb (throws PHP Fatal error: Cannot declare class Drupal\mysql\…)
I need help at this mysterious issue:
Core upgrade 9.4.1 -> 9.4.2 breaks drush command updatedb at some installations:
Fatal error: Cannot declare class Drupal\mysql\Driver\Database\mysql\Install\...
0
votes
0
answers
103
views
"You do not have access to the referenced entity"
I've imported some content from the development site to the live site using drush csi. All went fine, except it didn't import users.
On user accounts, I've a thumbnail/portrait field with a default ...
-3
votes
1
answer
175
views
How to add local Drush with Composer to a XAMPP Drupal on Windows? [closed]
I have installed Drupal 9 on XAMPP in Windows 11.
How could I add local Drush with Composer to a XAMPP Drupal on Windows?
0
votes
1
answer
258
views
Drush not working after upgrade to PHP 8
I just updated my macos' php version using homebrew. This worked, the php version I'm currently running is 8.0.2
But doing this my Drush stopped working. When running drush cr I get the following ...
1
vote
3
answers
278
views
How do I install on Windows 11?
I wish to install Drupal 9 on Windows 11 using Drush.
Drupal on the cloud solutions (which should be easily accessible from Windows) cost money and not quite what I seek for a local install.
I can ...
-1
votes
1
answer
181
views
"Uncaught Error: Class 'Consolidation\Log\LogLevel' not found in /app/vendor/consolidation/log/src/ConsoleLogLevel.php:21"
I am using lando for the first time and having difficulties. I cloned a git repo and ran the "lando start" and "lando composer install"commands. After that, when I am trying to run ...
-2
votes
1
answer
111
views
How can I use "drush updb" to pass a value to the hook_update_N() implementation done from a module?
I am trying to drush updb with an argument that is passed to the hook_update_N() implementation done from a module I wrote, which would use it to execute some update tasks.
function ...
0
votes
0
answers
65
views
How to version control with Git whilst using composer?
So I've been going through the steep learning curve from D7 to D9.
I like to use git for deployment and version control. I'm new to composer as I only know Drupal and it was never used.
I've developed ...
0
votes
1
answer
224
views
Run into issues with Drush after updating from 8.9.20 to 9.3.13
I upgraded from 8.9.20 to 9.3.13 and i did an update.php after this. I do get an error:
MISSING UPDATES FOR: VIEWS
The installed version of the Views module is too old to update. Update to a version ...
0
votes
0
answers
129
views
drush cr behavior
Is it normal for the site to become unreachable while running drush cr or this is something need to be fixed?
I have a site running drupal 9 that is becoming unavailable while running drush cr and the ...
1
vote
1
answer
127
views
Migrate CSV to content type with paragraphs
I'm trying to import a CSV File into Content Types and Paragraphs, using Migrate module (and mainly this tutorial : https://mtech-llc.com/blog/charlotte-leon/migration-csv-data-paragraphs).
For this I ...
0
votes
1
answer
100
views
drush not finding correct multisite settings.php
I have a Drupal 9 site using multisite to support both local and production hosts. I have defined them in sites/sites.php:
$sites['www.electronovelty.com'] = 'www.electronovelty.com';
$sites['www.en9-...
0
votes
0
answers
34
views
Change the PHP binary that should be used from Drush [duplicate]
I'm on an Ubuntu shared server hosted at pair.com. Their default PHP version is 7.4, but I was able to change it to PHP 8 for Drupal in my .htaccess; Drupal 9 works fine. My composer specifies PHP 8 ...
0
votes
2
answers
88
views
How exactly does drush determine PROJECTROOT and WEBROOT for a project?
In the Drush Configuration section of the official documentation it is said:
drush.yml files are discovered as below, in order of precedence:
Drupal site folder (e.g. sites/{example.com}/drush.yml).
...
2
votes
2
answers
63
views
Can Drush display translated messages to users?
I'm working on a module which extended DrushCommands to create custom Drush commands. The maintainer wants those custom commands to display translatable custom messages (warnings, erros) upon usage.
(...
1
vote
2
answers
188
views
Batch API drush command running once then shows Solr error
I am trying to create a drush command to run a batch process. When I run the command, the batch runs just once, and I get this error :
in
Drupal\search_api_solr\SolrConnector\SolrConnectorPluginBase-&...
2
votes
1
answer
174
views
how to extend existing drush command class
Can anyone please let me know how to extend existing drush command class.
I am writing a custom module which provides custom content entity and created a devel generate plugin similar to ...
1
vote
0
answers
166
views
Uninstalled module prevent upgrade
I have been asked to upgrade a site from Drupal 8 to Drupal 9.
Previously, there was a very problematic module called 'support_ticket' that caused many issues and would not properly uninstall. After a ...
1
vote
0
answers
112
views
Drush can't write to /tmp
Drush does not seem to be able to move files to the tmp folder on my local machine. Changing the tmp folder location to for instance "sites/default/files" works, but I would like to know why ...
0
votes
0
answers
185
views
How to specify setting.php file for drush?
I'm using Drupal 9 and Drush 11. I have two hosts, one for local testing (www.en9-local.pglatz.com) and a remote production server (www.electronovelty.com).
When I run drush status from either of ...
1
vote
1
answer
241
views
Drush site aliases not working as expected
Using drush 11 and Drupal 9 to test a local site on my Mac (using MAMP), I'm having difficulty getting site aliases to work. I used Drush Launcher to make my drush executable globally. I also created &...
-1
votes
1
answer
151
views
Drush using wrong PHP binary/config
Using D9 with Drush 10. MacOS/MAMP Pro.
Drush 10 is installed locally using composer and is starting fine and finding the database. sqlc works fine.
(I have other Drupal sites that are working just ...
0
votes
1
answer
49
views
What does "Entity API >= 8.x-1.0-alpha3 module is now a dependency and needs to be installed before running updates" during drush updatedb mean?
I am doing a Drupal 8.6.18 to 8.9.19 update via composer.
After upgrading the packages via composer, I updated the database, which shows a warning:
$ vendor/bin/drush updatedb
<a href="https://...
0
votes
1
answer
99
views
CSS, JS, ... not created by drush site:install
Drupal installation is failing after the following steps on a Debian box (database is already created and privileges granted to specific user):
(user) $ composer create-project drupal/recommended-...
0
votes
1
answer
109
views
how to install drush 10 concurrently with 8?
I'm having some questions about installing the latest drush, and the more I search, the more conflicting advice am I getting. I need both drush 8 and 10, since I am testing both Drupal 7 and 9. I had ...
1
vote
0
answers
98
views
Why might a batch initiated in hook_install() sometimes not process?
I have two modules, module_alpha and module_beta.
Both modules install a database table with hook_schema() which they use to track information about published nodes. Data is logged in the table with ...
0
votes
1
answer
186
views
Drush 11 incompatible with drupal/recommended-project? [closed]
https://www.drush.org/latest/install/ indicates that Drush 10 is no longer supported. Drush 11 seems to be incompatible with drupal/recommended-project:9.* due to its dependency (via drupal/core-...
0
votes
0
answers
32
views
Untangle Composer Drush and non-Composer Drush
I have Drush 10.3.2-dev working on my system but I also need to work on an old project in Drupal 7, so I need Drush 7 to work on that particular project.
I downloaded Drush 7, unpacked it in a folder, ...
2
votes
0
answers
76
views
Drush 10 pass alias to remote
Our remote environments are currently fronted by a Linux instance acting as the gatekeeper between the developers and the actual environments (apache and mysql instances running Drupal). This was done ...
-2
votes
2
answers
187
views
Is there any `drush` command to delete any (previously exported) setting files? [closed]
Can we use drush to simply delete any (previously exported) config-directory files?
-3
votes
1
answer
456
views
How does `drush cim` find and handle the config-directory? [closed]
I would like to know where the config directory is, and how drush cim command exactly handles it, to be more specific:
Where are the setting files imported from, can you provide me with a path ...
2
votes
1
answer
192
views
Cannot resave nodes with entity->save(), no particular error
I'm trying to write a drush command to resave all the nodes on my site.
I searched for a module and found the Resave All Nodes module, but its drush command isn't ready yet. So I decided to try to ...
0
votes
1
answer
140
views
How to stop cron process without rebooting my server?
I have tried the following:
drush php-eval "\Drupal::lock()->release('cron');"
This had no effect. I'm still seeing "Attempting to re-run cron" errors pile up in the log.
I ...
3
votes
2
answers
534
views
How to re-index all content for the core search engine?
Is there a way to re-index all content for the core search engine?
In older versions, you could reindex with drush:
drush search-reindex --immediate --verbose
However, this does not appear to be an ...
0
votes
0
answers
35
views
Mismatch in php version status vs php -v [duplicate]
I have multiple versions (7.2 and 7.4) on my ubuntu box and recently set the server to use 7.4 so that I could upgrade Drupal from 8.9 to 9.x.
Drupal reports/status shows my php version as 7.2, where ...