Closed ph5ive closed 2 years ago
I forgot to include the curl command that created the Curl output above:
curl -iv "https://██████.cloud2.influxdata.com/api/v2/write?org=███████████&bucket=██████████&precision=s" \
--header "Authorization: Token ████████████████████████████████████████████████" \
--data "mem,host=host1 used_percent=23.43234543"
Hi @ph5ive,
thanks for using our client.
The WriteApi
automatically retries writes for error code >= 429
. You can disable retrying by $maxRetries = 0
options:
$writeApi ->writeOptions->maxRetries = 0
Regards
@bednar So, are you saying that if maxRetries = 0 it will report the error?
The maxRetries = 0
causes that the error from server is directly throws.
@bednar Thanks for the clarification.
The issue
When using the InfluxDB Client for PHP it doesn't appear to report HTTP 429 status.
Here is an example script WriteAPITest.php
However, when the API is called using Curl it reports the HTTP 429 status:
Steps to reproduce:
php WriteAPITest.php
Expected behavior: I would expect to see the following error the same as the Curl output:
{"code":"too many requests","message":"org ███████████ has exceeded plan cardinality limit"}
Actual behavior: Nothing is returned.
Specifications: