backdrop-contrib / backdrop-drush-extension

A set of commands and boot class for Drush and Backdrop CMS.
GNU General Public License v2.0
13 stars 18 forks source link

error "number of bound variables does not match number of tokens" on bcim in a global install #257

Open robertgarrigos opened 1 year ago

robertgarrigos commented 1 year ago

I had this error when trying bcim in a global installation of drush:

PDOException: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens: SELECT name FROM {system} WHERE type='module' AND status=1; Array
(
    [:type] => module
    [:status] => 1
)
 a drush_db_select() (línia 131 de phar:///usr/local/bin/drush/includes/dbtng.inc).
Drush command terminated abnormally due to an unrecoverable error.                                                  [error]
Error: Return type of HumbugBox3140\KevinGH\RequirementChecker\RequirementCollection::count() should either be
compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily
suppress the notice in phar:///usr/local/bin/drush/.box/src/RequirementCollection.php, line 19

I have to say that I'm doing bcim on the lando dev site with NO problem. This is related to the same production site, with a globl drush and NO lando.

laryn commented 1 year ago

@robertgarrigos Please test https://github.com/backdrop-contrib/backdrop-drush-extension/pull/251

robertgarrigos commented 1 year ago

Thanks, @laryn, but this didn't fix the problem. In fact, I just realized that I have an error by running just drush without any parameter, either with my last version of the extension or with this fix applied:

PDOException: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens  [error]
in /core/includes/database/database.inc:2285
Stack trace:
#0 /home/robert/www/core/includes/database/database.inc(2285): PDOStatement->execute()
#1 /home/robert/www/core/includes/database/database.inc(717): DatabaseStatementBase->execute()
#2 /home/robert/www/core/includes/database/database.inc(2468): DatabaseConnection->query()
#3 phar:///usr/local/bin/drush/includes/dbtng.inc(131): db_query()
#4 /home/robert/.drush/commands/backdrop-bug/BackdropBoot.php(618): drush_db_select()
#5 /home/robert/.drush/commands/backdrop-bug/BackdropBoot.php(594): Drush\Boot\BackdropBoot->module_list()
#6 phar:///usr/local/bin/drush/includes/command.inc(1594): Drush\Boot\BackdropBoot->commandfile_searchpaths()
#7 phar:///usr/local/bin/drush/includes/bootstrap.inc(358): _drush_find_commandfiles()
#8 phar:///usr/local/bin/drush/includes/bootstrap.inc(509): drush_bootstrap()
#9 phar:///usr/local/bin/drush/commands/core/help.drush.inc(103): drush_bootstrap_max()
#10 phar:///usr/local/bin/drush/includes/command.inc(422): drush_core_help()
#11 phar:///usr/local/bin/drush/includes/command.inc(231): _drush_invoke_hooks()
#12 phar:///usr/local/bin/drush/includes/command.inc(199): drush_command()
#13 phar:///usr/local/bin/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch()
#14 phar:///usr/local/bin/drush/includes/preflight.inc(67): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#15 phar:///usr/local/bin/drush/includes/startup.inc(465): drush_main()
#16 phar:///usr/local/bin/drush/includes/startup.inc(369): drush_run_main()
#17 phar:///usr/local/bin/drush/drush(114): drush_startup()
#18 /usr/local/bin/drush(14): require('...')
#19 {main}

However, I'm having this only when I run the command within the backdrop site. Outside it I get a list of commands, this is, the normal answer.

laryn commented 1 year ago

I'll be honest, I've started switching to use bee where possible. I've seen this error too on PHP 8.x with Backdrop and Drush but I have not solved it completely.

dstorozhuk commented 4 months ago

Is 2024 now, and this "key" issue, which prevents site from installing does not fixed yet. If this project is dead - why not deprecate the repository? ddev, lando still installing that extensions by default, and it is not working! I spend 4 hours trying to figure out why "official" instructions/plugins does not work.

robertgarrigos commented 2 months ago

I'm not using drush anymore...