Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing Matomo using ExtraTools plugin #16741

Closed
nrenault opened this issue Nov 18, 2020 · 9 comments
Closed

Installing Matomo using ExtraTools plugin #16741

nrenault opened this issue Nov 18, 2020 · 9 comments
Labels
answered For when a question was asked and we referred to forum or answered it. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.

Comments

@nrenault
Copy link

nrenault commented Nov 18, 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
Copy link
Member

sgiehl commented Nov 18, 2020

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
Copy link
Author

nrenault commented Nov 18, 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 tsteur added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Nov 18, 2020
@tsteur
Copy link
Member

tsteur commented Nov 18, 2020

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

@nrenault
Copy link
Author

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 !

@sgiehl sgiehl added the Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users. label Nov 19, 2020
@nrenault
Copy link
Author

nrenault commented Nov 20, 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
Copy link
Member

sgiehl commented Nov 20, 2020

@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
Copy link
Author

@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
Copy link
Member

tsteur commented Nov 22, 2020

@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
Copy link
Author

nrenault commented Nov 24, 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 !

@tsteur tsteur added answered For when a question was asked and we referred to forum or answered it. and removed Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users. labels Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

No branches or pull requests

3 participants