@robinverstrepen opened this Issue on July 17th 2021

Expected Behavior

Working matomo interface

Current Behavior

HTTP error 500

PHP Fatal error:  Uncaught TypeError: mysqli_options(): Argument <a href='/2'>#2</a> ($option) must be of type int, string given in /srv/matomo/libs/Zend/Db/Adapter/Mysqli.php:323

Stack trace:
<a href='/0'>#0</a> /srv/matomo/libs/Zend/Db/Adapter/Mysqli.php(323): mysqli_options(Object(mysqli), 'ssl_ca', '/srv/certs/aws-...')
<a href='/1'>#1</a> /srv/matomo/core/Db/Adapter/Mysqli.php(81): Zend_Db_Adapter_Mysqli->_connect()
<a href='/2'>#2</a> /srv/matomo/libs/Zend/Db/Adapter/Abstract.php(315): Piwik\Db\Adapter\Mysqli->_connect()
<a href='/3'>#3</a> /srv/matomo/core/Db/Adapter.php(51): Zend_Db_Adapter_Abstract->getConnection()
<a href='/4'>#4</a> /srv/matomo/core/Db.php(156): Piwik\Db\Adapter::factory('MYSQLI', Array)
<a href='/5'>#5</a> /srv/matomo/core/Db.php(55): Piwik\Db::createDatabaseObject()
<a href='/6'>#6</a> /srv/matomo/core/Db.php(297): Piwik\Db::get()
<a href='/7'>#7</a> /srv/matomo/core/Option.php(288): Piwik\Db::fetchAll('SELECT option_v...')
<a href='/8'>#8</a> /srv/matomo/core/Option.php(178): Piwik\Option->autoload()
<a href='/9'>#9</a> /srv/matomo/core/Option.php(48): Piwik\Option->getValue('branding_use_cu...')
<a href='/10'>#10</a> /srv/matomo/plugins/CoreAdminHome/CustomLogo.php(53): Piwik\Option::get('branding_use_cu...')
<a href='/11'>#11</a> /srv/matomo/plugins/CoreAdminHome/CustomLogo.php(68): Piwik\Plugins\CoreAdminHome\CustomLogo->isEnabled()
<a href='/12'>#12</a> /srv/matomo/core/ExceptionHandler.php(126): Piwik\Plugins\CoreAdminHome\CustomLogo->hasSVGLogo()
<a href='/13'>#13</a> /srv/matomo/core/ExceptionHandler.php(90): Piwik\ExceptionHandler::getErrorResponse(Object(TypeError))
<a href='/14'>#14</a> /srv/matomo/core/ExceptionHandler.php(42): Piwik\ExceptionHandler::dieWithHtmlErrorPage(Object(TypeError))
<a href='/15'>#15</a> [internal function]: Piwik\ExceptionHandler::handleException(Object(TypeError))
<a href='/16'>#16</a> {main}
  thrown in /srv/matomo/libs/Zend/Db/Adapter/Mysqli.php on line 323

Possible Solution

Comment line 323 in file /srv/matomo/libs/Zend/Db/Adapter/Mysqli.php

Steps to Reproduce (for Bugs)

  1. Use MySQL SSL config with MySQLi driver
    adapter = "MYSQLI"
    enable_ssl = 1
    ssl_ca = "/srv/certs/aws-ca.crt"

Your Environment

  • Matomo Version: 4.3.1
  • PHP Version: 8.0.8
  • Server Operating System: CentOS 7
  • Additionally installed plugins: None
@diosmosis commented on July 18th 2021 Member

Hi @robinverstrepen, sorry you're experiencing this. Can you apply https://github.com/matomo-org/matomo/pull/17788 and see if it fixes the issue for you?

@robinverstrepen commented on July 18th 2021

I've applied the fix and everything is working when enabling SSL. Thank you for your help.

This Issue was closed on July 19th 2021
Powered by GitHub Issue Mirror