Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-18931

Error in include/classes/graphdraw/CLineGraphDraw.php in 4.0.28

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Fixed
    • Icon: Critical Critical
    • 4.0.29rc1, 5.4 (plan)
    • 4.0.28
    • Frontend (F)
    • None
    • Sprint 72 (Jan 2021), Sprint 73 (Feb 2021)
    • 0.25

      Running RHEL7 and Zabbix 4.0.27, system upgraded to 4.0.28 two days ago.  Today I noticed no graphs were loading on any page - screen pages or individual graph pages.  Only a broken icon showing.  HTTP error log showed an error 500:

      [Wed Jan 27 14:09:55.933697 2021] [:error] [pid 1417] [client X.X.X.X:38378] PHP Parse error:  syntax error, unexpected ':', expecting ';' or '{' in /usr/share/zabbix/include/classes/graphdraw/CLineGraphDraw.php on line 1305, referer: https://X.X.X.X/host_screen.php?hostid=10496&screenid=4
      

      After looking at the code it seemed like the ": array" part was unliked by php, and removing that allows the graphs to redraw. I don't know enough php to know if that's the right way to fix it, but I can see graphs again

      --- tmp.php     2021-01-27 14:13:18.497561117 -0500
      +++ /usr/share/zabbix/include/classes/graphdraw/CLineGraphDraw.php      2021-01-27 14:12:52.692597306 -0500
      @@ -1302,7 +1302,7 @@
               *
               * @return array
               */
      -       private function getOptimalDateTimeIntervalSpec(int $pref_sub_interval, float $min_sub_interval): array {
      +       private function getOptimalDateTimeIntervalSpec(int $pref_sub_interval, float $min_sub_interval) {
                      // Possible X-axis main and sub-intervals.
                      $intervals = [
                              'PT1M' => ['PT1S', 'PT5S', 'PT10S', 'PT30S'],
      @@ -1382,7 +1382,7 @@
               *
               * @return array
               */
      -       private function getDateTimeIntervals(int $start, int $end, DateInterval $interval): array {
      +       private function getDateTimeIntervals(int $start, int $end, DateInterval $interval) {
                      $intervals = [];
       
                      $interval_ts = (new DateTime('@0'))
      

       

        1. Selection_234.png
          Selection_234.png
          99 kB
        2. Selection_236.png
          Selection_236.png
          88 kB
        3. zbx-18931.patch
          1 kB

            sasha Alexander Vladishev
            srhuston Steve Huston
            Team B
            Votes:
            3 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: