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

Visitors > Locations produces 500 error on POST for idSite=2 #19955

Closed
courtens opened this issue Nov 6, 2022 · 10 comments
Closed

Visitors > Locations produces 500 error on POST for idSite=2 #19955

courtens opened this issue Nov 6, 2022 · 10 comments
Labels
answered For when a question was asked and we referred to forum or answered it. Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users.

Comments

@courtens
Copy link

courtens commented Nov 6, 2022

I have 5 sites in Matomo, but site ID 2 is always producing a 500 POST error on the page Visitors > Locations.

image

And, also, for almost always, on Dashboard > Visits in real-time

image

Warning: the module=Live&action=widget&widget=1&disableLink=0&idSite=2&period=range request failed!

Uncaught (in promise)
Object { readyState: 4, getResponseHeader: getResponseHeader(a), getAllResponseHeaders: getAllResponseHeaders(), setRequestHeader: setRequestHeader(a, b), overrideMimeType: overrideMimeType(a), statusCode: statusCode(a), abort: abort(a), state: state(), always: always(), then: then(), … }

I did notice that if I reduce the date range to fewer days:
image

The error goes away on Visitors > Locations; but it is back, with a normal range; such as:

image

Please note that I am not getting this error with any of the other sites!

This link provides further information https://forum.matomo.org/t/oops-there-was-a-problem-during-the-request-failed-to-write-cache-file/47390/21

@courtens courtens added the Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. label Nov 6, 2022
@peterhashair
Copy link
Contributor

@courtens I read the original forum, and it seems like this is caused by a tracking URL containing special/broken characters. It may be the same issue #18763

@MatomoForumNotifications

This issue has been mentioned on Matomo forums. There might be relevant details there:

https://forum.matomo.org/t/oops-there-was-a-problem-during-the-request-failed-to-write-cache-file/47390/22

@peterhashair
Copy link
Contributor

ping @sgiehl any suggestion on that one?

@sgiehl
Copy link
Member

sgiehl commented Nov 10, 2022

I haven't read the forum post in detail. Might be helpful to get the exact response content of the failing request (if any) or maybe a error message from the error log. Otherwise it's hard making a guess where the problem is.

@peterhashair peterhashair added Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users. and removed Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. labels Nov 16, 2022
@courtens
Copy link
Author

courtens commented Nov 21, 2022

Without chasing after error-logs I just ran across the use of a Zero-width-space (​) in the code. Maybe using such a character in the title is what is tripping out matomo.

@sgiehl
Copy link
Member

sgiehl commented Nov 22, 2022

@courtens I've tested tracking a zero width space locally, and for me that works without issues. Visits log is showing the visit correctly.

@courtens
Copy link
Author

courtens commented Dec 16, 2022

I found this in my error logs (not sure if it is related)

[12-Dec-2022 16:26:24 UTC] [www.site.ch] Error in Matomo (tracker): Error query: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\xC3' for column piwik.piwik_log_link_visit_action.idpageview at row 1 In query: INSERT INTO piwik_log_link_visit_action (idvisit, idsite, idvisitor, idaction_url, idaction_url_ref, idaction_name_ref, server_time, idpageview, pageview_position, time_spent_ref_action, time_dom_processing, time_network, time_server, time_transfer, idaction_name) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) Parameters: array ( 0 => 303944, 1 => 2, 2 => '¿򰰡
÷�', 3 => 85556, 4 => 85556, 5 => 52019, 6 => '2022-12-12 16:26:24', 7 => '1À§ç, 8 => 340, 9 => 1, 10 => 458, 11 => 0, 12 => 23, 13 => 1, 14 => 52019, )

and I am getting a lot of these:

[12-Dec-2022 17:09:23 UTC] [www.site.ch] Error in Matomo (tracker): Invalid idSite: '0'

Opening Visits Log I get

Warning: the module=Live&format=html&forceView=1&viewDataTable=VisitorLog&action=getLastVisitsDetails&small=1&idSite=2&period=range&segment=&widget=&showtitle=1&random=9776 request failed!

@sgiehl
Copy link
Member

sgiehl commented Dec 19, 2022

Hm. The first messages don't seem to be related to the visits log and the last message is not quite helpful.
Did you have a look at the global php / system error log or at the matomo error log (should be located in matomo/tmp/logs/matomo.log)? Maybe any log contains some additional information on the problem.

@courtens
Copy link
Author

courtens commented Dec 19, 2022

it from matomo.log

ERROR Piwik\FrontController[2022-12-19 20:34:26 UTC] [23e8e] Uncaught exception: F:\www\matomo\plugins\Live\templates_actionCommon.twig(25): The string to escape is not a valid UTF-8 string. [Query: ?date=previous30&module=Live&format=html&forceView=1&viewDataTable=VisitorLog&action=getLastVisitsDetails&small=1&idSite=2&period=range&segment=&widget=&showtitle=1&random=1242, CLI mode: 0]

and also

.... Live\templates\getLastVisitsStart.twig(76): The string to escape is not a valid UTF-8 string. [Query: ?date=2022-11-19,2022-12-18&module=Live&action=widget&widget=1&disableLink=0&idSite=2&period=range, CLI mode: 0]

@sgiehl
Copy link
Member

sgiehl commented Dec 21, 2022

Ok. So it seems indeed to be the same problem as #18763. I will close this one as duplicate.
I'm actually not able to reproduce that issue locally. Even when trying to log unsupported characters.
Feel free to comment the other issue with some more details on your set up, maybe it only happens with a certain database or database version.

@sgiehl sgiehl closed this as not planned Won't fix, can't repro, duplicate, stale Dec 21, 2022
@justinvelluppillai justinvelluppillai added the answered For when a question was asked and we referred to forum or answered it. label Jan 12, 2023
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. Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users.
Projects
None yet
Development

No branches or pull requests

5 participants