Fatal error: Uncaught Error: Call to a member function getPath() on null in /app/web/modules/contrib/elastic_apm/src/ApiService.php:182

Created on 22 March 2023, over 1 year ago
Updated 24 May 2023, over 1 year ago

Problem/Motivation

when running $ drush cex i get the following error:

PHP Fatal error: Uncaught Error: Call to a member function getPath() on null in /app/web/modules/contrib/elastic_apm/src/ApiService.php:182
Stack trace:
#0 /app/web/modules/contrib/elastic_apm/src/ApiService.php(154): Drupal\elastic_apm\ApiService->shouldMonitorPath()
#1 /app/web/modules/contrib/elastic_apm/src/EventSubscriber/RequestSubscriber.php(116): Drupal\elastic_apm\ApiService->shouldMonitor()
#2 [internal function]: Drupal\elastic_apm\EventSubscriber\RequestSubscriber->onTerminateRequest(Object(Symfony\Component\HttpKernel\Event\TerminateEvent), 'kernel.terminat...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#3 /app/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\TerminateEvent), 'kernel.terminat...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#4 /app/vendor/symfony/http-kernel/HttpKernel.php(103): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object(Symfony\Component\HttpKernel\Event\TerminateEvent), 'kernel.terminat...')
#5 /app/vendor/stack/builder/src/Stack/StackedHttpKernel.php(32): Symfony\Component\HttpKernel\HttpKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Symfony\Component\HttpFoundation\Response))
#6 /app/web/core/lib/Drupal/Core/DrupalKernel.php(702): Stack\StackedHttpKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Symfony\Component\HttpFoundation\Response))
#7 /app/vendor/drush/drush/src/Boot/DrupalBoot8.php(298): Drupal\Core\DrupalKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Symfony\Component\HttpFoundation\Response))
#8 [internal function]: Drush\Boot\DrupalBoot8->terminate()
#9 {main}
thrown in /app/web/modules/contrib/elastic_apm/src/ApiService.php on line 182

Proposed resolution

patch to fix this issue and exclude null routes

Remaining tasks

to be tested by community

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇪🇬Egypt Mohamed Nabawy

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

Comments & Activities

Production build 0.71.5 2024