matomo-org / matomo-for-wordpress

Get a fully functioning Matomo Analytics for your WordPress. Star us on Github? +1. Matomo is the leading open alternative to Google Analytics that gives you full control over your data. Privacy is built-in. 100% data ownership, no one else can see your data. We love Pull Requests!
https://matomo.org
GNU General Public License v3.0
119 stars 25 forks source link

Troubles with archiving? #812

Closed angie-happytree closed 1 year ago

angie-happytree commented 1 year ago

Hello! A client of mine just noticed, that the matomo-Plugin isn't installed anymore. After checking I saw, that the folder "matomo" is still there, but in the WP-backend the matomo dashboard is missing and also the matomo plugin in the plugin list.

I then renamed the existing matomo-folder and installed matomo newly.

Now I got this error: "There are some errors in the [Matomo Diagnostics System report] that may prevent the plugin for working normally."

I followed this help article: https://matomo.org/faq/wordpress/matomo-for-wordpress-is-not-showing-any-statistics-not-archiving-how-do-i-fix-it/

In “Visits Log” or “Real Time” there is no data from April until today. What I couldn't manage to get was the "Archive Reports" in Troubleshooting. When I click that button nothing happens (also after waiting)

Thank you for any help! Angie.

Here's the system report:

Matomo

Endpoints

Crons

Mandatory checks

Optional checks

Matomo Settings

Logs

WordPress

WordPress Plugins

MU Plugins

Plugins

Server

Database

Browser

enual commented 1 year ago

Hi @angie-happytree. I don't see any error in your system report. However, I can see in your system report says that Supports Async Archiving is blank in the Matomo category.

Can you please try to disable this feature by editing the wp-config.php and adding the following line:

define( 'MATOMO_SUPPORT_ASYNC_ARCHIVING', false );

Please let us know how it goes.

diosmosis commented 1 year ago

Hi @angie-happytree, are you still experiencing this problem?

angie-happytree commented 1 year ago

Hello! Thank you @enual and @diosmosis for your replies and interest. I added the line in the wp-config in July, after your response. Today I looked an still have this error: "Last Successful Archiving Completion | error | Archiving last ran successfully on Wednesday, June 28, 2023 13:09:53 which is 70 days 20:10:36 ago"

Here's the system report again (from today):

Errors

Matomo

Endpoints

Crons

Mandatory checks

Optional checks

Matomo Settings

Logs

WordPress

WordPress Plugins

MU Plugins

Plugins

Server

Database

Browser

angie-happytree commented 1 year ago

And for the record: this is still happening: "Archive Reports" in Troubleshooting. When I click that button nothing happens (also after waiting)

diosmosis commented 1 year ago

