dominik-th / matomo-plugin-LoginOIDC

external authentication services for matomo
https://plugins.matomo.org/LoginOIDC/
GNU General Public License v3.0
41 stars 29 forks source link

Action 'loginMod' not found in the module 'LoginOIDC' #13

Closed jurgenhaas closed 4 years ago

jurgenhaas commented 4 years ago

I have successfully installed this module on one server, configured it for keycloak and everything works OK.

Then I installed it on a second server which should be the same setup because the deployment is automated with Ansible. However, I can still configure it exactly like the first one, but the anonymous user gets this error when trying to access the login page:

The following error just broke Matomo (v3.12.0):

An exception has been thrown during the rendering of a template ("Action 'loginMod' not found in the module 'LoginOIDC'").
in /var/www/matomo/sverein/plugins/Login/templates/login.twig line 61

I've already restarted Apache and Redis but still the problem is the same. When I disable LoginOIDC with console, it works again, but not when it's enabled.

Any idea what else I should try?

dominik-th commented 4 years ago

Hi,

can you check if this code block exists in your local file? https://github.com/dominik-th/matomo-plugin-LoginOIDC/blob/master/Controller.php#L91-L98

It should be in your /var/www/matomo/sverein/plugins/LoginOIDC/Controller.php

jurgenhaas commented 4 years ago

Yes it does, at the same line too.

dominik-th commented 4 years ago

That's weird... I guess you already tried to reinstall the plugin? Maybe some file permissions are incorrect and Matomo can't read the Controller.php

Do you have any other third party plugins enabled?

jurgenhaas commented 4 years ago

Yes I did try several times with no luck.

As I'm running 4 Matomo servers I treid again on a third one with the same problem.

Then I tried manual installation on the 4th one and there it worked.

The second and third, where the process failed, I have used Ansible for deployment and now I remember there was an initial error message which I haven't had on the two others.

What has happened is that extraxting the zip archive with Ansible, the rsulting plugin directory was named matomo-plugin-LoginOIDC-0.1.4 which then caused an error saying that this is not a valid plugin name. I then renamed that directory to LoginOIDC and the error changes to the one I reported above.

Now, when uninstalling and rfeinstalling the plugin, the error persists. It looks like something is left behind in Matomo's registry (if something like that exists) and doesn't get updated despite the fact that I reinstall.

Do you know of anything like that and how I could clean up the mess?

jurgenhaas commented 4 years ago

Got it fixed now, but I'm not exactly sure what the difference has been. I had LoginOIDC in the config.ini.php template originally and now I have removed it from there. I guess the activation of a plugin is different depending on the presence of the plugin in that config file.

Never mind, I guess the error was at my end such that the automatic provisioning was not doing it right.

Thanks a lot for your support and patience.