1

I am trying to gather a year's worth of data for a select ad account but I get the following exception:

FacebookAds\Exception\Exception
Failed sending HTTP request: Header overflow

The exception happens at the following line of code:

$adData = [];
foreach ($fbadaccount->getAds($adFields, $adParams) as $object) {
            $adData[] = $object->getData();
}

This code works perfectly fine for smaller time frames.

I understand it is attempting to get a lot of data but I'm trying to find a solution.

Could this potentially be environment-related? i.e. nginx

jackthedev
  • 417
  • 8
  • 21

1 Answers1

1

The "Header overflow" error occurs when the HTTP request header is too large.

Perhaps because of the cookies being sent.

holden321
  • 1,166
  • 2
  • 17
  • 32
  • The issue was exactly this. The number of ads I was trying to query was causing the issue. Chunking the requests solved the problem. – jackthedev Jan 11 '23 at 09:07