“Incorrect user-level lock name” error when trying to acquire LOCK for backups
-
Today I updated WordPress to version 5.4. And after that (if I am not mistaken) I also updated Longer Permalinks plugin to the latest version (1.21). Then I looked into debug.log file and saw lots of errors like this:
[13-Apr-2020 16:52:11 UTC] PHP Warning: mysqli_query(): (42000/3057): Incorrect user-level lock name 'my_table_name_wordpress_longer_permalinks_backup_existing_postnames'. in physical_path_to_website/wp-includes/wp-db.php on line 2024 [13-Apr-2020 16:52:11 UTC] WordPress database error Incorrect user-level lock name 'my_table_name_longer_permalinks_backup_existing_postnames'. for query SELECT GET_LOCK('my_table_name_longer_permalinks_backup_existing_postnames',0) made by require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/longer-permalinks/longer-permalinks.php'), longer_permalinks_backup_existing_postnames [13-Apr-2020 16:52:11 UTC] Longer Permalinks - could not acquire LOCK for longer permalinks backup.
where “my_table_name” and “physical_path_to_website” describe WordPress table name and the website path respectively. I am not showing them for security reasons.
I think the problem is the length of the lock name – my_table_name_longer_permalinks_backup_existing_postnames is (in real life) 66 characters long whereas lock name limit in MySQL 5.7 is only 64.
Currently posts with long permalinks are broken, the plugin is trying to access backup but can not. What should I do? I don’t think it’s very good idea to downgrade MySQL or tweak tables by hand. Even if that fixes my problem others might encounter it. The problem is with the lock system which should check if it’s name exceeds 64 characters.The page I need help with: [log in to see the link]
- The topic ‘“Incorrect user-level lock name” error when trying to acquire LOCK for backups’ is closed to new replies.