Fatal error: Error code 6103, can't get domain zones
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 20/100
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
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cloudflare/cloudflare-php
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
cloudflare/cloudflare-php#202 · 1 reaction ·
-
setEmailObfuscation have wrong configuration id.Possibly taken @emersonreisdev claimed this 2018 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 65/100
cloudflare/cloudflare-php#156 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
cloudflare/cloudflare-php#278 · 5 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
cloudflare/cloudflare-php#272 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
cloudflare/cloudflare-php#264 ·
All issues in cloudflare/cloudflare-php
Similar issues
-
bug customer-reported
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
MagnaCapax/PMSS#1009 ·
Maintainers usually reply within 5 days
-
Bug Status: Needs Triage
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
php/php-src#24121 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
PrestaShopCorp/ps_accounts#666 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Maintainers usually reply within 6 days
-
Security SecurityBundle
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
symfony/symfony-docs#23173 ·
Maintainers usually reply within 3 days