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

Transitions & Page Overlays not working on one page, but working on others #4595

Closed
OverZealous opened this issue Jan 30, 2014 · 19 comments
Closed
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@OverZealous
Copy link

Transitions and page overlays are not working on one of my pages, but they are working on others. I get the message "Either the action had no pageviews during the period or it is invalid."

There is no real difference between the pages, they are all articles in a Tumblr blog.

The broken page has over 700 views, while the working pages only have around 50 views.

The only noticeable difference I can see between them is the title: the broken page contains parentheses and the working ones do not. Besides that, the broken page is newer, while the ones that work have been in the system for much longer.

Sorry I can't provide more information. Let me know if there's a way I can run some tests or queries against the DB to help narrow this down.
Keywords: transitions

@OverZealous
Copy link
Author

Attachment: Screenshot of message
Screen Shot 2014-01-30 at 10.03.21 AM.png

@mattab
Copy link
Member

mattab commented Feb 1, 2014

Thanks for the report. What was the exact page names of the not working page?

@mattab
Copy link
Member

mattab commented Feb 1, 2014

Consolidating milestones FTW

@OverZealous
Copy link
Author

The broken page is titled:

OverZealous Creations: The Blog - Why you shouldn't create a gulp plugin (or, how to stop worrying and learn to love existing node packages)

I now am wondering if it's the apostrophe. However, it doesn't matter how I try to open the transitions I can come at the link from Pages or from Page titles and I get the no pageviews message either way.

I've tried looking for a log or something, but I'm not seeing anything in the Apache logs or via Firebug. The Piwik system check is all checkmarks from top-to-bottom. Is there some sort of debug SQL function that can be enabled to see the queries being run?

I've also (just for the heck of it) restarted both MySQL and Apache.

@freelock
Copy link

freelock commented Feb 8, 2014

I'm experiencing this issue too -- many pages on my site have transition data, but lots of them don't, including the home page -- http://www.freelock.com. The home page does have an exclamation point in the title, but other pages that are broken have no unusual punctuation -- http://www.freelock.com/freelock-blog

... meanwhile, a lot of other pages show transitions just fine.

I think this used to work before Piwik 2.0 -- this is the first time I've actually looked since then.

@freelock
Copy link

freelock commented Feb 8, 2014

Also, the same pages that do not load transitions, do not show link info in the overlay.

@diosmosis
Copy link
Member

@matt I see this bug (or a similar bug) here: http://demo.piwik.org/index.php?module=CoreHome&action=index&idSite=1&period=day&date=yesterday#module=Actions&action=indexPageUrls&idSite=1&period=day&date=2014-03-07&popover=RowAction$3ATransitions$3Aurl$3Ahttp$3A$2F$2Fdemo.piwik.org$2Findex.php$3Fmodule$3DCoreHome$26action$3Dindex$26idSite$3D7$26period$3Dday$26date$3D2014-03-06$23module$3DDashboard$26action$3DembeddedIndex$26idSite$3D7$26period$3Dday$26date$3D2014-03-06$26idDashboard$3D1

It is caused by sanitization in TableLogAction::getIdActionFromSegment. Action names are stored unsanitized, but getIdActionFromSegment will search for the sanitized version. So any action w/ an '&' or similar will result in No Data.

Not sure what the appropriate fix is, but I've reproduced in UI tests (and it can be reproduced in integration tests).

@OverZealous
Copy link
Author

@capedfuzz Thanks for doing research into this! Hopefully this can lead to a fix.

@mattab
Copy link
Member

mattab commented Mar 9, 2014

Nice find! Increasing priority

@OverZealous OverZealous added this to the 2.x - The Great Piwik 2.x Backlog milestone Jul 8, 2014
@mattab mattab removed P: low labels Aug 3, 2014
@OverZealous
Copy link
Author

I figured out the actual cause of this bug for me!

Short answer: there are (were) duplicate rows in the log_action table with the same URL, hash, etc.

I have no idea how these duplications occurred, but due to using \Piwik\Db::fetchOne, which actually returns an error if there are duplicate rows, the Transitions and Page Overlay plugins were unable to find the ID of the action.

