Encountering issues with the MongoDB module installation on Drupal 11.

Created on 5 February 2025, 2 months ago
Updated 10 February 2025, about 2 months ago

Issue Summary:
Fatal Error: A Fatal error occurs in the mongodb module, specifically in the StringDatabaseStorage.php file. The error message indicates that the method joinCondition() is being called on an object of class Drupal\pgsql\Driver\Database\pgsql\Select, but this method is not defined for the pgsql database driver.

Error Details:

Error Type: Uncaught Error: Call to undefined method Drupal\pgsql\Driver\Database\pgsql\Select::joinCondition()
File: /web/modules/contrib/mongodb/src/modules/locale/StringDatabaseStorage.php
Line: 209
Stack Trace: The error is triggered when attempting to execute a database query related to locale translation and string storage, specifically during cache lookup and menu link management.
Steps to Reproduce:
Install or enable the mongodb module.
Run a drush cr (cache rebuild) or visit the site.
Encounter the fatal error.
Expected Behavior:
The method joinCondition() should be defined or an alternative approach should be used for the pgsql driver.
The site should function without fatal errors, particularly in areas related to locale and menu link management.
Possible Cause:
It appears the mongodb module is attempting to execute a query that is intended for another database driver (likely MySQL or MariaDB) but is being executed on a PostgreSQL (pgsql) database. This mismatch results in the call to the undefined method joinCondition(), which is not available in the PostgreSQL database API.

Full Error log

