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

Error in "Database Usage" usage ... #5253

Closed
anonymous-matomo-user opened this issue May 27, 2014 · 13 comments
Closed

Error in "Database Usage" usage ... #5253

anonymous-matomo-user opened this issue May 27, 2014 · 13 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@anonymous-matomo-user
Copy link

"PIWIK 2.3.0" -> "Settings" -> "Database Usage" show this error:

Key "1" for array with keys "0" does not exist in "@CoreVisualizations/_dataTableViz_tagCloud.twig" at line 1

@anonymous-matomo-user
Copy link
Author

Attachment:
PIWIK2.3.0_db_usage_error.png

@tsteur
Copy link
Member

tsteur commented May 28, 2014

In cd2ec82: refs #5253 this might fix the database usage error. It definitely fixes nothing is displayed once you change a column in the graph charts since it does not support them. The summary configuration was never applied due to a typo.

@tsteur
Copy link
Member

tsteur commented May 28, 2014

This was a hard one so far... Found a typo which might fix your issue but couldn't exactly reproduce it. Now waiting to see if this change breaks anything. Can you maybe test the next beta release?

@mattab
Copy link
Member

mattab commented May 30, 2014

@Hornbeam can you please test with Piwik 2.4.0-beta that was just released? http://builds.piwik.org/?C=N;O=D

@anonymous-matomo-user
Copy link
Author

This is a good fix (with fixing the typo and adjusting the arrays) but does not fix this bug. We are seeing the same thing on Referrers -> Websites & Social for one user (the social guy of course).

@anonymous-matomo-user
Copy link
Author

The error is coming from the template processing system. The file in question here is plugins/CoreVisualizations/templates/_dataTableViz_tagCloud.twig.

On line 1 of this file, we have:
{% set cloudColumn = properties.columns_to_display[1] %}

So the error is occurring because we are trying to call element 1 from the array of 0 elements. Why it is zero is still the question.

@anonymous-matomo-user
Copy link
Author

The real issue here was that the user modified their configuration.

Just to be clear, I have installed the patches above in the system. However, this does not solve the problem. To solve the problem, I also did the following:

In piwik_option table, there are entries for the user like:

 viewDataTableParameters_john_Referrers.getCampaigns = {"isFooterExpandedInDashboard":true,"viewDataTable":"tableAllColumns","rows":[],"rows_to_display":[]}
 viewDataTableParameters_john_Referrers.getSocials = {"columns_to_display":["nb_conversions"],"rows":[],"rows_to_display":[],"isFooterExpandedInDashboard":true,"viewDataTable":"cloud","filter_sort_column":"nb_visits"}
 viewDataTableParameters_john_Goals.getEvolutionGraph = {"columns":["nb_conversions","revenue"],"columns_to_display":["nb_conversions","revenue"],"rows":[],"rows_to_display":[]}

I removed these since "rows_to_display" were empty.

The system was also generating a twig file in /tmp/templates_c/XX/YY/{token_auth}.php which persisted the error. The token_auth is from the piwik_user table for the specific user.

Once I applied the patch, removed the user option, and then removed the tmp file, the system is back to normal.

@mattab
Copy link
Member

mattab commented Jun 7, 2014

Good to know it worked!

@anonymous-matomo-user
Copy link
Author

I checked every single update since my post. No single patch solved this issue including "piwik 2.4.0" . So I investigated and found that following mysql statement erases wrong options from database:

delete
from piwik_option
where
option_name like '%DBstats%' and
option_name like '%USER%' ;

USER in sql statement is user with display problems. Afterwards everything reseted to normal state.

I hope that this helps someone ...

@mattab
Copy link
Member

mattab commented Jul 3, 2014

@Hornbeam if you can reproduce a bug in 2.4.0, please create a new ticket as we will definitely want to fix it! thanks

@tsteur
Copy link
Member

tsteur commented Jul 6, 2014

I'm reopening this one as the reported bug was actually never fixed. I mentioned in my comment that I don't know whether it fixes the issue or not and that we wait for this feedback. Thx for letting us know hornbeam. I appreciate your research.

@anonymous-matomo-user
Copy link
Author

Dear All,

I just tried to reproduce error. I installed 2.4.0 and deleted problematic recordd with upper mentioned sql statement. Afterwards I can not reproduce same error any more. Basically error occurred (at least in my case) at random clicking and changing layout of upper left "Database usage" report. I tried about 3 minutes with all possible combinations in version 2.4.0 and now is stable. I may conclude, that this happens (at least what I recall from my memory more is is in "trac"):

  • I always use beta versions.
  • Piwik is installed on dedicated virtual machine, with dedicated IP.
  • I perform full backup of VM on daily basis.
  • I believe that at some point there was typo error in code during one of beta versions,
  • I installed that beta version and played around with displaying DB stat.
  • That probably introduce some unwanted content in DB that caused this error.
  • I believe that interpretation of records in DB caused this error.
  • Now code is stable and I can not reproduce behavior again.

What confuses me is fact, that some other users have same problem and I can not explain why ...

If you really want I can check backup repository for backup and restore that particular VM and dig contents of problematic sql records from DB.

hornbeam

@tsteur
Copy link
Member

tsteur commented Jul 7, 2014

Thanks @ hornbeam. I will close it again and we can reopen it again if you can reproduce. I reckon either the Treemap visualization or the - at that time displayed - metric picker caused it.

The Treemap visualization can still cause a bit of trouble when switching between visualizations although it is better now. For instance in DB stats switching between Treemap and another visualization results in an empty chart but it is no longer persistent (which was before).

Cheers

@anonymous-matomo-user anonymous-matomo-user added this to the 2.4.0 - Piwik 2.4.0 milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

3 participants