Error occured at first use

Created on 28 October 2023, about 1 year ago
Updated 6 August 2024, 4 months ago

Problem/Motivation

when I click on XHProf link (bottom of page) I encountered this error:

The website encountered an unexpected error. Please try again later.
TypeError: Drupal\xhprof\Controller\XHProfController::runAction(): Argument #1 ($run) must be of type Drupal\xhprof\XHProfLib\Run, bool given in Drupal\xhprof\Controller\XHProfController->runAction() (line 99 of modules/contrib/xhprof/src/Controller/XHProfController.php).

Drupal\xhprof\Controller\XHProfController->runAction(, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
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}() (Line: 169)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 718)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Steps to reproduce

drupal : 9.5.11
php : 8.1
nginx : 1.18
I set "http://example.com/sites/files/xhgui" for XHGui Storage URL
I made a dir "xhgui" at files directory and set www-data for its owner:group

๐Ÿ› Bug report
Status

Postponed: needs info

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ทIran sgarsivaz

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

Comments & Activities

  • Issue created by @sgarsivaz
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada minoroffense Ottawa, Canada

    Well you donโ€™t need the files folder to store runs if youโ€™re using this module. It would ship it into xhgui.

    Also do you have the xhprof php plugin installed and enabled? php -m on the command line should show it if so. Or the output of phpinfo()

  • ๐Ÿ‡ฎ๐Ÿ‡ทIran sgarsivaz

    Yes I installed xhprof php plugin. this is output of php -i | grep xhprof :

    /etc/php/8.1/cli/conf.d/20-xhprof.ini,
    xhprof
    xhprof support => enabled
    xhprof.collect_additional_info => 0 => 0
    xhprof.output_dir => /var/log/php-fpm/xhprof.log => /var/log/php-fpm/xhprof.log
    xhprof.sampling_depth => 0x7fffffff => 0x7fffffff
    xhprof.sampling_interval => 100000 => 100000 

    this error occures when I use xhgui. whithout it, it runs correctly if I don't encounter timeout error with :

    max_input_time = 300 
    memory_limit = 512
  • ๐Ÿ‡ฌ๐Ÿ‡ชGeorgia almador

    The same error on Drupal 10.3.1

    TypeError: Drupal\xhprof\Controller\XHProfController::runAction(): Argument #1 ($run) must be of type Drupal\xhprof\XHProfLib\Run, bool given in Drupal\xhprof\Controller\XHProfController->runAction() (line 99 of modules/contrib/xhprof/src/Controller/XHProfController.php)

    Xhprof is working fine on "File storage" option, but not on "XHGui Upload"

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada minoroffense Ottawa, Canada

    Iโ€™m working on a 10.3 site today and Iโ€™ll figure out whatโ€™s up with xhgui.

  • Status changed to Postponed: needs info 4 months ago
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada minoroffense Ottawa, Canada

    I tested it with our local sites and it appears to work. I'm using the latest xhprof dev module and the xhgui php profiler module. Running with PHP 8.2

    I enabled the module as usual and then configured it.

    I've attached the settings we use. Note the URL for the XHGui instance needs to be configured. We use a docker instance and it's docker network name is "xhgui" so we set the url to "http://xhgui"

    You can see the nginx config we use for the xhgui instance: https://gitlab.com/dropfort/dropfort_build/-/tree/6.x/assets/development...

    And this is the docker-compose file which brings it up. Maybe one of those may help with figuring out why it's not working.

    https://gitlab.com/dropfort/dropfort_build/-/blob/6.x/assets/development...

    And this is how we install xhprof into the container: https://gitlab.com/dropfort/dropfort_build/-/blob/6.x/assets/development...

Production build 0.71.5 2024