429 "Too many request" when translating nodes with many paragraphs and DeepL

Created on 27 June 2025, 9 days ago

Problem/Motivation

Articles with many (nested) paragraphs call the DeepL API (and all others as well - should probably be fixed in other vendors' API calls as well!) repeatedly, leading to an HTTP 429 "Too many requests".

Steps to reproduce

Create node with lots of (nested) paragraphs (9 with 12 items each in my case).
Use DeepL free API.
Trigger translation.
Get error.

Proposed resolution

I see two options, the first of them will be sent as a MR shortly.
1. Implement an exponential backoff just like the docs say (https://developers.deepl.com/docs/best-practices/error-handling). I used a similar strategy as the official PHP library at https://github.com/DeepLcom/deepl-php/blob/main/src/BackoffTimer.php
2. Use deepl-php and do not implement this again. Might be more future-proof but above my skills. Would most likely also handle other error scenarios better and would probably provide for a more stable API.

🐛 Bug report
Status

Active

Version

1.4

Component

Code

Created by

🇦🇹Austria tgoeg

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

Merge Requests

Comments & Activities

  • Issue created by @tgoeg
  • 🇦🇹Austria tgoeg

    This strategy basically works, but duplicates code somewhat.
    I think going with the official PHP library might be better on the long run.

    I still think it's worth to see how it can be fixed. Maybe you want to merge it as an interim solution. It works for me™ :-)

  • 🇮🇹Italy bigbabert Milano, Italy

    Hi @tgoeg,

    thanks for reporting and for the fix to review, i'll have look next days (hope on Sunday), also to the long term solution that is pretty much interesting, i could add deepl php library dependency as already done for google provider, also maybe at that time the module is mature to build proper hooks that allow other modules to add more providers.

    Best regards
    Alberto

  • Pipeline finished with Success
    9 days ago
    Total: 354s
    #533086
Production build 0.71.5 2024