@bobivass opened this Issue on June 25th 2019

I have a Goal named "Payable Link Clicked", which is triggered when "Click on a Link to an external website" matches some pattern.
For several days now, in Visitors/Visits log, as well as in Dashboard/Visits in Real-time, this Goal appears on top of the Actions of most of the visitors, with a different (old) date. Check the screenshot, please.
As you can see the visitor log is from June 25, 2019, and the first action is "Payable Link Clicked", with the date Nov 23, 2018.
Can anyone help me with this bug?

@tsteur commented on June 26th 2019 Member

Are you using the latest version of Matomo? Can you try to convert this goal yourself and see if it shows the correct date afterwards?

@bobivass commented on June 26th 2019

I'm using the latest version, I think - Matomo version: 3.9.1
What do you mean by "try to convert this goal yourself"?

@tsteur commented on June 26th 2019 Member

I meant could you trigger this goal, aka perform the steps needed so this goal is converted and appears in the visitor log. And then check the time. Or is this for all visits?

@bobivass commented on June 26th 2019


It is for many of the visits. All Actions "Payable Link Clicked" (in red borders) are with the date Nov 25, 2018.
Sometimes there are several Actions "Payable Link Clicked", not just one.

@tsteur commented on June 26th 2019 Member

We can't reproduce this here. Are you using any third party plugins (plugins that are not from Matomo, InnoCraft / premium feature)? What timezone is your site set to (you can see in Administration => Sites => Manage)?

We might need access to your database to have an idea how this happens, would that be possible?

@bobivass commented on June 26th 2019

No, I'm not using any third party plugins.
TIME ZONE: Bulgaria
Yes, it is possible. What do you need for this, and where to send the info?

@tsteur commented on June 26th 2019 Member

You could send us an email with credentials to hello at matomo.org.

@bobivass commented on June 26th 2019

Credentials just sent.

@tsteur commented on June 27th 2019 Member

Tracked values seem to be stored correctly. Might be a server issue or something in our code. @sgiehl do you remember any changes on this recently maybe?

@bobivass did this only start recently? Have you changed anything on the server maybe?

@tsteur commented on June 27th 2019 Member

Thanks for your recent email.
There is definitely something wrong see
<serverTimePretty>Nov 26, 2018 18:23:00</serverTimePretty><timestamp>1543256580</timestamp> for a goal,

and <serverTimePretty>Jun 27, 2019 10:40:59</serverTimePretty><timestamp>1561632059</timestamp> for a regular action.

Interestingly there is actually a wrong date tracked for this visit:

So maybe it's a problem with the tracking code or so. Do you use the JavaScript tracker @bobivass ? It's a bit funny it works for some, but broken for some others. Do you customise the tracker in any way?

@tsteur commented on June 27th 2019 Member

Also have you adjusted any configs in config/config.ini.php? For example to increase the visit time?

@tsteur commented on June 27th 2019 Member

FYI: For this visitor the first action time is 2019-06-27 07:40:59 and last action time is 2019-06-27 08:28:55 so seems all normal.

@bobivass commented on June 27th 2019

The only thing I added in config/config.ini.php is force_ssl = 1

I'm using JS tracker, but I'm using it since I installed Matomo, and there was no problem. The issue started on June 21, 2019.
Here is the tracking code I have:

<!-- Matomo -->
<script type="text/javascript">
  var _paq = _paq || [];
  /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
window.addEventListener('load', function() {
    var u="https://www.mysite.com/st/";
    _paq.push(['setTrackerUrl', u+'piwik.php']);
    _paq.push(['setSiteId', '1']);
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
    g.type='text/javascript'; g.async=true; g.defer=true; g.src='https://www.mysite.com/st/piwik.js'; s.parentNode.insertBefore(g,s);
<!-- End Matomo Code -->
@tsteur commented on June 27th 2019 Member

In theory recording a token > 1 day would actually require a token so not quite sure how this happens. Do you have multiple servers maybe and one server randomly has a wrong date set?

@bobivass commented on June 27th 2019

No, just one server.

@tsteur commented on June 28th 2019 Member

@Findus23 maybe any thoughts how this could happen? Seems like time() randomly returns a different value which doesn't seem possible. Haven't heard anything like it before so suspecting some server issue as code for these things seems quite straight forward.

@bobivass commented on June 28th 2019

Not sure if it is related to this issue, but on May 20, 2019, I had a database problem, here is the error message I got:
SQLSTATE[42S02]: Base table or view not found: 1932 Table 'thumbsy_matomo.matomo_log_visit' doesn't exist in engine
This table was corrupted and my hosting support repaired it.

@bobivass commented on September 3rd 2019

Hi, @tsteur I still have this problem. Any ideas what causes this and how to fix it?

@tsteur commented on September 3rd 2019 Member

Sorry no idea. I suggest you ask in the forums: https://forum.matomo.org

I searched for 1932 Table doesn't exist in engine and there might be some solutions coming up. Give it a try maybe

@bobivass commented on September 4th 2019

@tsteur I have new findings. Please, check this:


In the table matomo_log_link_visit_action there are the same idvisit for two completely different dates - 2019-05-26 and 2019-09-04. I hope this will help your team to discover the problem.

@tsteur commented on September 4th 2019 Member

thanks for the screenshot @bobivass I've noticed this in the past as well yet cannot explain how this can possibly happen. I'm really at the end of my wisdom here. I'm hoping someone else has an idea

@bobivass commented on September 5th 2019

Thank you @tsteur for your efforts, I appreciate them.
Finally, I found the problem and fixed it.
After repairing the matomo_log_visit table, the auto-increment of the idvisit column started from 0. But there are the same idvisit in the table matomo_log_link_visit_action already.
So, I run this sql line:
Where the N is the last value of the idvisit column in matomo_log_link_visit_action.

@tsteur commented on September 5th 2019 Member

That explains it. Thanks for letting us know 👍 Would have never thought of this.

This Issue was closed on September 5th 2019
Powered by GitHub Issue Mirror