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 when the problems exceed 1000 -> 1k ([A non well formed numeric value encountered] + [ICINGAWEB2] + [PHP]) #948

Closed
habib-ahmed-01 opened this issue Dec 16, 2023 · 0 comments · Fixed by #987
Assignees
Labels
bug Something isn't working
Milestone

Comments

@habib-ahmed-01
Copy link

Describe the bug

In my ICINGA environment, in ICINGAWEB2 the rendering of the webpage is facing an error:

icingaweb2[5337]: Could not invoke custom navigation item renderer. ErrorException in /usr/share/icingaweb2/modules/icingadb/library/Icingadb/Web/Navigation/Renderer/TotalProblemsBadge.php:55 with message: A non well formed numeric value encountered

This problem is observed when my ICINGAWEB2 Problems exceed 1000 it gets converted to 1K. This conversion takes place in a function in file "ProblemsBadge.php".
File location on my system: /usr/share/icingaweb2/modules/icingadb/library/Icingadb/Web/Navigation/Renderer/ProblemsBadge.php

protected function round($count)
    {
        if ($count > 1000000) {
            $count = round($count, -6) / 1000000 . 'M';
        } elseif ($count > 1000) {
            $count = round($count, -3) / 1000 . 'k';
        }

        return $count;
    }

But other functions do not handle Non-Numeric Values, when round($count) is called.

To Reproduce

Provide a link to a live example, or an unambiguous set of steps to reproduce this issue. Include configuration, logs, etc. to reproduce, if relevant.

  1. Please set up the Icingaweb2 using apache2
  2. Make sure that Host or Service Problems in your Icingaweb2 exceed 1000 values
  3. Then check the status of apache2 on the server, it will give this error.

Expected behavior

The web interface should load properly, and this particular error stops the renderer and icingaweb2 is not working.

Screenshots

apache status error
Bug report
Bug report2

Your Environment

Include as many relevant details about the environment you experienced the problem in

  • Icinga Web 2 version and modules (System - About): 2.12.1
  • Web browser used: Google Chrome
  • Icinga 2 version used (icinga2 --version): The Icinga 2 network monitoring daemon (version: r2.14.0-1)
  • PHP version used (php --version): PHP 7.4.33, Zend Engine v3.4.0
  • Server operating system and version: SLES VERSION="15-SP5"

Additional context

Add any other context about the problem here.

@nilmerg nilmerg added the bug Something isn't working label Dec 18, 2023
@nilmerg nilmerg transferred this issue from Icinga/icingaweb2 Dec 18, 2023
@nilmerg nilmerg added this to the 1.1.2 milestone Dec 18, 2023
@nilmerg nilmerg added the difficulty/easy Anyone can do this label Jan 8, 2024
@nilmerg nilmerg self-assigned this Mar 21, 2024
@nilmerg nilmerg removed the difficulty/easy Anyone can do this label Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants