Details

      Description

      Hello Devs.

      Another php7 errror:

      [12-Jul-2015 20:30:01 Europe/Berlin] PHP Fatal error:  Uncaught TypeError: Argument 2 passed to CFrontendApiWrapper::callMethod() must be of the type array, boolean given, called in /var/www/zabbix.domain.de/htdocs/include/classes/api/wrappers/CApiWrapper.php on line 82 and defined in /var/www/zabbix.domain.de/htdocs/include/classes/api/wrappers/CFrontendApiWrapper.php:61
      Stack trace:
      #0 /var/www/zabbix.domain.de/htdocs/include/classes/api/wrappers/CApiWrapper.php(82): CFrontendApiWrapper->callMethod('logout', false)
      #1 /var/www/zabbix.domain.de/htdocs/include/classes/user/CWebUser.php(88): CApiWrapper->__call('logout', Array)
      #2 /var/www/zabbix.domain.de/htdocs/index.php(49): CWebUser::logout()
      #3 {main}
        thrown in /var/www/zabbix.domain.de/htdocs/include/classes/api/wrappers/CFrontendApiWrapper.php on line 61
      

        Issue Links

          Activity

          Hide
          richlv added a comment - - edited

          could you please specify zabbix version as well ?
          also note that php7 is not even released yet

          Oleksiy Zagorskyi Issue summary contains "zabbix-2.4.5".
          I've just added it to Affect version.

          Show
          richlv added a comment - - edited could you please specify zabbix version as well ? also note that php7 is not even released yet Oleksiy Zagorskyi Issue summary contains "zabbix-2.4.5". I've just added it to Affect version.
          Hide
          Thomas Stein added a comment -

          > also note that php7 is not even released yet

          I opened the bug with that in mind. Just for the record so to speak.

          cheers
          t.

          Show
          Thomas Stein added a comment - > also note that php7 is not even released yet I opened the bug with that in mind. Just for the record so to speak. cheers t.
          Hide
          richlv added a comment -

          with the final php7 out yesterday (december 3rd), this issue might be worth re-evaluating

          Show
          richlv added a comment - with the final php7 out yesterday (december 3rd), this issue might be worth re-evaluating
          Hide
          Oleksandr Natalenko added a comment - - edited

          Confirm the issue with PHP 7.0.2 and Zabbix 2.4.7:

          2016/01/07 18:51:40 [error] 16311#0: *234847 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught TypeError: Argument 2 passed to CFrontendApiWrapper::callMethod() must be of the type array, boolean given, called in /usr/share/webapps/zabbix/include/classes/api/wrappers/CApiWrapper.php on line 82 and defined in /usr/share/webapps/zabbix/include/classes/api/wrappers/CFrontendApiWrapper.php:61
          Stack trace:
          #0 /usr/share/webapps/zabbix/include/classes/api/wrappers/CApiWrapper.php(82): CFrontendApiWrapper->callMethod('logout', false)
          #1 /usr/share/webapps/zabbix/include/classes/user/CWebUser.php(88): CApiWrapper->__call('logout', Array)
          #2 /usr/share/webapps/zabbix/index.php(49): CWebUser::logout()
          #3 {main}
            thrown in /usr/share/webapps/zabbix/include/classes/api/wrappers/CFrontendApiWrapper.php on line 61" while reading response header from upstream, client: 1.2.3.4, server: zabbix.example.com, request: "GET /index.php?reconnect=1&sid=57669cb2f7ce4885 HTTP/1.1", upstream: "fastcgi://127.0.0.1:65011", host: "zabbix.example.com", referrer: "https://zabbix.example.com/dashboard.php"
          
          Show
          Oleksandr Natalenko added a comment - - edited Confirm the issue with PHP 7.0.2 and Zabbix 2.4.7: 2016/01/07 18:51:40 [error] 16311#0: *234847 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught TypeError: Argument 2 passed to CFrontendApiWrapper::callMethod() must be of the type array, boolean given, called in /usr/share/webapps/zabbix/include/classes/api/wrappers/CApiWrapper.php on line 82 and defined in /usr/share/webapps/zabbix/include/classes/api/wrappers/CFrontendApiWrapper.php:61 Stack trace: #0 /usr/share/webapps/zabbix/include/classes/api/wrappers/CApiWrapper.php(82): CFrontendApiWrapper->callMethod('logout', false) #1 /usr/share/webapps/zabbix/include/classes/user/CWebUser.php(88): CApiWrapper->__call('logout', Array) #2 /usr/share/webapps/zabbix/index.php(49): CWebUser::logout() #3 {main} thrown in /usr/share/webapps/zabbix/include/classes/api/wrappers/CFrontendApiWrapper.php on line 61" while reading response header from upstream, client: 1.2.3.4, server: zabbix.example.com, request: "GET /index.php?reconnect=1&sid=57669cb2f7ce4885 HTTP/1.1", upstream: "fastcgi://127.0.0.1:65011", host: "zabbix.example.com", referrer: "https://zabbix.example.com/dashboard.php"
          Hide
          Stefan de Konink added a comment -
          CApiWrapper.php
                  /**
                   * A magic method for calling the public methods of the API client.
                   *
                   * @param string        $method         API method name
                   * @param array         $params         API method parameters
                   *
                   * @return CApiClientResponse
                   */
                  public function __call($method, array $params) {
                          $a = reset($params);
                          if ($a === FALSE) {
                                  $a = $params;
                          }       
                          return $this->callMethod($method, $a);
                  }
          

          Hopefully someone commits something prettier.

          Show
          Stefan de Konink added a comment - CApiWrapper.php /** * A magic method for calling the public methods of the API client. * * @param string $method API method name * @param array $params API method parameters * * @ return CApiClientResponse */ public function __call($method, array $params) { $a = reset($params); if ($a === FALSE) { $a = $params; } return $ this ->callMethod($method, $a); } Hopefully someone commits something prettier.
          Hide
          Oleksandr Natalenko added a comment -

          @Stefan de Konink, this does not fix logout.

          Show
          Oleksandr Natalenko added a comment - @Stefan de Konink, this does not fix logout.
          Hide
          Stefan de Konink added a comment -

          It does. I have just deployed it.

          Show
          Stefan de Konink added a comment - It does. I have just deployed it.
          Hide
          Oleksandr Natalenko added a comment -

          Umm, sorry, missed changed return statement. Works for me as well, thanks!

          Show
          Oleksandr Natalenko added a comment - Umm, sorry, missed changed return statement. Works for me as well, thanks!
          Hide
          Ivo Kurzemnieks added a comment -

          RESOLVED in svn://svn.zabbix.com/branches/dev/ZBX-9700

          Show
          Ivo Kurzemnieks added a comment - RESOLVED in svn://svn.zabbix.com/branches/dev/ZBX-9700
          Hide
          Ivo Kurzemnieks added a comment - - edited

          (1) Translation strings added:

          • Cannot call method "%1$s.%2$s" without parameters.

          Gunars Pujats CLOSED

          Show
          Ivo Kurzemnieks added a comment - - edited (1) Translation strings added: Cannot call method "%1$s.%2$s" without parameters. Gunars Pujats CLOSED
          Hide
          Gunars Pujats added a comment -

          Successfully tested!

          Show
          Gunars Pujats added a comment - Successfully tested!
          Hide
          Ivo Kurzemnieks added a comment - - edited

          Fixed in:

          • pre-3.0.2rc1 r58902
          • pre-3.1.0 (trunk) r58903
          Show
          Ivo Kurzemnieks added a comment - - edited Fixed in: pre-3.0.2rc1 r58902 pre-3.1.0 (trunk) r58903
          Hide
          Ivo Kurzemnieks added a comment - - edited

          (2) API changelog updated

          Gunars Pujats CLOSED

          Show
          Ivo Kurzemnieks added a comment - - edited (2) API changelog updated Gunars Pujats CLOSED
          Hide
          richlv added a comment - - edited

          the changelog entry says "fixed API receiving null and false instead of an array in method parameters"

          this issue was about zabbix frontend + php7.

          is zabbix frontend now officially working & supported with php7 ? if so, should that be mentioned in the changelog, maybe ?

          Ivo Kurzemnieks It's not about all php7 related problems in the frontend. If such problems occur, it should be split into multiple tasks. There could be numerous things for improvements and so on. The issue was about user trying to log out on php7 and got a fatal error. The main problem occurred deeply in API core. There were more ways to generate fatal errors breaking the API, just by simply not giving "params" in request. In other words - function arguments. The thing that was fixed, was that API received "null" and "false" instead of an array. I cannot say for sure that it fully supports php7, I haven't run the tests. Bugs could be hidden deeply in the code. We just haven't found them yet. Claiming to fully support php7 and getting a new issue the next day would be silly. Most of the frontend should work on php7, but I'm very suspicious.

          Ivo Kurzemnieks I ran some tests. So far sniffers couldn't find anything useful. But unit tests don't work.

          Fatal error: Uncaught Error: Call to undefined method Mock_CConverter_985a22a8::method() in C:\Development\zabbix\frontends\php\tests\unit\include\classes\import\converters\CConverterChainTest.php on line 53

          Show
          richlv added a comment - - edited the changelog entry says "fixed API receiving null and false instead of an array in method parameters" this issue was about zabbix frontend + php7. is zabbix frontend now officially working & supported with php7 ? if so, should that be mentioned in the changelog, maybe ? Ivo Kurzemnieks It's not about all php7 related problems in the frontend. If such problems occur, it should be split into multiple tasks. There could be numerous things for improvements and so on. The issue was about user trying to log out on php7 and got a fatal error. The main problem occurred deeply in API core. There were more ways to generate fatal errors breaking the API, just by simply not giving "params" in request. In other words - function arguments. The thing that was fixed, was that API received "null" and "false" instead of an array. I cannot say for sure that it fully supports php7, I haven't run the tests. Bugs could be hidden deeply in the code. We just haven't found them yet. Claiming to fully support php7 and getting a new issue the next day would be silly. Most of the frontend should work on php7, but I'm very suspicious. Ivo Kurzemnieks I ran some tests. So far sniffers couldn't find anything useful. But unit tests don't work. Fatal error: Uncaught Error: Call to undefined method Mock_CConverter_985a22a8::method() in C:\Development\zabbix\frontends\php\tests\unit\include\classes\import\converters\CConverterChainTest.php on line 53

            People

            • Assignee:
              Unassigned
              Reporter:
              Thomas Stein
            • Votes:
              3 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: