I can't enable Domain Configuration submodule.
Here's the log.
What am I missing ?
TypeError: Argument 1 passed to Drupal\Core\Routing\CurrentRouteMatch::getRouteMatch() must be an instance of Symfony\Component\HttpFoundation\Request, null given, called in /home/user/public_html/drupal89dev/docroot/core/lib/Drupal/Core/Routing/CurrentRouteMatch.php on line 87 in Drupal\Core\Routing\CurrentRouteMatch->getRouteMatch() (line 99 of /home/user/public_html/drupal89dev/docroot/core/lib/Drupal/Core/Routing/CurrentRouteMatch.php)
#0 /home/user/public_html/drupal89dev/docroot/core/lib/Drupal/Core/Routing/CurrentRouteMatch.php(87): Drupal\Core\Routing\CurrentRouteMatch->getRouteMatch(NULL)
#1 /home/user/public_html/drupal89dev/docroot/core/lib/Drupal/Core/Routing/CurrentRouteMatch.php(49): Drupal\Core\Routing\CurrentRouteMatch->getCurrentRouteMatch()
#2 /home/user/public_html/drupal89dev/docroot/modules/contrib/conflict/conflict.module(67): Drupal\Core\Routing\CurrentRouteMatch->getRouteObject()
#3 /home/user/public_html/drupal89dev/docroot/core/lib/Drupal/Core/Entity/EntityStorageBase.php(366): conflict_entity_load(Array, 'domain')
#4 /home/user/public_html/drupal89dev/docroot/core/lib/Drupal/Core/Entity/EntityStorageBase.php(307): Drupal\Core\Entity\EntityStorageBase->postLoad(Array)
#5 /home/user/public_html/drupal89dev/docroot/core/lib/Drupal/Core/Entity/EntityStorageBase.php(578): Drupal\Core\Entity\EntityStorageBase->loadMultiple(Array)
#6 /home/user/public_html/drupal89dev/docroot/modules/contrib/domain/domain/src/DomainStorage.php(107): Drupal\Core\Entity\EntityStorageBase->loadByProperties(Array)
#7 /home/user/public_html/drupal89dev/docroot/modules/contrib/domain/domain/src/DomainNegotiator.php(100): Drupal\domain\DomainStorage->loadByHostname('drupal89...')
#8 /home/user/public_html/drupal89dev/docroot/modules/contrib/domain/domain/src/DomainNegotiator.php(144): Drupal\domain\DomainNegotiator->setRequestDomain('drupal89...')
#9 /home/user/public_html/drupal89dev/docroot/modules/contrib/domain/domain/src/DomainNegotiator.php(153): Drupal\domain\DomainNegotiator->negotiateActiveDomain()
#10 /home/user/public_html/drupal89dev/docroot/modules/contrib/domain/domain_config/src/DomainConfigOverrider.php(213): Drupal\domain\DomainNegotiator->getActiveDomain(true)
#11 /home/user/public_html/drupal89dev/docroot/modules/contrib/domain/domain_config/src/DomainConfigOverrider.php(97): Drupal\domain_config\DomainConfigOverrider->initiateContext()
#12 /home/user/public_html/drupal89dev/docroot/core/lib/Drupal/Core/Config/ConfigFactory.php(209): Drupal\domain_config\DomainConfigOverrider->loadOverrides(Array)
#13 /home/user/public_html/drupal89dev/docroot/core/lib/Drupal/Core/Config/ConfigFactory.php(169): Drupal\Core\Config\ConfigFactory->loadOverrides(Array)
#14 /home/user/public_html/drupal89dev/docroot/core/lib/Drupal/Core/Config/ConfigFactory.php(104): Drupal\Core\Config\ConfigFactory->doLoadMultiple(Array, true)
#15 /home/user/public_html/drupal89dev/docroot/core/lib/Drupal/Core/Config/ConfigFactory.php(89): Drupal\Core\Config\ConfigFactory->doGet('shield.settings')
#16 /home/user/public_html/drupal89dev/docroot/modules/contrib/shield/src/ShieldMiddleware.php(48): Drupal\Core\Config\ConfigFactory->get('shield.settings')
#17 /home/user/public_html/drupal89dev/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\shield\ShieldMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 /home/user/public_html/drupal89dev/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#19 /home/user/public_html/drupal89dev/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 /home/user/public_html/drupal89dev/docroot/core/lib/Drupal/Core/DrupalKernel.php(708): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#21 /home/user/public_html/drupal89dev/docroot/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#22 {main}
Comments
Comment #2
agentrickardThat error is something from the Conflict module interfering with how domains are loaded.
As I understand it, Conflict only works on content entities, so there are two issues here:
1) Domains are config entities and should not be loaded here, since the Conflict module doesn't work for config entities.
2) Conflict module seems to expect that entities are only loaded from within a route context (e.g. node/X/edit). That assumption is simply not true for config entities.
But the code seems to account for that. This may be a case where the Route system isn't loaded yet because Domain Config loads so early in the bootstrap cycle.
It appears that the problem is that there is no Request object yet. So we can add a check for that before running the routine.
Comment #3
agentrickardRenames the title. This is not a generic problem with config entities. I think it is a specific problem with firing before the Request object has been resolved.
Note that in the Domain world (where this report originated), we had similar issues with modules that implemented Middleware, such as Shield, which is also mentioned in this error log.
Exception handling for those cases seems the only real option.
Comment #4
toprak commentedThanks Agentrickard,
I've disabled shield module. It works as designed.
Comment #5
vaza18 commentedAs it was mentioned above, the issue occurs, when some modules that implement Middleware, such as Shield or Cloudflare, load entities (such as Key module, which stores credentials securely). At that time the request object may not be ready yet depending on various conditions.
I would suggest the following alternative patch, which in addition to the request validation also checks if entity is actually a content entity.
Comment #6
levmyshkinPatch #5 is working for me. I could install Domain modules, but when I tried to add a new Domain, it failed with the error. #5 patched help to fix this problem.
Comment #7
levmyshkinComment #8
joseph.olstadHas anyone tested this patch with sites not using the domain approach?
Also, can someone please roll this patch into a branch and make a merge request?
Comment #9
joseph.olstadgit checkout -b '3142921-fatal-error-when' --track conflict-3142921/'3142921-fatal-error-when'git push --set-upstream conflict-3142921 HEADComment #12
atul_ghate commented