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

    Details

    • Type: Problem report
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 4.0.28
    • Fix Version/s: 4.0.29rc1, 5.4 (plan)
    • Component/s: Frontend (F)
    • Labels:
      None
    • Team:
      Team B
    • Sprint:
      Sprint 72 (Jan 2021), Sprint 73 (Feb 2021)
    • Story Points:
      0.25

      Description

      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'))
      

       

        Attachments

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

          Issue Links

            Activity

              People

              Assignee:
              sasha Alexander Vladishev
              Reporter:
              srhuston Steve Huston
              Votes:
              3 Vote for this issue
              Watchers:
              11 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: