WSOD when inserting content governed by a continuous job for an entity that uses Automators running via cron

Created on 8 November 2024, 14 days ago

Problem/Motivation

As the title may suggest, this is kind of an edge-case, although perhaps less so in the future as we progress into this new frontier of AI driven content models.

In my case, I have a taxonomy term that, based on the name provided by the user, populates a host of fields via AI Automators. It includes 2 image generating automators, both Dall-E 2 and Dall-E 3. The Automator process is lengthy, too long for an end-user to wait, and times out after a few minutes so it must run via cron.

The problem is, of course, that on form submission all the fields except the name field are empty. If a continuous job is present for the entity type, the form submission for creating a new entity triggers a WSOD with error:

The website encountered an unexpected error. Try again later.

Drupal\Core\Entity\EntityStorageException: Job item *** (Taxonomy term (***)) has no translatable content. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 817 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php). 

Steps to reproduce

1 - Setup an entity and have it use AI automators that populate empty field values on cron run.
2 - Setup a continuous job to translate new entities of the type created in step 1
3 - Create a new entity. The above mentioned error will appear.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇹🇭Thailand AlfTheCat

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @AlfTheCat
  • 🇬🇧United Kingdom scott_euser

    Not sure I can help here as I don't use Automators but I think you are probably in the wrong issue queue for this one. TMGMT handles job submission and AI Automators handles filling in fields. If it's filling in fields too late eg post save TMGMT will always have problems.

  • 🇹🇭Thailand AlfTheCat

    Yeah, I figured it might be out of the scope of the module. Just wanted to report it because I do think this will be something users are going to run into when working with automators. I was thinking maybe the check for translatable content could happen on cron, instead of on submit. But like I wrote before, edge case :)

  • 🇬🇧United Kingdom scott_euser

    Had a quick look; sounds like you're using cron to make AI Automators run, and you want the cron of TMGMT to run after that. You'd need some way to make AI Automators add to the TMGMT queue only once its done its job. Ie, some sort of post completion action there you'd have to code (or hire someone to code).

Production build 0.71.5 2024