@nrenault opened this Issue on November 18th 2020

I'm using ExtraTools plugin to install Matomo.

Everything is working with the last stable version of Matomo (3.14.1).

Today I try to install Matomo 4.0.0-rc4 but I have an error when I want to activate ExtraTools (before installing Matomo):

[PDOException] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db_matomo.option' doesn't exist

When I look the config file, activated plugins seems not here anymore.

If I understand, with Matomo 4, plugins (activation/desactivation) are now managed in database instead of the config file, is it true ?

There is any way to be able to use ExtraTools to install Matomo anymore ? (or something else to be able to make a full automatic installation of matomo)

Thanks !

@sgiehl commented on November 18th 2020 Member

Hi @nrenault

The de-/activation is still managed in the config file. But whenever a plugin is de-/activated we store a timestamp in the options table to know when the plugin was last de-/activated.

I haven't used the ExtraTools plugin yet, so can't say what needs to be changed to get it working again.

@nrenault commented on November 18th 2020

Hi @sgiehl

thank you for details !

I use ExtraTools to install Matomo, but for working, the plugin needs to be activated and after install Matomo. So if add/edit datas in the database is mandatory to activate/desactivate a plugin, it's not possible anymore to use it for install Matomo.

@tsteur commented on November 18th 2020 Member

I created a PR in https://github.com/matomo-org/matomo/pull/16744/files not sure if these changes change anything though?

@nrenault commented on November 19th 2020

Hi @tsteur

I will wait to test it to confirm you, but it's sounds good and I think it will solve my issue with ExtraTools.

Thanks for you reactivity !

@nrenault commented on November 20th 2020

Hello,

I checked this morning with RC6 version.

If I have a config file with database credentials, I have an error (both if database exist or not)

matomo]# php console plugin:activate ExtraTools
ERROR [2020-11-20 05:17:44] 9902  Uncaught exception: /matomo/libs/Zend/Db/Statement/Pdo.php(236): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'matomo.option' doesn't exist
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'matomo.option' doesn't exist
[Zend_Db_Statement_Exception] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'matomo.option' doesn't exist
[PDOException]  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'matomo.option' doesn't exist

plugin:activate [plugin1] ... [pluginN]
matomo]# /bin/php console core:update --no-ansi -n --version
Matomo version 4.0.0-rc6

If I remove the config file:

# php console plugin:activate ExtraTools

The configuration file {/srv/www/matomo/config/config.ini.php} has not been found or could not be read.
 » Please check that /srv/www/matomo/config/config.ini.php is readable by the user 'root'.

ERROR [2020-11-20 06:26:27] 10412  There was an error while updating the javascript tracker: SQLSTATE[HY000] [2002] No such file or directory
ERROR [2020-11-20 06:26:27] 10412  There was an error while updating the javascript tracker: SQLSTATE[HY000] [2002] No such file or directory
Activated plugin ExtraTools
Error: error or warning logs detected, exit 1
# php console plugin:list
+---------------+-------------------+-----------+
| Plugin        | Core or optional? | Status    |
+---------------+-------------------+-----------+
| Diagnostics   | Core              | Activated |
| Login         | Core              | Activated |
| CoreAdminHome | Core              | Activated |
| UsersManager  | Core              | Activated |
| SitesManager  | Core              | Activated |
| Installation  | Core              | Activated |
| Monolog       | Core              | Activated |
| Intl          | Core              | Activated |
| ExtraTools    | Optional          | Activated |
+---------------+-------------------+-----------+

It's seems to work without config file, but I still have some errors.

@sgiehl commented on November 20th 2020 Member

@nrenault maybe the plugin author (@mikkeschiren) is able to help you here. I'm not sure what requirements the plugin have and if it is supposed to work without any configuration or database 🤷

@nrenault commented on November 20th 2020

@sgiehl maybe I'm not clear in my feedback but the problem is not from the plugin or the database.

I have the same error when I try to activate another plugin (ex: LoginLdap) before Matomo installation.

# php console plugin:activate LoginLdap

The configuration file {/srv/www/matomo/config/config.ini.php} has not been found or could not be read.
 » Please check that /srv/www/matomo/config/config.ini.php is readable by the user 'root'.

ERROR [2020-11-20 09:45:25] 16209  There was an error while updating the javascript tracker: SQLSTATE[HY000] [2002] No such file or directory
ERROR [2020-11-20 09:45:25] 16209  There was an error while updating the javascript tracker: SQLSTATE[HY000] [2002] No such file or directory
ERROR [2020-11-20 09:45:25] 16209  There was an error while updating the javascript tracker: SQLSTATE[HY000] [2002] No such file or directory
Activated plugin LoginLdap
Error: error or warning logs detected, exit 1

If I just ignore this error, I can use ExtraTools to install Matomo, and everything works.
I follow exactly the same steps/process than I did before with 3.14 or 3.14.1 (ansible-playbook).

I dowload Matomo and I activate ExtraTools (php console plugin:activate ExtraTools). Nothing more.
So if ExtraTools needs a database, I'm suppose to get the same error before with 3.14.

For my usage, if I ignore errors, I can use ExtraTools like before and install Matomo with this plugin. So you solved my problem.

@tsteur commented on November 22nd 2020 Member

@nrenault I think it is a problem with that plugin as i think it was never supposed to work like this in the first place. It should not be possible to install any plugin before Matomo is not fully installed.

What you maybe want to look at is the config always_load_commands_from_plugin=ExtraTools.

Can you try to add to your config/common.config.ini.php as part of the [General] section this line:

always_load_commands_from_plugin=ExtraTools

Then you might be able to use ExtraTools command line without needing to activate the ExtraTools plugin.

I'm otherwise not sure how that plugin works.

@nrenault commented on November 24th 2020

Hi @tsteur !

Your advice works, thanks !

It's works (with RC7) too when I activate the plugin, but I have errors.
If I add always_load_commads_from_plugin=ExtraTools, no need to activate the plugin and no errors.

Thanks again for your answers, your reactivity and your help !

This Issue was closed on November 24th 2020
Powered by GitHub Issue Mirror