Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Fatal error: Error code 6103, can't get domain zones

Open
#209 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
20/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
php
Domain
api

Research direction

Start by reproducing the request from web/a.php and trace the call through vendor/cloudflare/sdk/src/Endpoints/Zones.php and vendor/cloudflare/sdk/src/Adapter/Guzzle.php. Compare the failing request and response handling around the reported 6103 error; done means the zones lookup no longer fails with invalid request headers, with an appropriate regression check if the cause is confirmed.

Written by the indexing model from the issue text.

Description

I have this error since some days ago, and I don't know what to do!!!

Code:

<?php
include $_ENV["ROOT"] . "vendor/autoload.php";
$key = new Cloudflare\API\Auth\APIKey($_ENV["MAIL"], $_ENV["TOKEN"]);
$adapter = new Cloudflare\API\Adapter\Guzzle($key);
//print_r($adapter);
$user = new Cloudflare\API\Endpoints\User($adapter);
$zones = new Cloudflare\API\Endpoints\Zones($adapter);
$zoneID = $zones->listZones("[domain]");
echo $zoneID;

Error:

<br />
<b>Fatal error</b>:  Uncaught GuzzleHttp\Exception\ClientException: Client error: `GET https://api.cloudflare.com/client/v4/zones?page=1&per_page=20&match=all&name=[domain]` resulted in a `400 Bad Request` response:
{"success":false,"errors":[{"code":6003,"message":"Invalid request headers","error_chain":[{"code":6103,"message":"Inval (truncated...)
 in /home/runner/[censored]/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113
Stack trace:
#0 /home/runner/[censored]/vendor/guzzlehttp/guzzle/src/Middleware.php(69): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response), NULL, Array, NULL)
#1 /home/runner/[censored]/vendor/guzzlehttp/promises/src/Promise.php(204): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response))
#2 /home/runner/[censored]/vendor/guzzlehttp/promises/src/Promise.php(153): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), NULL)
#3 /home/runner/[censored]/vendor/guzzlehttp/promises/src/TaskQueue.php(48): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}()
#4 /home/runner/[censored]/vendor/guzzlehttp/promises/src/Promise.php(248): GuzzleHttp\Promise\TaskQueue->run(true)
#5 /home/runner/[censored]/vendor/guzzlehttp/promises/src/Promise.php(224): GuzzleHttp\Promise\Promise->invokeWaitFn()
#6 /home/runner/[censored]/vendor/guzzlehttp/promises/src/Promise.php(269): GuzzleHttp\Promise\Promise->waitIfPending()
#7 /home/runner/[censored]/vendor/guzzlehttp/promises/src/Promise.php(226): GuzzleHttp\Promise\Promise->invokeWaitList()
#8 /home/runner/[censored]/vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()
#9 /home/runner/[censored]/vendor/guzzlehttp/guzzle/src/Client.php(187): GuzzleHttp\Promise\Promise->wait()
#10 /home/runner/[censored]/vendor/guzzlehttp/guzzle/src/ClientTrait.php(44): GuzzleHttp\Client->request('GET', 'zones', Array)
#11 /home/runner/[censored]/vendor/cloudflare/sdk/src/Adapter/Guzzle.php(85): GuzzleHttp\Client->get('zones', Array)
#12 /home/runner/[censored]/vendor/cloudflare/sdk/src/Adapter/Guzzle.php(38): Cloudflare\API\Adapter\Guzzle->request('get', 'zones', Array, Array)
#13 /home/runner/[censored]/vendor/cloudflare/sdk/src/Endpoints/Zones.php(127): Cloudflare\API\Adapter\Guzzle->get('zones', Array)
#14 /home/runner/[censored]/web/a.php(8): Cloudflare\API\Endpoints\Zones->listZones('[domain]')
#15 {main}

Next Cloudflare\API\Adapter\ResponseException: Invalid request headers in /home/runner/acfadmin/vendor/cloudflare/sdk/src/Adapter/ResponseException.php:38
Stack trace:
#0 /home/runner/[censored]/vendor/cloudflare/sdk/src/Adapter/Guzzle.php(88): Cloudflare\API\Adapter\ResponseException::fromRequestException(Object(GuzzleHttp\Exception\ClientException))
#1 /home/runner/[censored]/vendor/cloudflare/sdk/src/Adapter/Guzzle.php(38): Cloudflare\API\Adapter\Guzzle->request('get', 'zones', Array, Array)
#2 /home/runner/[censored]/vendor/cloudflare/sdk/src/Endpoints/Zones.php(127): Cloudflare\API\Adapter\Guzzle->get('zones', Array)
#3 /home/runner/[censored]/web/a.php(8): Cloudflare\API\Endpoints\Zones->listZones('[domain]')
#4 {main}
  thrown in <b>/home/runner/[censored]/vendor/cloudflare/sdk/src/Adapter/ResponseException.php</b> on line <b>38</b><br />
Dominant language
PHP
Stars
674
Forks
268
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cloudflare/cloudflare-php

All issues in cloudflare/cloudflare-php

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.