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

"Visits over time" graph "MySQL gone away" on PHP 7.2+ #15726

Closed
millnut opened this issue Mar 24, 2020 · 18 comments
Closed

"Visits over time" graph "MySQL gone away" on PHP 7.2+ #15726

millnut opened this issue Mar 24, 2020 · 18 comments
Labels
duplicate For issues that already existed in our issue tracker and were reported previously.

Comments

@millnut
Copy link

millnut commented Mar 24, 2020

Hi,

I'm trying to debug the cause of a MySQL gone away error caused by the "Visits over time" graph on the dashboard.

Can anyone give me some pointers on where to start file wise?

@sgiehl
Copy link
Member

sgiehl commented Mar 24, 2020

Do you have archiving triggered by browser requests or are you using a cron job to archive the reports?
When triggered by the browser it might happen, that the archiving part takes too long and the connection is interrupted in between.
It can also happen in cron archiving. This is something we already worked on for Matomo 4. See #15619

@millnut
Copy link
Author

millnut commented Mar 24, 2020

It's setup to use a cron job

@sgiehl
Copy link
Member

sgiehl commented Mar 24, 2020

So browser archiving is disabled in the settings?

@millnut
Copy link
Author

millnut commented Mar 24, 2020

yep that's correct

@sgiehl
Copy link
Member

sgiehl commented Mar 24, 2020

Are you seeing any other PHP errors in the error log? Wondering how a "MySQL gone away" can happen when working with prearchived reports only. That should actually be quite fast 🤔

@millnut
Copy link
Author

millnut commented Mar 24, 2020

nope PHP just has MySQL gone away in the error log, can provide you a login to verify although would need to upgrade from PHP 7.1 to PHP 7.2 for you to see the error again

@sgiehl
Copy link
Member

sgiehl commented Mar 24, 2020

So it only happens with PHP 7.2, but not 7.1. Was the error reproducible or did it only occur randomly?

@millnut
Copy link
Author

millnut commented Mar 24, 2020

Yep just PHP 7.2 and yep can be reproduced when viewing the dashboard each time

@tsteur
Copy link
Member

tsteur commented Mar 24, 2020

@limitstudios I suppose you had a look at https://matomo.org/faq/troubleshooting/faq_183/ already?

Otherwise be good to try the latest release which fixes possibly server gone away in core:archive but not in climulti:request. We are seeing these in core archive as well but it's not trivial. They can happen in climulti:request should the archiving take very long. Eg you have a very long running query (for hours) etc. That be the case if you have a high traffic website. You could maybe choose to ignore them as the next archive might succeed. I know it's not ideal but be only a real problem if the data would not be archived at all (never).

I'll close this as a duplicate of #13717 and #7669

We might be looking into this issue again as we are having these issues as well but it's not a priority right now for us unfortunately.

@tsteur tsteur closed this as completed Mar 24, 2020
@tsteur tsteur reopened this Mar 24, 2020
@tsteur
Copy link
Member

tsteur commented Mar 24, 2020

Sorry was just reading again that this happens on a regular request on Visits over time. I thought it was during archive after reading the comments.

@tsteur
Copy link
Member

tsteur commented Mar 24, 2020

Is there a segment applied? Is segment archiving through browser disabled? If not, that could be a reason.

@millnut
Copy link
Author

millnut commented Mar 24, 2020

nope this is the "Visits over time" widget on the dashboard view. No segments applied and archiving through browser disabled

@millnut
Copy link
Author

millnut commented Mar 24, 2020

on PHP 7.2 it seems to error with MySQL gone away and shows the standard red error message saying contact site administrator

@tsteur
Copy link
Member

tsteur commented Mar 24, 2020

Can you double check all the settings are changed as mentioned on https://matomo.org/faq/troubleshooting/faq_183/ ?

I wouldn't be able to give you any starting point otherwise. It could be some other MySQL setting that is causing it. It's weird though it only happens there. Maybe try with playing some Matomo UI settings to maybe find some pattern. Like does it work when the limit in the evolution graph is less, does it work when viewing day or week or month, ...

@millnut
Copy link
Author

millnut commented Mar 25, 2020

hi @tsteur yep I've done what I can on those as it's shared hosting, are there any pointers on where to look around? As soon as I roll back to PHP 7.1 it's fine. I'll try upgrading to PHP 7.3 later incase it's a edge case bug in PHP 7.2

@tsteur
Copy link
Member

tsteur commented Mar 25, 2020

@limitstudios sorry I wouldn't know where to point to. Basically, it might just be a configuration issue. Maybe some issues could be avoided with code by catching an exception and retrying the query but you'd need to check if it's always failing with the same query. For example you'd want ideally to enable slow query log for example to see if there are some long running queries but I suppose on shared hoster you might not be able to?

@scottix
Copy link

scottix commented Apr 8, 2020

I posted on the forum about a issue we are having https://forum.matomo.org/t/visitors-overview-slow/36779

The dashboard widget is fine but the Visits Overview times out on large ranges.

Yes I do have cron job setup.

@Findus23
Copy link
Member

I have now changed #15451 to collect all information about this "Mysql has gone away"-happens-more-often-with-php7.2-issu.

I hope it is okay for you if we close this in favor of #15451.

@Findus23 Findus23 added the duplicate For issues that already existed in our issue tracker and were reported previously. label Apr 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate For issues that already existed in our issue tracker and were reported previously.
Projects
None yet
Development

No branches or pull requests

5 participants