- Issue created by @jbuttler
Additional informat from log messages:
Type ai_automator
Date Wednesday, November 20, 2024 - 8:55 am
Message A general error happened why trying to interpolate, message Error invoking model response: cURL error 28: Operation timed out after 30002 milliseconds with 0 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://api.openai.com/v1/images/generations------------------------
Type ai
Location https://www.example.com/admin/config/ai/explorers/ai-image-generation?_w...
Referrer https://www.example.com/admin/config/ai/explorers/ai-image-generation
Message Error invoking model response: cURL error 28: Operation timed out after 30002 milliseconds with 0 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://api.openai.com/v1/images/generationsI also verified in my openai account that the images are being created, just not being rendered or saved by the web server.
- 🇨🇦Canada blainelang
@jbuttler, just to confirm that I am also seeing this issue. I have a local D11 site that is being used to test out the AI modules and was working until yesterday. Even using the AI explorer for text to image is failing with the cURL timeout. Tried Dall-e-2 and Dall-e-3 models same response. Only have the OpenAI provider setup. No issues with the Chat API to Test to speech API.
- 🇩🇪Germany marcus_johansson
So the issue that happens here is that OpenAI has been slow the last couple of days and the generation takes to long time. The default Drupal Guzzle client is set to timeout after 30 seconds and give up, which from a security point of view makes sense (you don't want multiple workers just sitting waiting for responses that never comes).
There is one solution you can do right now to solve this, but it has consequences on live sites, see:
https://jeffgeerling.com/blogs/jeff-geerling/setting-maxexecutiontime-limitTo solve this we have this ticket in review:
https://www.drupal.org/project/ai/issues/3488220 ✨ Make an event to be able to change the guzzle client. ActiveAnd when that ticket is done, we can do this ticket:
https://www.drupal.org/project/ai/issues/3479159 🐛 cURL Timeout and Deprecated Function Error When Using AI Translate Submodule ActiveSo if you want it solved right now, follow the link above on your own peril. Otherwise the two tickets will solve it.
If that answer is ok for your, could you close the ticket as duplicate?
- 🇨🇦Canada blainelang
Thanks @Marcus, setting the php.ini Max Execution and adding $settings['http_client_config']['timeout'] = 240; to my settings.local.php solved the time out issue.
I suspect a configureable and supported Drupal solution will take some time ;)
Thanks for your help on this, its much appreciated! This solution works for me!