Hello. With DRUPAL 10.6.2 in php 8.4
I tried to synchronize my users from Drupal with users in DOLIBARR.
I encountered this error:
Dispatch Failed. Subscriber dolibarr_sync on Webhook b10f758c-83f4-4af3-b6ee-318d0f81a5e7 for Event entity:user:update: cURL error 28: Operation timed out after 100 milliseconds with 77 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://erp.exemple.fr/api/index.php/users?
I tried to edit my .settings.php
$settings['http_client']['timeout'] = 45;
ini_set('default_socket_timeout', 60);
ini_set('max_execution_time', 120);
But no result.
Do you have a solution ?
PS: If i test with hook_user_insert(), hook_user_update(), hook_user_delete()
with a function, the user is created in DOLIBARR like expected.
The second problem is the token.
If i put the token in the url it's ok - like this:
https://erp.exemple.fr/api/index.php/users?DOLAPIKEY=9999999999999999
If not the token expected is THE_DOLAPIKEY not DOLAPIKEY and the acess is refused.
Issue fork webhooks-3567271
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 #2
bkaernel commentedComment #3
bkaernel commentedComment #4
bkaernel commentedComment #5
bluegeek9 commentedThis is not caused by PHP’s default_socket_timeout or Drupal’s global HTTP client timeout. The Webhooks module sets its own timeout here:
WebhooksService.php Lines 191-200
So if your Drupal host is exemple.fr, and the Dolibarr URL is https://erp.exemple.fr/..., the string exemple.fr appears inside the Dolibarr URL. The module treats it as a “local to local” request and forces a 0.1 second timeout.
Recommended fix in the module code would be to compare hosts instead of using strpos():
Comment #8
bluegeek9 commented