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
API call Contents.getContentNames randomly buggy #15628
Comments
Random thought here.
I haven't tried to reproduce this. Looking at the code we would use the most recent invalidated archive though because of https://github.com/matomo-org/matomo/blob/3.13.3/core/DataAccess/Model.php#L243 and https://github.com/matomo-org/matomo/blob/3.13.3/core/DataAccess/ArchiveSelector.php#L128-L136 where we should use the first idArchive which is the most recent. Quickly looked into it and would say it almost can't be that. Could be some other race condition as I've never heard of it before. Like not sure if at some point maybe a done flag is written to early for example. @feikede do you know if you have browser archiving enabled? You can see this in Admin -> General Settings. Also for how long is the empty result returned if you know? Like are we talking few seconds here or few minutes? |
@tsteur Thanks for your analysis. As for your questions:
Is it normal to have about 2500 tables in the database? Maybe the matomo-archive.log helps?
I'tt try to track down the next case in detail. |
2500 tables is not quite normal, is it maybe a rather old installation? Possible there was a bug a while ago. Not available for few hours doesn't sound normal. Is in the same time the result not available in the UI either? |
Ah, sorry, it's only 107 tables, I looked at the wrong number. |
Thanks @feikede . Is there maybe any caching active in your server set up or so? I'm asking because the UI is also just using the API and I can't think of a reason why the UI should be showing data while the API doesn't. Not sure what your server setup looks like or if your webserver sends maybe some caching headers. |
No, there's no caching, it's a plain matomo LAMP install on CentOS 7.7. I have another case today (exactly now): returns empty array [], while
returns
and
returns
while
The UI shows 2 Impressions on 3.3.20 (4.3 is missing here, and no impr. before march) - and it's totally different from above's "label":"anwalt:2695","nb_visits":10,"nb_impressions":12 So in summary, this seems pretty useless. Do you know what's the suggested way to count content impressions and API-report them in matomo? |
@sgiehl @diosmosis maybe any idea right away how UI and API might report different results? |
@feikede Does this only happen with dates that include today? Or does it happen w/ earlier dates? Does this affect the export link provided by the UI as well? Does it only affect ranges? @tsteur I don't know why the UI would and API would report different results, seems very strange, but seems likely related to range archiving in some way. |
Today @diosmosis While @diosmosis How should I test the "export link" issue? |
btw: |
@feikede at the bottom of each graph there is an icon that can be used to get an API URL for a report: clicking on it would show: The link it generates should be directly to the API, I'm wondering if this feature is broken for you as well for content reports.
It very well could be, though it's still extremely strange, and I'm not immediately sure what could be causing it. |
Today, on 2020-03-31, I have the following buggy behavior:
etc. I give up using this now, it's not reliable. Thanks for your help |
Sorry to hear @feikede . We would be maybe able to have a look should we have full server access (incl db) but otherwise this be hard to identify the issue. We can't possibly imagine how this is happening since Matomo uses the same API's in the reporting UI as well. It does somehow suggest there is some issue somewhere else in the server setup but of course there could be also just as well be some edge case issue in Matomo. |
Think i have similar issue with 3.14.1:
Note on empty "actions" column But with this
Note on As I can see, a call method |
Or it's just something like a mess in column names in report UI (i.e. |
fyi replied in #16505 |
This call randomly returns an empty [] json. I.e. currently:
/?method=Contents.getContentNames&label=anwalt%3A6122&date=2020-01-01,today&period=range&format=JSON&module=API&idSite=1&format=JSON&token_auth=93e...384
returns [] with headers
While the exact same call with segmentation by label returns a (the correct) result:
/?method=Contents.getContentNames&segment=contentName==anwalt%3A6122&label=anwalt%3A6122&date=2020-01-01,today&period=range&format=JSON&module=API&idSite=1&format=JSON&token_auth=93e...
Think this is a bug, or am I missing something?
BTW: This seems to be related to any kind of caching. Sometimes the call WITH segmentation delivers wrong results - sometimes without - and sometimes it's all gone one day later (have the cron running every hour, have about 10K req/day). Have latest V 3.13.3 installed.
The text was updated successfully, but these errors were encountered: