Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When I open profiler for database, I see
Warning: Illegal string offset 'status_code' in Drupal\webprofiler\DataCollector\RequestDataCollector->getPanelSummary() (line 74 of modules/contrib/devel/webprofiler/src/DataCollector/RequestDataCollector.php).
Drupal\webprofiler\DataCollector\RequestDataCollector->getPanelSummary() (Line: 122)
Drupal\webprofiler\Controller\DashboardController->dashboardAction(Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 153)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 38)
Drupal\webprofiler\StackMiddleware\WebprofilerMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 656)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Warning: Illegal string offset 'status_text' in Drupal\webprofiler\DataCollector\RequestDataCollector->getPanelSummary() (line 74 of modules/contrib/devel/webprofiler/src/DataCollector/RequestDataCollector.php).
Drupal\webprofiler\DataCollector\RequestDataCollector->getPanelSummary() (Line: 122)
Drupal\webprofiler\Controller\DashboardController->dashboardAction(Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 153)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 38)
Drupal\webprofiler\StackMiddleware\WebprofilerMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 656)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Comments
Comment #2
lussolucaCould you please provide some more information?
Which web server are you using, which kind of request you are trying to profile?
Comment #3
LOBsTerr CreditAttribution: LOBsTerr commented@lussoluca
I'm using nginx version: nginx/1.10.3 (Ubuntu).
Actually, it happens on every page.
I tried to debug it. in $this->data I receive the string instead of array:
I will continue to debug and will provide more information at what moment it is converted to string.
Comment #4
LOBsTerr CreditAttribution: LOBsTerr commentedSo, after an active debugging process I finally was able to find it.
The value is stored in database and it is stored as a serialized string and it comes there as an string already
So, I started to check it and found Symfony\Component\HttpKernel\DataCollector\lateCollect()
which converts $this->data to cloneVar and as the result it returns a string.
I have checked 8.3. There the version "symfony/http-kernel": "^2.2|3.*" is used and this code does not exist there.
Where as in 8.4 the version is "symfony/http-kernel": "~2.7|~3.0".
Comment #5
lussolucaAre you on drupal 8.4.x?
Comment #6
LOBsTerr CreditAttribution: LOBsTerr commentedYes, check my comment above. I have just updated the information.
Comment #7
lussolucaComment #8
adriancidIn my Drupal 8.4.4 the module works fine, I come from update to 8.5 and I see this error and the Request section is not working due to this error.
Comment #9
lussolucaYes this is the problem, but I don't understand why the unserialize doesn't recreate the array back. A quick fix is to override the lateCollect() method to avoid the data conversion.
Comment #11
rajanvalecha12 CreditAttribution: rajanvalecha12 commentedafter applying this patch i get :
"LogicException: The database connection is not serializable. This probably means you are serializing an object that has an indirect reference to the database connection. Adjust your code so that is not necessary. Alternatively, look at DependencySerializationTrait as a temporary solution. in Drupal\Core\Database\Connection->__sleep() (line 1472 of /Applications/MAMP/htdocs/drupal_exp/core/lib/Drupal/Core/Database/Connection.php) #0 [internal function]: Drupal\Core\Database\Connection->__sleep() #1 /Applications/MAMP/htdocs/drupal_exp/vendor/symfony/http-kernel/DataCollector/DataCollector.php(45): serialize(Array) #2 [internal function]: Symfony\Component\HttpKernel\DataCollector\DataCollector->serialize() #3 /Applications/MAMP/htdocs/drupal_exp/modules/contrib/devel/webprofiler/src/Profiler/DatabaseProfilerStorage.php(101): serialize(Array) #4 /Applications/MAMP/htdocs/drupal_exp/vendor/symfony/http-kernel/Profiler/Profiler.php(105): Drupal\webprofiler\Profiler\DatabaseProfilerStorage->write(Object(Symfony\Component\HttpKernel\Profiler\Profile)) #5 /Applications/MAMP/htdocs/drupal_exp/vendor/symfony/http-kernel/EventListener/ProfilerListener.php(113): Symfony\Component\HttpKernel\Profiler\Profiler->saveProfile(Object(Symfony\Component\HttpKernel\Profiler\Profile)) #6 /Applications/MAMP/htdocs/drupal_exp/modules/contrib/devel/webprofiler/src/EventDispatcher/TraceableEventDispatcher.php(76): Symfony\Component\HttpKernel\EventListener\ProfilerListener->onKernelTerminate(Object(Symfony\Component\HttpKernel\Event\PostResponseEvent), 'kernel.terminat...', Object(Drupal\webprofiler\EventDispatcher\TraceableEventDispatcher)) #7 /Applications/MAMP/htdocs/drupal_exp/vendor/symfony/http-kernel/HttpKernel.php(88): Drupal\webprofiler\EventDispatcher\TraceableEventDispatcher->dispatch('kernel.terminat...', Object(Symfony\Component\HttpKernel\Event\PostResponseEvent)) #8 /Applications/MAMP/htdocs/drupal_exp/vendor/stack/builder/src/Stack/StackedHttpKernel.php(32): Symfony\Component\HttpKernel\HttpKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\LocalRedirectResponse)) #9 /Applications/MAMP/htdocs/drupal_exp/core/lib/Drupal/Core/DrupalKernel.php(644): Stack\StackedHttpKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\LocalRedirectResponse)) #10 /Applications/MAMP/htdocs/drupal_exp/index.php(22): Drupal\Core\DrupalKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\LocalRedirectResponse)) #11 {main}."
at /admin/modules/uninstall
Comment #13
lussolucaI cannot replicate the serialization error so I'm going to close this for now.
Feel free to open a new issue if some other errors occur
Comment #15
sami-an CreditAttribution: sami-an commentedWarning: Illegal string offset 'status_text' in Symfony
Comment #16
ilgnerfagundes CreditAttribution: ilgnerfagundes commentedGood morning, I received this error when trying to enter any of the reports. I am using drupal core 8.8.2 and Webprofiler 8.x-2.1. Using this environment with postgree https://hub.docker.com/_/drupal