The only solution is to determine which id is "correct" (mine was the second ID, as the first only had one visit associated with it) and delete the other.

I don't know if this should be something that is addressed by Piwik or what. Again, not sure how it happened in the first place, although it might be an issue with simultaneous visits causing database corruption. A proper UNIQUE constraint across the hash field would prevent this from happening in the future, but the broken tables will need to be cleaned up first.

I also have no idea what sort of problems are going to occur by simply deleting the duplicate actions.

@freelock
Copy link

freelock commented Sep 6, 2014

Hi,

Haven't had any time to look at the code, but I can confirm that my database has lots of duplicate rows in log_action, aside from the idaction column.

My log_action table has 146621 rows, with 141743 unique hashes, and 1111 individual hashes with multiple rows.

@mattab mattab modified the milestones: Short term, Mid term Sep 8, 2014
@mattab mattab modified the milestones: Piwik 2.9.0, Short term Oct 22, 2014
@mattab
Copy link
Member

mattab commented Oct 28, 2014

If I understand correctly there are two separate issues that may cause the "Transitions no data" bug

  1. sanitization in TableLogAction::getIdActionFromSegment. Action names are stored unsanitized, but getIdActionFromSegment will search for the sanitized version. So any action w/ an '&' or similar will result in No Data. See comment Transitions & Page Overlays not working on one page, but working on others #4595 (comment)
  2. duplicate entries in log_action table. This bug is covered in this other issue: duplicate entries in piwik_log_action leading to pages not visible in segments #6436

@integrationtester
Copy link

re:overzealous

you can't just delete the 'duplicate' entries, you have to merge them:

select idaction,name,count(*) from piwik_log_action as action, piwik_log_link_visit_action as linker where linker.idaction_url_ref=action.idaction group by action.idaction order by name;

for each of the names which have multiple idactions:
(in my case i had upwards of 10 ids for the same url)

say i have multiple idactions: 63,90,134,213,180

update piwik_log_link_visit_action set idaction_url_ref=63 where idaction_url_ref in (90,134,213,180);
update piwik_log_link_visit_action set idaction_url=63 where idaction_url in (90,134,213,180);
delete from piwik_log_action where idaction in (90,134,213,180);

@tsteur
Copy link
Member

tsteur commented Nov 10, 2014

I had a look re this issue but don't know how to fix it. As it was mentioned earlier this seems to be the problem for actions containing eg a &: https://github.com/piwik/piwik/blob/master/core/Tracker/TableLogAction.php#L175-175

Before $valueToMatch is eg ?r=4&545=45 afterwards it is ?r=4&545=45. Not sure what the best way is to fix it as there seems something to be wrong in general.

mattab added a commit that referenced this issue Nov 11, 2014
…ored sanitized. There is some inconsistency where URLs (Page URLs, Downloads, Outlinks) are stored raw while other action types are stored Sanitized - need to do more tests to check this is enough to fix issue, not sure
@mattab
Copy link
Member

mattab commented Nov 11, 2014

@tsteur I took a loook at it and pushed a fix, which looks like it works on demo2 - maybe you can confirm?

@mattab
Copy link
Member

mattab commented Nov 11, 2014

Ok I mark this as closed for now, but please re-open the issue or comment in case any issue re-occurs. Upgrade to 2.9.0-b9 which contains the hopefully complete fix! http://piwik.org/faq/how-to-update/faq_159/

@mattab mattab closed this as completed Nov 11, 2014
@freelock
Copy link

Hi,

Would this fix affect existing data, or only new data going forward?

I installed 2.9.0-b9, but I'm still getting "There's no data..." on the same set of pages that previously had the issue. Is there a data cleanup step? Some of the busiest pages on my site are affected...

@tsteur
Copy link
Member

tsteur commented Nov 11, 2014

@mattab it is fixed but don't know if it causes any side effects

@freelock It works with existing data

@mattab
Copy link
Member

mattab commented Nov 12, 2014

@freelock this issue is not completely fixed actually because there is also this other bug in #6436

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

6 participants