Home›Support›English Support›[Resolved] If I click on the "job" page within WordPress, it says that jobs cannot be loaded
[Resolved] If I click on the "job" page within WordPress, it says that jobs cannot be loaded
This thread is resolved. Here is a description of the problem and solution.
Problem: The client reported issues with WPML on their WordPress site hosted on Kinsta, including a disconnected license and error messages indicating a 'Division by zero' in the WPML code. Additionally, the 'jobs' page within WordPress was not loading translation jobs correctly, displaying messages that jobs could not be loaded or that the Advanced Editor jobs synchronization had failed.
Solution: We resolved the issue by running SQL queries to update the status of translation jobs in the 'icl_translation_status' table. First, we changed the status of jobs that were 'In Progress' (status 2) to 'Needs Update' (status 1) with the following query:
UPDATE `{wpdbPrefix}_icl_translation_status` SET `status` = 1 WHERE `status` = 2
Then, we set all remaining ongoing jobs to 'Finished' (status 10) using these queries:
UPDATE `{wpdbPrefix}_icl_translation_status` SET `status` = 10 WHERE `status` = 1;
UPDATE `{wpdbPrefix}_icl_translation_status` SET `status` = 10 WHERE `status` = 9;
After applying these fixes, we advised the client to go to WPML > Translation Management and resend any pages they wish to translate.
Please note that this solution might be irrelevant if it's outdated or not applicable to your case. If you're still experiencing issues, we highly recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket with us.
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.
Other strange behaviour seems to happen. The license seemed to be disconnected for a brief time and Kinsta, the platform hosting our WordPress site logged error messages from WPML that I'm pasting here:
2024/02/01 14:32:35 [error] 47976#47976: *27336 FastCGI sent in stderr: "PHP message: PHP Warning: Attempt to read property "element_id" on null in /www/ifcsn_953/public/wp-content/plugins/sitepress-multilingual-cms/classes/API/REST/jobs/class-wpml-tm-rest-jobs-view-model.php on line 187PHP message: PHP Fatal error: Uncaught DivisionByZeroError: Division by zero in /www/ifcsn_953/public/wp-content/plugins/sitepress-multilingual-cms/classes/API/REST/jobs/class-wpml-tm-rest-job-progress.php:41
Stack trace:
#0 /www/ifcsn_953/public/wp-content/plugins/sitepress-multilingual-cms/classes/API/REST/jobs/class-wpml-tm-rest-jobs-view-model.php(116): WPML_TM_Rest_Job_Progress->get(Object(WPML_TM_Post_Job_Entity))
#1 /www/ifcsn_953/public/wp-content/plugins/sitepress-multilingual-cms/classes/API/REST/jobs/class-wpml-tm-rest-jobs-view-model.php(66): WPML_TM_Rest_Jobs_View_Model->map_job(Object(WPML_TM_Post_Job_Entity), Object(WPML_TM_Jobs_Search_Params))
#2 /www/ifcsn_953/public/wp-content/plugins/sitepress-multilingual-cms/classes/API/REST/class-wpml-tm-rest-jobs.php(215): WPML_TM_Rest_Jobs_View_Model->build(Object(WPML_TM_Jobs_Collection), 119, Object(WPML_TM_Jobs_Search_Params))
#3 /www/ifcsn_953/public/wp-includes/rest-api/class-wp-rest-server.php(1193): WPML_TM_REST_Jobs->get_jobs(Objec" while reading response header from upstream, client: 192.109.159.95, server: env-ifcsn-ifcsnstaging.kinsta.cloud, request: "GET /wp-json/wpml/tm/v1/jobs/?limit=20&offset=0&sorting%5Bid%5D=desc&pageName=tm-jobs HTTP/2.0", upstream: "hidden link:", host: "env-ifcsn-ifcsnstaging.kinsta.cloud:57858", referrer: "hidden link"
If I click on the "job" page within WordPress, it says that jobs cannot be loaded. (See screenshot)
Using this I was able to get into the database. I opened the table they refer to and checked the field named status. All records have a value of 9 or 10. There are none that have a value of 2. See attached Screenshot.
I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. It would be better to have a testing site where the issue is replicated. Your next reply is set to private to share the info.
❌ IMPORTANT: Please backup your database and website before proceeding ❌
You can use this plugin to create the backup: https://wordpress.org/plugins/duplicator/
✙ I would need your permission to de-activate and re-activate Plugins and the Theme to change configurations on the site if needed. This is also a reason the backup is critical.
I tried again loading the jobs, there is improvement, in that jobs appear and the list has become longer, but I also received the error message: The Advanced Editor jobs synchronization has failed. See attached screenshot.
At one point, going to page 2, it also said that jobs failed to load.
The credentials I sent you for our database are still the same and I also haven't disabled your access to our instance of WordPress.
I can see that error message on the Jobs page. However, after reloading the page, I don't see it and the pagination works properly, it might be a temporary issue. Here is the screen record hidden link
The page does display the jobs, but it also still gives the same error message. What's concerning is that one of the French pages that had already the translation complete now says "needs translation". See screenshot.
What's difficult is that I can't trust the website to keep the translation work that was done in the past.
Should I follow the last entry in the link you sent, suggested by Alejandro, that suggests deregistering and reregistering the site?
Long is OFF today, so I have checked further your case and it seems the error message was caused by some still leftover of jobs, so I have set all other rest of ongoing jobs to finished via the next query:
UPDATE `DkzVpsfm_icl_translation_status` SET `status` = 10 WHERE `status` = 1;
15.49
UPDATE `DkzVpsfm_icl_translation_status` SET `status` = 10 WHERE `status` = 9;
You can go to WPML > Translation and send any other page you wish to translate.