cURL Timeout and Deprecated Function Error When Using AI Translate Submodule

Created on 7 October 2024, about 2 months ago

Drupal Information

- Drupal Version: 10.3.6
- AI Module Version: 1.0.x-dev (Updated on 6 Oct 2024)
- AI Translate Submodule: Enabled
- PHP Version: 8.3.10
- Server Environment: DDEV, Nginx

Description

When attempting to translate content using the AI Translate submodule, I encounter a 500 Internal Server Error accompanied by a cURL timeout. Additionally, there's a deprecated function warning related to the `explode()` function. These issues occur on the `/en/node/118/translations` page when clicking the "Translate using gpt-4o" link.

Steps to Reproduce

1. Navigate to the translations page of a node, e.g., `/en/node/118/translations`.
2. Click on the Translate using gpt-4o link.
3. Observe the error messages displayed.

Expected Behavior

The content should be successfully sent to the GPT-4 model for translation, and the translated content should appear without errors.

Actual Behavior

- Primary Error:

  Batch has encountered an error
  Continue to the error page

  An AJAX HTTP error occurred.
  HTTP Result Code: 500
  Debugging information follows.
  Path: /en/batch?id=191&op=do_nojs&op=do
  StatusText: error
  ResponseText: The website encountered an unexpected error. Try again later.
  Drupal\ai\Exception\AiRequestErrorException: Error invoking model response: cURL error 28: Operation timed out after 30006 milliseconds with 0 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://api.openai.com/v1/chat/completions in Drupal\ai\Plugin\ProviderProxy->wrapperCall() (line 190 of modules/contrib/ai/src/Plugin/ProviderProxy.php).

- Deprecated Function Warning:
Deprecated function: explode(): Passing null to parameter #2 ($string) of type string is deprecated in Drupal\ai_translate\Form\AiTranslateForm->buildForm() (line 112 of modules/contrib/ai/modules/ai_translate/src/Form/AiTranslateForm.php).

I'm using the latest development version of the AI module, and I understand it's still under active development. I hope this information helps in diagnosing and resolving the issues.

Thank you for your dedication and hard work on the Drupal AI project!

🐛 Bug report
Status

Active

Version

1.0

Component

Other Submodules

Created by

🇰🇬Kyrgyzstan sahaj

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

Comments & Activities

Production build 0.71.5 2024