Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Fatal error: Uncaught ErrorException: var_export does not handle circular references in /usr/local/www/icingaweb2/library/Icinga/Cli/Loader.php:384 Stack trace: #334

Closed
gettoknowmii opened this issue Mar 16, 2022 · 4 comments

Comments

@gettoknowmii
Copy link

Expected Behavior

The vpsheredb daemon should run without errors when we try to add a new esxi or vcenter server.

Current Behavior

currently, whenever we try to add a server connection, the vsphere daemon stops running and errors out

Possible Solution

I don't know much about php and how to fixed this.

Steps to Reproduce (for bugs)

icingacli vspheredb daemon run --trace --debug
Login to icinga, click on the 'Virtualization(VMware)'. the GUI will freeze and if you check the logs you will see the following

Fatal error: Uncaught ErrorException: Array to string conversion in /usr/local/www/icingaweb2/library/Icinga/Cli/Loader.php:384
Stack trace:
#0 /usr/local/www/icingaweb2/library/Icinga/Cli/Loader.php(384): Icinga\Application\ApplicationBootstrap->Icinga\Application{closure}(8, 'Array to string...', '/usr/local/www/...', 384, Array)
#1 /usr/local/www/icingaweb2/library/Icinga/Cli/Loader.php(268): Icinga\Cli\Loader->formatTrace(Array)
#2 /usr/local/www/icingaweb2/library/Icinga/Application/Cli.php(162): Icinga\Cli\Loader->dispatch()
#3 /usr/local/www/icingaweb2/library/Icinga/Application/Cli.php(152): Icinga\Application\Cli->dispatchOnce()
#4 /usr/local/www/icingaweb2/bin/icingacli(7): Icinga\Application\Cli->dispatch()
#5 {main}
thrown in /usr/local/www/icingaweb2/library/Icinga/Cli/Loader.php on line 384

Your Environment

  • VMware vCenter®/ESXi™-Version. 6.7
  • Version/GIT-Hash of this module:
  • Icinga Web 2 version: 2.8.2
  • Operating System and version: FreeBSD 13.0 and ports-tree 2021Q4
  • Webserver, PHP versions: 7.4
@Thomas-Gelf
Copy link
Contributor

The exception is hiding the real error, but this looks different than Icinga\Cli\Loader from Icinga Web 2.8.2. Please share 10+ lines of /usr/local/www/icingaweb2/library/Icinga/Cli/Loader.php around line 384, so we can fix the obfuscation first

@gettoknowmii
Copy link
Author

381 $args = $step['args'];
382 foreach ($args as & $v) {
383 if (is_array($v)) {
384 $v = var_export($v, 1);
385 } else {
386 $v = (string) $v;
387 }
388 }
389 $output[$i] = sprintf(
390 '#%d %s:%d %s%s(%s)',
391 $i,
392 isset($step['file']) ? preg_replace(
393 '.+/library/',
394 'library/',
395 $step['file']
396 ) : '[unknown file]',
397 isset($step['line']) ? $step['line'] : '0',
398 $object,
399 $step['function'],
400 implode(', ', $args)
401 );
402 }
403 return implode(PHP_EOL, $output) . PHP_EOL;
404 }
405
406 public function hasCommand($name)
407 {
408 return in_array($name, $this->listCommands());
409 }
410
411 public function hasModule($name)

@Thomas-Gelf
Copy link
Contributor

Ok, that's correct. I got confused by Array to string conversion, but this seems to belong to the real error here. var_export does not handle circular references however happens in the Loader, and that's where the trace comes from. Please replace var_export with print_r and try again

@Thomas-Gelf
Copy link
Contributor

Closing this issue. The underlying error has probably been fixed, and the culprit for that specific error wasn't this module. In case it re-appears please let me know, we'll track it down

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants