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
Tons of "General error: 1205" in php error log while importing via the python log importer #16924
Comments
Thanks for creating the issue @adrianlambertz |
Is there a quick fix to disable the timestamp update while using the python log import? Because we are heavily relying on this script - we import logs from about 100 sites every night. Because of this issue the imported statistics arent complete or missing. |
You can change the code so the update isn't done here: matomo/plugins/UsersManager/Model.php Lines 387 to 395 in 1155273
|
Perfect thanks, temporarily commenting out the updateTokenAuthTable function seems to work. I'll try to report tomorrow morning after the import of all sites. |
Have you managed to solve this problem? If yes could please share your change? Thanks! |
|
@adrianlambertz thanks, I have updated code according to @sgiehl pull request, but problem still exists, very poor import speed. |
Hi @L3on1d are there also other queries causing these errors maybe? Is the Provider plugin enabled maybe? |
Provider plugin is disabled. I'm just started another log import, if these errors will appear again, I will update you. Anyway speed is very slow. |
@tsteur yes you are right, this error: "PHP message: Error in Matomo (tracker): Error query: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction In query: UPDATE mtm_log_visit SET profilable = ?, visitor_seconds_since_order = ?, visit_exit_idaction_url = ?, visit_total_actions = visit_total_actions + 1 , visit_total_interactions = visit_total_interactions + 1 , visit_total_time = ? WHERE idsite = ? AND idvisit = ? Parameters: array ( 0 => 0, 1 => NULL, 2 => 2588680546, 3 => 589, 4 => 6, 5 => '3037957010', )" while reading response header from upstream not related to log import, but main problem that I have pretty big log volume, and with such big drop in import speed I'm unable to import logs. |
What's your log import command parameters? In
Might not help but worth a try. Otherwise you could also try and play around with different settings to see if that helps. |
At the moment, I use this command: python3.9 /path/to/misc/log-analytics/import_logs.py --url=https://mymatomourl --idsite=6 --recorders=8 --enable-bots --recorder-max-payload-size=400 /path/to/logs UPD I have tried import with bulk_requests_use_transaction = 0 - same results. Thank you. |
This night our import worked smoothly like a charm. No SQL Timeouts and all statistics/logs are correctly imported. Thank you @sgiehl EDIT: I changed the amount of recorders to 8 today and i'll report tomorrow morning. |
Yes, tonight it took 1:38 hour to complete the import with 8 recorders. It's much slower than before the update. |
@adrianlambertz have you checked your server load during import? |
Yes, nothing unusual. Same load as before. |
It seems that there is a problem with the user_token_auth while importing log via the python logimporter.
While looking at the SQL processlist I see several UPDATE queries for the matomo_user_token_auth table, they run the entire time until the timeout:
[09-Dec-2020 09:28:08 UTC] Error in Matomo (tracker): Error query: SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction In query: UPDATE 'matomo_user_token_auth' SET 'last_used' = ? WHERE 'idusertokenauth' = ? Parameters: array ( 0 => '2020-12-09 09:27:17', 1 => '207', )
Manually executing one of these queries works like a charm in some milliseconds. But not while the python script runs.
After the timeout the python script echoes this:
2020-12-09 09:28:08,641: [INFO] Error when connecting to Matomo: HTTP Error 500: Internal Server Error
2020-12-09 09:28:08,642: [INFO] Retrying request, attempt number 2
That's since the latest 4.0.4 update (I updated from v3) and I use Python 3.7 to execute the script.
The text was updated successfully, but these errors were encountered: