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
0 votes
1 answer
19 views

install Drush on shared server

please i need to use drush on shared server i allready use composer foe install drush,, but if i use sudo command sudo mv drush.phar /usr/local/bin/drush , it is give me this massage -bash: sudo: ...
1 vote
0 answers
29 views

"migrate:status" freezes on "Try to validate bootstrap phase 0"

Drupal community! I am working on migrating from D7 to D9. Both are located on separate servers. I configured D7 database as db to migrate in my D9 settings.php, like this: $databases['migrate']['...
1 vote
3 answers
49 views

Alias listed but cannot be used

I am using Drupal 9.x now and using Drush 10.x. I have always used drush aliases to manage my D7 sites as it makes life so much easier with various environments etc. To test the newer YAML file (...
  • 111
1 vote
2 answers
50 views

Hook post update not found

I have a problem with the drush updb command which does not find the hook post updates of my custom module. I noticed that the module install saves the module's name string here in database, table &...
0 votes
2 answers
37 views

Why does Drush crash with "SQLSTATE[HY000] [2002] No such file or directory"?

I have an error when i try to update my db or install a module with drush. [info] Try to validate bootstrap phase 5 [0.11 sec, 10.08 MB] [info] Unable to connect to database with message: SQLSTATE[...
1 vote
0 answers
39 views

fclose only creates file at script end when running drush command [closed]

I'm really struggling with Drupal php memory/file/cache management. I've tried a lot of different ways to avoid memory errors (php 8.1) when writing a multi-megabyte file out. My observation is even ...
  • 21
3 votes
1 answer
68 views

How to get the current running Drush command?

I would like to detect from code the current running drush command. I have some hooks that will be run when I exec some drush commands and want to detect which command is triggering the hook. I manage ...
  • 43
2 votes
1 answer
172 views

How can I check with if my site is running?

Is there a way with Drush or something else to check if a specified Drupal site is still up and running, means fully normal functioning, after automated maintenance/updating in an external script? ...
  • 25
0 votes
0 answers
34 views

PHP Error: Drush\Application::setLogger(Psr\Log\LoggerInterface $logger) must be compatible in two given files | How to fix this error? [duplicate]

I was trying to setup a local environment of a website created on Acquia cloud platform. Everything was done properly including the database import. But now, when I execute drush commands, it gives me ...
1 vote
0 answers
26 views

Migrate Medias update : entity_lookup process error

I'm trying to update Medias already existing in my Drupal using Migrate and the process entity_lookup. The field field_uuid was designed specifically as a matcher for my .json original datas and the ...
-3 votes
1 answer
164 views

Best practice to upgrade drupal 9.4 to 9.5? Composer or Drush method? [closed]

I can run this command to upgrade drupal 9.4 to 9.5, but I can also do it in drush. Which method is better and why? composer require drupal/core-recommended:9.5.0 drupal/core-composer-scaffold:9.5.0 ...
0 votes
1 answer
99 views

Drush commands not defined - drush 11.4.0 drupal 9.5.1

This configuration is working properly on xampp local install (drush version) Drupal version : 9.5.1 DB driver : mysql DB hostname : localhost DB port : 3306 Database : ...
  • 29
0 votes
1 answer
39 views

Why fails the comparsion between two identical version numbers in this script?

I try to compare in a Script two different version numbers of Drupal via drush status. The result should be printed out in a if-else. I made a minimal example: # put paths in vars WEBSITE_ROOT_LIVE=/...
  • 25
0 votes
1 answer
266 views

Drush fatal error with Declaration of Drupal\Core\Logger\LoggerChannel::log [closed]

When I run any drush command or even just drush I get the fatal error: Fatal error: Declaration of Drupal\Core\Logger\LoggerChannel::log($level, $message, array $context = []) must be compatible with ...
0 votes
1 answer
88 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/...
0 votes
0 answers
132 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 ...
  • 41
0 votes
1 answer
38 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 ...
2 votes
1 answer
92 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
63 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 ...
  • 1
0 votes
4 answers
1k 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 ...
  • 568
-1 votes
1 answer
71 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
82 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....
  • 3,794
0 votes
0 answers
123 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
76 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 ...
  • 1
-3 votes
1 answer
75 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 ...
  • 1
5 votes
2 answers
240 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 ...
  • 2,476
0 votes
1 answer
261 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 ...
  • 21
2 votes
1 answer
112 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() ->...
  • 165k
0 votes
1 answer
337 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
139 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
354 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
332 views

How do I fix the Drush error "SQLSTATE[HY000] [2002] No such file or directory"?

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,058
1 vote
3 answers
401 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
227 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 ...
  • 1
-2 votes
1 answer
183 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 ...
  • 9
0 votes
0 answers
86 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
340 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
162 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 ...
  • 101
1 vote
1 answer
191 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
157 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-...
  • 429
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 ...
  • 429
0 votes
2 answers
105 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). ...
  • 6,921
2 votes
2 answers
105 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
256 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
236 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
238 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,221
1 vote
0 answers
140 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 ...
  • 91
0 votes
0 answers
287 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 ...
  • 429
1 vote
1 answer
350 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 &...
  • 429
-1 votes
1 answer
207 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 ...

1
2 3 4 5
41