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

After move from php 7.4 to 8.1 superuser login fails #20142

Closed
jenger opened this issue Dec 28, 2022 · 2 comments
Closed

After move from php 7.4 to 8.1 superuser login fails #20142

jenger opened this issue Dec 28, 2022 · 2 comments
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@jenger
Copy link

jenger commented Dec 28, 2022

After changing from php version 7.4.33 to 8.1.13, matomo users with "Superuser access" right can not login any more
For all other user's with lower rights, login still works.

Behavior

A matomo error banner is displayed to the user:

            "Error: no website was found in this Matomo installation.
            Check the table '$siteTableName' in your database, it should contain your Matomo websites."

In the code at
Plugin/Controller.php line 956 Piwik::hasUserSuperUserAccess()
block is entered and throws the exception.

public function redirectToIndex($moduleToRedirect, $actionToRedirect, $websiteId = null, $defaultPeriod = null,
                                    $defaultDate = null, $parameters = array())
....
        if (Piwik::hasUserSuperUserAccess()) {
            $siteTableName = Common::prefixTable('site');
            $message = "Error: no website was found in this Matomo installation.
                        <br />Check the table '$siteTableName' in your database, it should contain your Matomo websites.";

            $ex = new NoWebsiteFoundException($message);
            $ex->setIsHtmlMessage();

            throw $ex;
        }

Expected Behavior

Piwik::hasUserSuperUserAccess() should not return true in this context.
Why does it work with php7.4?

Possible Solution

I skipped the Piwik::hasUserSuperUserAccess() section -> login works.

My Environment

  • Matomo Version: 4.13.0
  • PHP Version: 8.1.13
  • Server Operating System: Linux/Ubuntu 5.4.0-135-generic
  • Webserver: nginx 1.22.1
  • Browser: Firefox 108.0.1
@jenger jenger added Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. To Triage An issue awaiting triage by a Matomo core team member labels Dec 28, 2022
@bx80
Copy link
Contributor

bx80 commented Jan 4, 2023

Hi @jenger, thanks for reporting this.

I've tested Matomo 4.13 superuser login with PHP 8.1.13 and Piwik::hasUserSuperUserAccess() returns false during login as expected.

There are differences in boolean comparison between PHP 7.x and 8.x which could potentially cause this behaviour (https://www.php.net/manual/en/migration80.incompatible.php) but Matomo has been PHP8 compatible for quite a while now and I'm not aware of any related issues with superuser login.

Could you provide a list of the plugins you are using?

@bx80 bx80 added the Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users. label Jan 4, 2023
@sgiehl
Copy link
Member

sgiehl commented Feb 9, 2023

Closing due to inactivity. @jenger If you still experience any issues feel free to look for some help on our forum or create a new issue here. Thanks.

@sgiehl sgiehl closed this as completed Feb 9, 2023
@sgiehl sgiehl 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. Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. To Triage An issue awaiting triage by a Matomo core team member labels Feb 9, 2023
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.
Projects
None yet
Development

No branches or pull requests

3 participants