PHP Fatal error: Uncaught Error: Call to undefined method Drupal\pgsql\Driver\Database\pgsql\Select::joinCondition() in /var/www/php8/drupall11/web/modules/contrib/mongodb/src/modules/locale/StringDatabaseStorage.php:209
Stack trace:
#0 /var/www/php8/drupall11/web/modules/contrib/mongodb/src/modules/locale/StringDatabaseStorage.php(48): Drupal\mongodb\modules\locale\StringDatabaseStorage->dbStringSelect()
#1 /var/www/php8/drupall11/web/core/modules/locale/src/LocaleLookup.php(141): Drupal\mongodb\modules\locale\StringDatabaseStorage->findTranslation()
#2 /var/www/php8/drupall11/web/core/lib/Drupal/Core/Cache/CacheCollector.php(148): Drupal\locale\LocaleLookup->resolveCacheMiss()
#3 /var/www/php8/drupall11/web/core/modules/locale/src/LocaleTranslation.php(121): Drupal\Core\Cache\CacheCollector->get()
#4 /var/www/php8/drupall11/web/core/lib/Drupal/Core/StringTranslation/TranslationManager.php(92): Drupal\locale\LocaleTranslation->getStringTranslation()
#5 /var/www/php8/drupall11/web/core/lib/Drupal/Core/StringTranslation/TranslationManager.php(140): Drupal\Core\StringTranslation\TranslationManager->getStringTranslation()
#6 /var/www/php8/drupall11/web/core/lib/Drupal/Core/StringTranslation/TranslationManager.php(112): Drupal\Core\StringTranslation\TranslationManager->doTranslate()
#7 /var/www/php8/drupall11/web/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php(190): Drupal\Core\StringTranslation\TranslationManager->translateString()
#8 /var/www/php8/drupall11/web/core/lib/Drupal/Component/Utility/ToStringTrait.php(15): Drupal\Core\StringTranslation\TranslatableMarkup->render()
#9 /var/www/php8/drupall11/web/core/lib/Drupal/Core/Entity/EntityType.php(718): Drupal\Core\StringTranslation\TranslatableMarkup->__toString()
#10 /var/www/php8/drupall11/web/core/lib/Drupal/Core/Entity/ContentEntityBase.php(1408): Drupal\Core\Entity\EntityType->getBundleLabel()
#11 /var/www/php8/drupall11/web/core/lib/Drupal/Core/Entity/EditorialContentEntityBase.php(20): Drupal\Core\Entity\ContentEntityBase::baseFieldDefinitions()
#12 /var/www/php8/drupall11/web/core/modules/menu_link_content/src/Entity/MenuLinkContent.php(277): Drupal\Core\Entity\EditorialContentEntityBase::baseFieldDefinitions()
#13 /var/www/php8/drupall11/web/core/lib/Drupal/Core/Entity/EntityFieldManager.php(230): Drupal\menu_link_content\Entity\MenuLinkContent::baseFieldDefinitions()
#14 /var/www/php8/drupall11/web/core/lib/Drupal/Core/Entity/EntityFieldManager.php(195): Drupal\Core\Entity\EntityFieldManager->buildBaseFieldDefinitions()
#15 /var/www/php8/drupall11/web/core/lib/Drupal/Core/Entity/EntityFieldManager.php(454): Drupal\Core\Entity\EntityFieldManager->getBaseFieldDefinitions()
#16 /var/www/php8/drupall11/web/modules/contrib/mongodb/src/EntityQuery/Condition.php(83): Drupal\Core\Entity\EntityFieldManager->getFieldStorageDefinitions()
#17 /var/www/php8/drupall11/web/modules/contrib/mongodb/src/EntityQuery/Condition.php(51): Drupal\mongodb\EntityQuery\Condition->addConditions()
#18 /var/www/php8/drupall11/web/modules/contrib/mongodb/src/EntityQuery/Query.php(143): Drupal\mongodb\EntityQuery\Condition->compile()
#19 /var/www/php8/drupall11/web/core/lib/Drupal/Core/Entity/Query/Sql/Query.php(82): Drupal\mongodb\EntityQuery\Query->compile()
#20 /var/www/php8/drupall11/web/core/modules/menu_link_content/src/Plugin/Deriver/MenuLinkContentDeriver.php(64): Drupal\Core\Entity\Query\Sql\Query->execute()
#21 /var/www/php8/drupall11/web/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(101): Drupal\menu_link_content\Plugin\Deriver\MenuLinkContentDeriver->getDerivativeDefinitions()
#22 /var/www/php8/drupall11/web/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(87): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives()
#23 /var/www/php8/drupall11/web/core/lib/Drupal/Core/Menu/MenuLinkManager.php(125): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions()
#24 /var/www/php8/drupall11/web/core/lib/Drupal/Core/Menu/MenuLinkManager.php(150): Drupal\Core\Menu\MenuLinkManager->getDefinitions()
#25 /var/www/php8/drupall11/web/core/lib/Drupal/Core/EventSubscriber/MenuRouterRebuildSubscriber.php(62): Drupal\Core\Menu\MenuLinkManager->rebuild()
#26 /var/www/php8/drupall11/web/core/lib/Drupal/Core/EventSubscriber/MenuRouterRebuildSubscriber.php(50): Drupal\Core\EventSubscriber\MenuRouterRebuildSubscriber->menuLinksRebuild()
#27 /var/www/php8/drupall11/vendor/symfony/event-dispatcher/EventDispatcher.php(246): Drupal\Core\EventSubscriber\MenuRouterRebuildSubscriber->onRouterRebuild()
#28 /var/www/php8/drupall11/vendor/symfony/event-dispatcher/EventDispatcher.php(206): Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher\{closure}()
#29 /var/www/php8/drupall11/vendor/symfony/event-dispatcher/EventDispatcher.php(56): Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
#30 /var/www/php8/drupall11/web/core/lib/Drupal/Core/Routing/RouteBuilder.php(197): Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
#31 /var/www/php8/drupall11/web/core/lib/Drupal/Core/ProxyClass/Routing/RouteBuilder.php(83): Drupal\Core\Routing\RouteBuilder->rebuild()
#32 /var/www/php8/drupall11/web/core/includes/common.inc(454): Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild()
#33 /var/www/php8/drupall11/web/core/includes/utility.inc(41): drupal_flush_all_caches()
#34 /var/www/php8/drupall11/vendor/drush/drush/src/Commands/core/CacheRebuildCommands.php(60): drupal_rebuild()
#35 [internal function]: Drush\Commands\core\CacheRebuildCommands->rebuild()
#36 /var/www/php8/drupall11/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array()
#37 /var/www/php8/drupall11/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
#38 /var/www/php8/drupall11/vendor/consolidation/annotated-command/src/CommandProcessor.php(175): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
#39 /var/www/php8/drupall11/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(387): Consolidation\AnnotatedCommand\CommandProcessor->process()
#40 /var/www/php8/drupall11/vendor/symfony/console/Command/Command.php(279): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
#41 /var/www/php8/drupall11/vendor/symfony/console/Application.php(1094): Symfony\Component\Console\Command\Command->run()
#42 /var/www/php8/drupall11/vendor/symfony/console/Application.php(342): Symfony\Component\Console\Application->doRunCommand()
#43 /var/www/php8/drupall11/vendor/symfony/console/Application.php(193): Symfony\Component\Console\Application->doRun()
#44 /var/www/php8/drupall11/vendor/drush/drush/src/Runtime/Runtime.php(110): Symfony\Component\Console\Application->run()
#45 /var/www/php8/drupall11/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun()
#46 /var/www/php8/drupall11/vendor/drush/drush/drush.php(140): Drush\Runtime\Runtime->run()
#47 /var/www/php8/drupall11/vendor/bin/drush.php(119): include('...')
#48 {main}
thrown in /var/www/php8/drupall11/web/modules/contrib/mongodb/src/modules/locale/StringDatabaseStorage.php on line 209
[warning] Drush command terminated abnormally.

Note* site will down after that
💬 Support request
Status

Active

Version

3.1

Component

Base module (driver)

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇳🇱Netherlands daffie

    @faheemakhtar, Could you tell me which version of Drupal you are using? The module currently only supports Drupal 11.1. My second question is: did you follow the instructions in the readme file? Did you apply the Drupal core patch? Without it it does not work.

    BTW Thank you for trying out this module. The easiest way to reach me is on Drupal Slack.

Production build 0.71.5 2024