1

after installing civicrm 5.49.3 via composer on drupal 9.3.14, I have a problem with GuzzleHTTP. Can you advise me on how to fix this problem.

The website encountered an unexpected error. Please try again later. Error: Undefined class constant 'VERSION' in GuzzleHttp\default_user_agent() (line 136 of vendor/guzzlehttp/guzzle/src/functions.php). GuzzleHttp\default_user_agent() (Line: 52) Drupal\Core\Http\ClientFactory->fromOptions() call_user_func_array(Array, Array) (Line: 258)

1 Answer 1

1

What it sounds like is your site has a module or something that includes guzzle v7 somewhere, and the one in vendor is v6. So what's happening is that it loads src/functions.php from the v6 one, but loads ClientInterface from the v7 one, and so there is no VERSION property.

So you need to find where guzzle 7 is and decide what to do from there. You can try find . -name BodySummarizer.php which is a file in v7 that isn't in v6.

1
  • Drupal 9 allows for guzzle 6 or 7. CiviCRM asks for ^6.3, so that's presumably the one in vendor. Seems most likely that you've got a CiviCRM extension that packaged guzzle (7), but you might also have a badly packaged Drupal module. As a quick fix, you could try installing guzzle 7 as 6 (i.e. that composer trick), it's possible that civicrm will work okay with 7.
    – Alan Dixon
    Commented Jun 7, 2022 at 20:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.