0

My server is running on PHP 7.2 - Laravel 5.8 - Redis Jobs - NewRelic for monitoring configuration.

The guzzle call is written inside helper function (that is autoloader from composer.json). The problem happens randomly. We get this error

production.INFO: Magic request methods require a URI and optional options array

I have read online that it's causing by a Memory leak (ref: https://discuss.newrelic.com/t/php-when-to-call-getconnection/114848)

We have many guzzle calls in our system and none is crashing and yes we do gazillions of Guzzle calls in a day.

I'm wondering if all other guzzle calls are inside a class not in a helper function. Is it OK to call Guzzle Request within a helper function, or is this the cause of this random error?

TylerH
  • 20,799
  • 66
  • 75
  • 101
  • what is the relation between using a helper or not and the memory leak issue you are encountering ? – N69S Jun 01 '22 at 12:20
  • The memory leak issue is because of new Relic. We can prevent this issue if we stop guzzle from newrelic monitoring but it'll not be a permanent solution. The problem is that it confuses Guzzle Client class from Predis class and calls getConnection function. This happens randomly. But only happens with this helper function. I'm assuming that while bootstraping it there might be some syncing issue and this to be happening – Shahrukh Khan Jun 01 '22 at 12:28
  • It's proper to new Relic, and they have a support system. What a team dedicated to an application can't do that an answer in SO can fix ? – N69S Jun 01 '22 at 12:32

1 Answers1

0

https://discuss.newrelic.com/t/php-when-to-call-getconnection/114848/14

Or restart services, that can resolve it in the short-term. I have not found any long-term fixes for this at this time.

Brad
  • 12,054
  • 44
  • 118
  • 187