Skip to content
This repository has been archived by the owner on Aug 19, 2023. It is now read-only.

Drush updatedb not working on Windows environment #70

Open
Igsu-Bravo opened this issue Mar 11, 2019 · 3 comments
Open

Drush updatedb not working on Windows environment #70

Igsu-Bravo opened this issue Mar 11, 2019 · 3 comments

Comments

@Igsu-Bravo
Copy link

Igsu-Bravo commented Mar 11, 2019

When I run drush updatedb -l site.com --debug the script stops in the middle and a pop-up message says "Windows can't open this type of file (.phar)"

Here is my console output:

λ drush updatedb -l site.com --debug
Drush Launcher Version: 0.6.0
ROOT: C:\inetpub\multisite
DRUSH VERSION: 9
DRUPAL ROOT: C:\inetpub\multisite/web
COMPOSER ROOT: C:\inetpub\multisite
VENDOR ROOT: [C:\inetpub\multisite/vendor]
 [preflight] Config paths: C:\inetpub\multisite\vendor\drush\drush/drush.yml,C:\inetpub\multisite\drush/drush.yml
 [preflight] Alias paths: C:\inetpub\multisite\web/drush/sites,C:/inetpub/multisite/drush/sites
 [preflight] Commandfile search paths: C:\inetpub\multisite\vendor\drush\drush\src,C:\inetpub\multisite/drush
 [bootstrap] Starting bootstrap to full [0.49 sec, 3.35 MB]
 [bootstrap] Drush bootstrap phase 5 [0.49 sec, 3.35 MB]
 [bootstrap] Try to validate bootstrap phase 5 [0.5 sec, 3.35 MB]
 [bootstrap] Try to validate bootstrap phase 5 [0.5 sec, 3.36 MB]
 [bootstrap] Try to bootstrap at phase 5 [0.5 sec, 3.42 MB]
 [bootstrap] Drush bootstrap phase: bootstrapDrupalRoot() [0.5 sec, 3.43 MB]
 [bootstrap] Change working directory to C:\inetpub\multisite/web [0.5 sec, 3.43 MB]
 [bootstrap] Initialized Drupal 8.6.10 root directory at C:\inetpub\multisite/web [0.51 sec, 3.43 MB]
 [bootstrap] Try to validate bootstrap phase 5 [0.51 sec, 3.43 MB]
 [bootstrap] Try to bootstrap at phase 5 [0.52 sec, 3.59 MB]
 [bootstrap] Drush bootstrap phase: bootstrapDrupalSite() [0.52 sec, 3.59 MB]
 [bootstrap] Initialized Drupal site site.com at sites/site.com [0.52 sec, 3.59 MB]
 [bootstrap] Try to validate bootstrap phase 5 [0.52 sec, 3.59 MB]
 [bootstrap] Try to bootstrap at phase 5 [0.53 sec, 3.59 MB]
 [bootstrap] Drush bootstrap phase: bootstrapDrupalConfiguration() [0.53 sec, 3.59 MB]
 [debug] Add service modifier [0.54 sec, 3.68 MB]
 [bootstrap] Try to validate bootstrap phase 5 [0.54 sec, 3.68 MB]
 [info] sql-query: SELECT 1; [0.55 sec, 3.69 MB]
 [info] Executing: mysql --defaults-file="C:\\Users\\juan.bravo\\AppData\\Local\\Temp\\dru1362.tmp" --database=db --host=localhost --port=3306 --silent -A < "C:\\Users\\juan.bravo\\AppData\\Local\\Temp\\dru1361.tmp" > nul [0.55 sec, 3.69 MB]
 [info] sql-query: SELECT 1 FROM key_value LIMIT 1; [0.8 sec, 3.69 MB]
 [info] Executing: mysql --defaults-file="C:\\Users\\juan.bravo\\AppData\\Local\\Temp\\dru146E.tmp" --database=db --host=localhost --port=3306 --silent -A < "C:\\Users\\juan.bravo\\AppData\\Local\\Temp\\dru146D.tmp" > nul [0.8 sec, 3.69 MB]
 [bootstrap] Try to bootstrap at phase 5 [1.05 sec, 3.69 MB]
 [bootstrap] Drush bootstrap phase: bootstrapDrupalDatabase() [1.05 sec, 3.69 MB]
 [bootstrap] Successfully connected to the Drupal database. [1.05 sec, 3.69 MB]
 [bootstrap] Try to validate bootstrap phase 5 [1.05 sec, 3.69 MB]
 [bootstrap] Try to bootstrap at phase 5 [1.05 sec, 3.69 MB]
 [bootstrap] Drush bootstrap phase: bootstrapDrupalFull() [1.05 sec, 3.69 MB]
 [debug] Start bootstrap of the Drupal Kernel. [1.05 sec, 3.69 MB]
 [warning] Invalid json in modules/contrib/contentimport/composer.json [1.47 sec, 5.18 MB]
 [debug] Found drush.services.yml for search_api Drush commands [1.49 sec, 5.19 MB]
 [debug] Found drush.services.yml for webform Drush commands [1.5 sec, 5.19 MB]
 [debug] Get container builder [1.51 sec, 5.19 MB]
 [debugnotify] Service modifier alter. [1.51 sec, 5.26 MB]
 [debug] process drush.console.services console.command [1.74 sec, 8.99 MB]
 [debug] process drush.command.services drush.command [1.74 sec, 8.99 MB]
 [debugnotify] Found tagged service config.commands [1.74 sec, 9 MB]
 [debugnotify] Found tagged service config.export.commands [1.74 sec, 9 MB]
 [debugnotify] Found tagged service config.import.commands [1.74 sec, 9 MB]
 [debugnotify] Found tagged service batch.commands [1.74 sec, 9 MB]
 [debugnotify] Found tagged service cli.commands [1.74 sec, 9 MB]
 [debugnotify] Found tagged service drupal.commands [1.74 sec, 9 MB]
 [debugnotify] Found tagged service entity.commands [1.75 sec, 9 MB]
 [debugnotify] Found tagged service image.commands [1.75 sec, 9 MB]
 [debugnotify] Found tagged service language.commands [1.75 sec, 9.01 MB]
 [debugnotify] Found tagged service locale.commands [1.75 sec, 9.01 MB]
 [debugnotify] Found tagged service messenger.commands [1.75 sec, 9.01 MB]
 [debugnotify] Found tagged service queue.commands [1.75 sec, 9.01 MB]
 [debugnotify] Found tagged service role.commands [1.75 sec, 9.01 MB]
 [debugnotify] Found tagged service state.commands [1.75 sec, 9.01 MB]
 [debugnotify] Found tagged service twig.commands [1.76 sec, 9.01 MB]
 [debugnotify] Found tagged service user.commands [1.76 sec, 9.02 MB]
 [debugnotify] Found tagged service views.commands [1.76 sec, 9.02 MB]
 [debugnotify] Found tagged service watchdog.commands [1.76 sec, 9.02 MB]
 [debugnotify] Found tagged service pm.commands [1.76 sec, 9.02 MB]
 [debugnotify] Found tagged service theme.commands [1.76 sec, 9.02 MB]
 [debugnotify] Found tagged service sanitize.commands [1.76 sec, 9.02 MB]
 [debugnotify] Found tagged service sanitize.comments.commands [1.76 sec, 9.02 MB]
 [debugnotify] Found tagged service sanitize.sessions.commands [1.76 sec, 9.02 MB]
 [debugnotify] Found tagged service sanitize.userfields.commands [1.77 sec, 9.03 MB]
 [debugnotify] Found tagged service sanitize.usertable.commands [1.77 sec, 9.03 MB]
 [debugnotify] Found tagged service search_api.commands [1.77 sec, 9.03 MB]
 [debugnotify] Found tagged service webform.commands [1.77 sec, 9.03 MB]
 [debug] process drush.command_info_alterer.services drush.command_info_alterer [1.77 sec, 9.03 MB]
 [debug] process drush.generator.services drush.generator [1.78 sec, 9.03 MB]
 [debug] Finished bootstrap of the Drupal Kernel. [2.81 sec, 16.05 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\config\ConfigCommands [2.95 sec, 17.87 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\config\ConfigExportCommands [2.97 sec, 17.91 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\config\ConfigImportCommands [2.98 sec, 17.91 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\BatchCommands [2.99 sec, 17.92 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\CliCommands [3 sec, 17.92 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\DrupalCommands [3.01 sec, 17.93 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\EntityCommands [3.02 sec, 17.94 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\ImageCommands [3.04 sec, 17.94 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\LanguageCommands [3.05 sec, 17.96 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\LocaleCommands [3.08 sec, 17.96 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\MessengerCommands [3.09 sec, 17.98 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\QueueCommands [3.11 sec, 17.98 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\RoleCommands [3.14 sec, 17.99 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\StateCommands [3.16 sec, 18.01 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\TwigCommands [3.21 sec, 18.03 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\UserCommands [3.22 sec, 18.04 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\ViewsCommands [3.23 sec, 18.08 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\core\WatchdogCommands [3.27 sec, 18.11 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\pm\PmCommands [3.29 sec, 18.14 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\pm\ThemeCommands [3.32 sec, 18.15 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeCommands [3.35 sec, 18.15 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeCommentsCommands [3.37 sec, 18.16 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeSessionsCommands [3.39 sec, 18.16 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeUserFieldsCommands [3.41 sec, 18.16 MB]
 [debugnotify] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeUserTableCommands [3.43 sec, 18.17 MB]
 [debugnotify] Add a commandfile class: Drupal\search_api\Commands\SearchApiCommands [3.44 sec, 18.17 MB]
 [debugnotify] Add a commandfile class: Drupal\webform\Commands\WebformCommands [3.46 sec, 18.25 MB]
 [command] Backend invoke: C:/inetpub/multisite/vendor/bin/drush.phar  --backend=2 --verbose --debug --root=C:/inetpub/multisite/web --uri=site.com  updatedb:status   --entity-updates= --post-updates 2>&1 [3.76 sec, 19.92 MB]
 [info] C:/inetpub/multisite/vendor/bin/drush.phar  --backend=2 --verbose --debug --root=C:/inetpub/multisite/web --uri=site.com  updatedb:status   --entity-updates= --post-updates 2>&1 [3.76 sec, 19.93 MB]

My environment:

  • Windows Server 2016
  • Drupal 8.6.10 multisite
  • Project based on Drupal Composer package
  • Drush 5.5.2

drush.phar is located at vendor\bin together with drush.bat (which contains the extact two lines described here

I am able to run other commands such as drush cache-rebuild -l site.com drush status -l site.com

I have checked these following issues:
Fix for Windows user
drush launcher on Windows
launcher placement for windows users

@dwaynew
Copy link

dwaynew commented Apr 5, 2019

I have the same issue with updatedb:

  • Windows 10
  • Drupal 8.5.6
  • Drush 9.3.0
  • Drush launcher 0.6.0

@dwaynew
Copy link

dwaynew commented Apr 5, 2019

@IgsuMustonen in case you didn't already have a fix, this worked for me:

  • Renaming drush.phar file to drush
  • Editing drush.bat and changing drush.phar to drush

So in my directory I then just had drush.bat and drush. And had this path added in PATH.

Then just drush -y updatedb

@chikeh
Copy link

chikeh commented Nov 22, 2020

@dwaynew using,

  • Windows 10
  • Drupal 8.9.9
  • Drush 10.2.2
  • Drush Launcher 0.7.4

this fix didn't work for me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants