Problem/Motivation
Many times, when using a Gemini 2.5 Flash or Gemini 2.5 Pro, cURL throws an error:
[error] AI migration failed for url https://accessibility.civicactions.com/posts/delivering-digital-first-turning-21st-century-idea-into-action: Error invoking model response: cURL error 28: Operation timed out after 60002 milliseconds with 0 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://generativelanguage.googleapis.com/v1/models/gemini-2.5-flash:generateContent
In theses instances, the AI query does not complete, and content is not migrated. Because the AI query can happen twice during each url's migration, it's possible to get an error during the "count" part of the migration, and then get a success during the "actual" migration. In that case, the migration would be migrated anyway.
cURL's default timeout is 300 seconds, and we're seeing it timeout at 60s. So, the setting is getting configured somewhere. I suspect somewhere in the Gemini provider module or in the AI module itself.
Please find where the timeout is getting configured and override it in our module, if possible.
Issue fork ai_migration-3548035
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
dmundraThank you @majorrobot for figuring it out. Approved the MR
Comment #4
majorrobot commentedThanks @dmundra! Merged.
FYI, it turns out this was addressed in AI core: https://www.drupal.org/project/ai/issues/3479159. It looks like you can add the config when you create the provider instance.
For posterity:
QA Steps:
This assumes you have already added a Gemini API key to your Drupal instance.
Comment #7
dmundra