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

Recent 4.3.1 Upgrade. Getting Date format must be: YYYY-MM-DD, or 'today' or 'yesterday' or any keyword supported by the strtotime function #17796

Closed
jbrule opened this issue Jul 19, 2021 · 13 comments · Fixed by #17801
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@jbrule
Copy link

jbrule commented Jul 19, 2021

Upgraded from 3.13.6 -> 4.3.1

I recently upgraded to 4.3.1 and most things are working well. I am however getting the following error when querying monthly Time states for some sites. FYI. The the initial archive after upgrade is still running (via cron). Other sites works for this particular time frame. Any tips?

Date format must be: YYYY-MM-DD, or 'today' or 'yesterday' or any keyword supported by the strtotime function (see http://php.net/strtotime for more information):

I see some NULL visitor_localtime entries in my log_visit table but it is not consistent as those sites doesn't error out when retrieving the report

Matomo-4 3 1 Error
Matomo Diagnostics

@jbrule
Copy link
Author

jbrule commented Jul 19, 2021

This is in the logs

ERROR CoreHome[2021-07-19 17:49:54 UTC] [591e0] Failed to get data from API: /apps/apache/www/production/matomo/core/Date.php(1126): Date format must be: YYYY-MM-DD, or 'today' or 'yesterday' or any keyword supported by the strtotime function (see http://php.net/strtotime for more information):
WARNING CoreHome[2021-07-19 18:56:16 UTC] [3b902] /apps/apache/www/production/matomo/plugins/VisitTime/functions.php(18): Warning - mktime() expects parameter 1 to be integer, string given - Matomo 4.3.1 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already) [internal function]: Piwik\ErrorHandler::errorHandler(),#1/plugins/VisitTime/functions.php(18),#3/core/DataTable/Filter/ColumnCallbackReplace.php(96),#4/core/DataTable.php(528),#5/core/DataTable.php(613),#6/core/API/DataTablePostProcessor.php(303),#7/core/API/DataTablePostProcessor.php(133),#8/core/Plugin/Visualization.php(536),#9/core/Plugin/Visualization.php(193)

@diosmosis
Copy link
Member

diosmosis commented Jul 20, 2021

Hi @jbrule can you apply this PR: https://github.com/matomo-org/matomo/compare/17796-debugging?expand=1 and trigger the error again? It will hopefully provide some more details.

@jbrule
Copy link
Author

jbrule commented Jul 20, 2021

unable to parse date label:

matomo-parse-label

@diosmosis
Copy link
Member

@jbrule I'm not sure why the label is empty there, they should be predefined... I've updated the branch: https://github.com/matomo-org/matomo/compare/17796-debugging?expand=1 . Can you apply the changes then post a screenshot of the report that is created (preferably in the table view)?

@jbrule
Copy link
Author

jbrule commented Jul 20, 2021

matomo-time-table

@diosmosis
Copy link
Member

@jbrule looks like you've got a visit with no local time data... can you check the log_visit table for a visit where visitor_localtime IS NULL AND idsite = ? AND visit_last_action_time >= ? AND visit_last_action_time < ? substituting the idSite and start and end time for the period you're looking at? For example:

SELECT * FROM log_visit WHERE visitor_localtime IS NULL AND idsite = 1 AND visit_last_action_time >= '2021-06-20 00:00:00' AND visit_last_action_time < '2021-06-21 00:00:00';

@jbrule
Copy link
Author

jbrule commented Jul 21, 2021

SELECT COUNT(*) FROM piwik_log_visit WHERE visitor_localtime IS NULL
5886

@diosmosis
Copy link
Member

@jbrule I've created a PR to handle the NULL values you're having: #17801 . But you may want to look into why there are NULL values there, as the PHP tracker code doesn't allow the column to be NULL.

@diosmosis diosmosis added the Bug For errors / faults / flaws / inconsistencies etc. label Jul 21, 2021
@jbrule
Copy link
Author

jbrule commented Jul 21, 2021

Looks like these happened around the time of upgrade. It's a pretty small number of the whole so I'm just going to purge them and invalidate the archive for the day.

@jbrule
Copy link
Author

jbrule commented Jul 21, 2021

I neglected to disabled Redis Queue processing and some went through. I intended for everything to queue up in Redis until DB schema update was complete.

@tsteur
Copy link
Member

tsteur commented Jul 21, 2021

@jbrule does this mean the issue is resolved now?

@jbrule
Copy link
Author

jbrule commented Jul 21, 2021

@jbrule does this mean the issue is resolved now?

Yes

@jbrule jbrule closed this as completed Jul 21, 2021
@tsteur tsteur added answered For when a question was asked and we referred to forum or answered it. and removed Bug For errors / faults / flaws / inconsistencies etc. labels Jul 21, 2021
@tsteur
Copy link
Member

tsteur commented Jul 21, 2021

great, thanks for letting us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants