[Solved] Error: Required parameter 'host' missing

Hi,

While navigating through Icinga Web 2 interface I could see errors while trying to open link like “Show detailed information on host gw” (http://icinga/monitoring/host/show?host=gw). The following is shown in browser window:

Required parameter 'host' missing

#0 /usr/share/icingaweb2/modules/monitoring/application/controllers/HostController.php(30): Icinga\Web\UrlParams->getRequired()
#1 /usr/share/php/Icinga/Web/Controller/ActionController.php(165): Icinga\Module\Monitoring\Controllers\HostController->init()
#2 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(59): Icinga\Web\Controller\ActionController->__construct()
#3 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch()
#4 /usr/share/php/Icinga/Application/Web.php(304): Zend_Controller_Front->dispatch()
#5 /usr/share/php/Icinga/Application/webrouter.php(107): Icinga\Application\Web->dispatch()
#6 /usr/share/icingaweb2/public/index.php(4): require_once(String)
#7 {main}

Icinga 2 is running on Ubuntu 20.04 LTS. All Icinga Web 2 modules are 2.9.5-1.focal version (installed from packages).

I checked topics and other sites but found nothing regarding this version of Icinga Web 2. What needs to be fixed?

  • Icinga Web 2 version: 2.9.5-1.focal
  • Used modules and their versions: (monitoring 2.9.5)
  • Web browser used: Firefox 97.0
  • Icinga 2 version used: 2.13.2-1.focal
  • PHP version used: 7.4.3
  • Server operating system and version: Ubuntu 20.04 LTS (focal)

Regards

Since the parameter is there, I’d suspect some rewrite rules of the webserver to be the cause here. You should check your server configuration which may be responsible for this.

Thank you a lot! The problem was there (nginx configuration):

  location / {
    try_files $uri /index.php;
  }

I changed it to

  location / {
    try_files $uri /index.php$is_args$args;
  }

and things are fine now.