@angie-happytree can you describe what happens after clicking "Archive Reports"? The page should briefly reload, which would signify it succeeded (unfortunately there's nothing clearer at the moment).

angie-happytree commented 1 year ago

Ok, yes, that would explain it. It seems like nothing really happenend. So I guess, it worked...?

I have news:

I'm slightly optimistic, that this installation is working again. But I would like to be sure. The client is a NPO/NGO and they have to report visitor numbers to sponsors, so they are quite nervous, and asking if they should switch the analytics tool...

Thank you very much! Angie.

diosmosis commented 1 year ago

@angie-happytree if the recent data's back, then it must be working. For the missing data, can you go to the "Reporting -> Visitors -> Visits Log" page and check if there's data for April 23 - June 23:

image

then

image

then select the range with

image

?

If there are visits there, then yes you will be able to get reports for that data. If there's nothing there, then that means no visits were tracked.

If the tracking code on the site was working during that time, and tracking requests were sent to Matomo, but Matomo for some reason wasn't able to record them, then it might be possible to get the data back into Matomo, though it would be complicated. Otherwise, there's just no data to retrieve.

Please let me know what you find!

angie-happytree commented 1 year ago

Thank you, no there are no visits in this period of time...

Now I got this error 3 times in the Matomo Dashboard: "Oops… there was a problem during the request. Maybe the server had a temporary issue, or maybe you requested a report with too much data. Please try again. If this error occurs repeatedly please contact your Matomo administrator for assistance."

In the meantime it worked, but the this error occured again.

diosmosis commented 1 year ago

@angie-happytree

no there are no visits in this period of time...

If there are no visits in the Visits Log then there's no data in Matomo to recover. If the matomo plugin was deactivated for the client during that time, then no tracking would have been done.

The only other option would be to track data from web server logs using the Matomo log importer, but that is a complicated process. If you can get access to the webserver logs for your client's website (by asking your hosting provider for example), and are comfortable running commands from a command line then I can try to help you with the process (you can see the documentation here: https://matomo.org/guide/tracking-data/import-server-logs/ ). Otherwise the data is unfortunately not recoverable.

Now I got this error 3 times in the Matomo Dashboard: ...

This error can also occur briefly right before switching pages (in which case you can ignore it). Does the entire dashboard load properly?

If you can open the developer tools (right click the page and select "Inspect") and switch to the network tab, there should be some items in red, one of these would be the cause. If you are able to find these, and can send a screenshot of them, that would help in finding the cause.

angie-happytree commented 1 year ago

Hello! Thank you, the hosters logs for this period are unfortunately deleted by now. But thank you! We will deal with this missing data. The hostings support activated serverside cron jobs (this morging), so that matomo can do it's jobs in the background. > is this a good thing?

But... Ok, I'm really getting frustrated. When I look at the summary now, there are again no records of data from last Friday until today. How can that be? I use Matomo on many sites and never ran into this kind of problems. The client is a NPO and they need the data for reporting to sponsors... They also want to know if there are alternatives to matomo.

The external matomo dashboard does not load properly right now. It just doesn't load, when I enter e.g a random period of time. Then there was the former described error again and now just "504 Gateway Time-out".

To your question: In the wordpress matomo dashboard, the network tab in developer tools shows an error concerning the admin-ajax.php > NS_BINDING_ABORTED

I hope you can use this info and have a solution for me here, that matomo runs steadily again.

Thank you, Angie.

angie-happytree commented 1 year ago

These are other errors my hoster's support found: 2023/09/12 11:17:06 [error] 1743808#1743808: *1524465 FastCGI sent in stderr: "PHP message: PHP Warning: Attempt to read property "object" on bool in /home/wp/disk/wordpress/wp-content/themes/generatepress_child/functions.php on line 84;

PHP Fatal error: Cannot redeclare get_blog_option() (previously declared in /home/wp/disk/wordpress/wp-content/plugins/buddypress/bp-core/bp-core-wpabstraction.php:57) in /home/wp/disk/wordpress/wp-includes/ms-blogs.php on line 381

Can php 8.2 cause matomo problems? Or could there be a conflict between these themes/plugins?

diosmosis commented 1 year ago

@angie-happytree I won't be able to answer fully until tomorrow as its pretty late where I am, but for the time period where there is no data again, can you check in the Visits Log in the Reporting page? (assuming you can get to it). If you can post screenshots that might also be helpful.

Regarding the errors you posted, these appear to be due to other wp plugins with the slugs generatepress_child and buddypress. They dont appear related to Matomo.

Can you provide the name of the hosting provider? And is this hosting provider the same as the websites where everything is working with matomo? And is the amount of traffic this website experiences more than the others?

Regarding serverside cron, I'm not really sure. They'd have to be more specific about what exactly they did...

The 504 gateway timeout (coupled with the earlier dashboard error) would suggest the some limits are being hit with the hosting provider. As an alternative to Matomo for Wordpress which embeds Matomo in wordpress, you may want to consider Matomo Cloud which is managed by the Matomo team so you wouldn't have to deal with server administration or problems with variable hosting envieonments (though I don't know if this fits your needs and it does cost a monthly fee).

I am sorry this is so frustrating.

angie-happytree commented 1 year ago

Thank you very much, and sure, I can wait until tomorrow!!

The hosting provider is raidboxes.de These are the cronjobs the hosting provider activated: matomo_scheduled_archive, matomo_scheduled_sync, matomo_scheduled_geoipdb

Yes I have sites at this hosting provider, with Matomo working. And they also recommend Matomo.

Here is what I see, when I want to check the visits Log: Bildschirmfoto 2023-09-12 um 11 52 28

The site runs on php 8.2. Could this cause problems?

Thank you for pointing out matomo cloud. 19€/month will be too much, I fear.

Have a good evening! Angie.

diosmosis commented 1 year ago

@angie-happytree can you answer the question about the general amount of traffic the site gets?

Regarding the cron entries: these might mean something to the hosting provider, but it's not enough information for me. Can you ask them what specific commands they are running? Also there may have been some miscommunication with the hosting provider, Matomo and "Matomo for Wordpress" are related, but two different products. It's possible changes made by your hosting provider are causing your new problems.

Running php 8.2 shouldn't cause these problems.

diosmosis commented 1 year ago

@angie-happytree one thing that may help is asking your hosting provider to remove the cronjobs they created and ask if they can instead run the wordpress cron. Matomo for Wordpress hooks into the wordpress cron to do its archiving.

angie-happytree commented 1 year ago

Hello! So status on this topic is: In the visitor logs the data is present, so the tracking must have worked in the last week. > yeah! BUT: the data is not transferred to the wordpress dashboard. What can that cause? And how can I bring it into the dashboard? thank you, Angie.

diosmosis commented 1 year ago

@angie-happytree Please provide an updated copy of the system report on the diagnostics page. And were there any changes made by the hosting provider since last time you commented here?

angie-happytree commented 1 year ago

Hello! The provider says, they don't use own cronjobs, but the WP-cron. They just changed the time it was triggered (from 1 minute to 5 minutes). Just for your info "define( 'DISALLOW_FILE_EDIT', false );" is still active in the wp-config.php

Here's the system report:

Errors

Matomo

Endpoints

Crons

Mandatory checks

Optional checks

Matomo Settings

Logs

WordPress

WordPress Plugins

MU Plugins

Plugins

Server

Database

Browser

angie-happytree commented 1 year ago

The Support of my hosting provider suggested, that I give you access to the wordpress dashboard. Are you willing to have a look at the installation?

angie-happytree commented 1 year ago

Created a user for you. Let me know, if it worked and if you can find out something. Thank you so much for this!! Angie.

diosmosis commented 1 year ago

@angie-happytree Email received, I'll get back to you when I find something.