This thread is resolved. Here is a description of the problem and solution.
Problem: The client was unable to upload images to the WordPress media library, receiving an error message about server capacity and a PHP Fatal error related to WPML translations. The issue was suspected to be due to a corrupted 'wp_icl_translations' database table. Solution: 1. Backup the site completely. 2. Execute the following SQL commands to repair the database:
DELETE FROM `wp_icl_translations` WHERE `translation_id` = '0';
ALTER TABLE `wp_icl_translations` CHANGE `translation_id` `translation_id` bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
ALTER TABLE `wp_icl_translations` ADD UNIQUE `trid_lang` (`trid`, `language_code`), ADD UNIQUE `el_type_id` (`element_type`, `element_id`), ADD INDEX `trid` (`trid`), ADD INDEX `id_type_language` (`element_id`, `element_type`, `language_code`);
3. Navigate to WPML -> Support -> Troubleshooting and click the 'Set language information' button. After these steps, the image upload issue should be resolved. If other database issues arise, further investigation may be necessary.
If this solution does not apply to your case, or if it seems outdated, we recommend opening a new support ticket. We also advise checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. For further assistance, please visit our support forum at WPML Support Forum.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Background of the issue:
I am trying to upload a picture to my media library in WordPress. I encountered an error message stating that the server cannot process the image, suggesting that the server might be busy or lacking resources, even though the image is smaller than the suggested maximum size of 2560 pixels. This issue did not occur three weeks ago, and I have tried using an older version of the site where it worked. However, I cannot revert to the old version due to significant changes. I also tried changing the WPML settings for media to 'non translatable', which resolved the issue but resulted in all media being in the same database, not organized by language. I want to understand why it was working before and why every translation creates another version of a media file. I know this is related to the settings, but I am unsure why this is the default setup. I expected to upload new media without errors, but instead, I received the error message: 'Le serveur ne peut pas traiter l’image. Cela peut se produire si le serveur est occupé ou ne dispose pas de suffisamment de ressources pour terminer la tâche. Téléverser une image plus petite peut aider. La taille maximale suggérée est de 2560 pixels.'
Symptoms:
I received an error message when trying to upload an image: 'Le serveur ne peut pas traiter l’image. Cela peut se produire si le serveur est occupé ou ne dispose pas de suffisamment de ressources pour terminer la tâche. Téléverser une image plus petite peut aider. La taille maximale suggérée est de 2560 pixels.' Additionally, there is a PHP Fatal error related to WPML translations: 'PHP Fatal error: Uncaught InvalidArgumentException: No translation entry found for query: s:42:" element_id = %d AND element_type LIKE %s ";a:2:{i:0;s:5:"26297";i:1;s:5:"post%";} in /home/mysolutionconnect/www/wp-content/plugins/sitepress-multilingual-cms/classes/records/class-wpml-tm-icl-translations.php:193'.
Questions:
Why was the image upload working before but not now?
Why does every translation create another version of a media file?
What is causing the PHP Fatal error related to WPML translations?
Our current suspicion is that the `wp_icl_translations` DB table is corrupted. I escalated this issue to our second-tier supporters. I'll update you here once I have news about this issue.
Our second-tier supporter debugged this issue and found that your site is suffering from a corruption in the database. For example, icl_translations is missing its indexes and auto-increment flag. The second-tier supporter debugged this issue and provided a fix. I checked this fix on a copy of your site on my local server and confirmed that it works. Here are the steps you need to take.
1. Backup your site in case something goes wrong.
2. Apply the following SQL command in your site's DB.
DELETE FROM `wp_icl_translations`
WHERE `translation_id` = '0' ;
ALTER TABLE `wp_icl_translations`
CHANGE `translation_id` `translation_id` bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
ALTER TABLE `wp_icl_translations`
ADD UNIQUE `trid_lang` (`trid`, `language_code`),
ADD UNIQUE `el_type_id` (`element_type`, `element_id`),
ADD INDEX `trid` (`trid`),
ADD INDEX `id_type_language` (`element_id`, `element_type`, `language_code`);
3. Go to WPML -> Support -> Troubleshooting (link). Once on the troubleshooting screen, press the 'Set language information' button and wait for the process to complete.
**** Important! Please make a full site backup (files and DB) before you proceed with those steps****
Now you should be able to upload an image to the media library without getting the error.
Please confirm that it fixes the problem on your site.
Our second-tier supporter mentioned that there might be other DB faults, so please let us know if you encounter any other such problems.
The question that arises now is whether this is a WPML problem.
Can you please check the following?
1. Take a backup of your site in case something goes wrong.
2. Temporarily deactivate WPML.
3. Upload an image to the Media Library.
If the problem persists, please check in other directions, as it is not a WPML issue.
If the problem does not persist, then please share with me any PHP errors you get while uploading an image to the Media library while WPML is active.
**** Important! Please make a full site backup (files and DB) before you proceed with those steps****
Thank you for your answer. I managed to find the solution for the problem.
My new problem is the next one : What are the parameters to achieve to have one only picture that is not being translated in other languages and that is assigned to multiple pages or articles ?
Is this even possible ? Because when I change the media parameters soon WPML to "do not translate" it automatically goes back to "translate all new media..."
I want to have a clean media database. And WPML is not helping me to keep it tidy.
Thank you for your help,
Christopher
New threads created by Itamar and linked to this one are listed below:
I'm glad you have managed to find a solution for this.
In our technical support forum, we try to focus on one issue per ticket. Otherwise, tickets can get cluttered and confusing for both users and supporters. I've split the other ticket and created a new ticket with this issue. Please see the latest ticket here.
One of our supporters will get back to you about this issue.
Regards,
Itamar.
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.