fix: fix v3 write descriptions, Add v3 Troubleshoot writing data #5135 (#5140)

* fix: fix v3 write descriptions, Add v3 Troubleshoot writing data #5135

* Update content/influxdb/cloud-dedicated/write-data/troubleshoot.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/cloud-serverless/write-data/troubleshoot.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/clustered/write-data/troubleshoot.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

---------

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>
pull/5141/head^2
Jason Stirnaman 2023-09-18 13:03:47 -05:00 committed by GitHub
parent ef5ba5c9ea
commit e0bafcd9a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 370 additions and 1687 deletions

View File

@ -1358,7 +1358,7 @@ components:
type: apiKey
info:
title: InfluxDB Cloud Dedicated API Service
version: Cloud 2.x
version: 3.x
description: |
The InfluxDB HTTP API provides a programmatic interface for interactions with InfluxDB.
Access the InfluxDB API using the `/api/v2/` endpoint or InfluxDB v1 endpoints.
@ -1445,36 +1445,27 @@ paths:
Use this endpoint to send data in [line protocol](/influxdb/cloud-dedicated/reference/syntax/line-protocol/) format to InfluxDB.
#### InfluxDB Cloud
InfluxDB does the following when you send a write request:
- Does the following when you send a write request:
1. Validates the request
2. If successful, attempts to [ingest the data](/influxdb/cloud-dedicated/reference/internals/durability/#data-ingest); _error_ otherwise.
3. If successful, responds with _success_ (HTTP `204` status code), acknowledging that the data is written and queryable; _error_ otherwise.
1. Validates the request and queues the write.
2. If queued, responds with _success_ (HTTP `2xx` status code); _error_ otherwise.
3. Handles the write asynchronously and reaches eventual consistency.
To ensure that InfluxDB Cloud handles writes in the order you request them,
wait for a success response (HTTP `2xx` status code) before you send the next request.
Because writes are asynchronous, your change might not yet be readable
when you receive the response.
#### Rate limits (with InfluxDB Cloud)
`write` rate limits apply.
For more information, see [limits and adjustable quotas](/influxdb/cloud-dedicated/account-management/limits/).
To ensure that InfluxDB Cloud handles writes in the order you request them,
wait for a success response (HTTP `2xx` status code) before you send the next request.
#### Related guides
- [Write data with the InfluxDB API](/influxdb/cloud-dedicated/write-data/developer-tools/api)
- [Optimize writes to InfluxDB](/influxdb/cloud-dedicated/write-data/best-practices/optimize-writes/)
- [Get started writing data](/influxdb/cloud-dedicated/get-started/write/)
- [Write data](/influxdb/cloud-dedicated/write-data/)
- [Best practices for writing data](/influxdb/cloud-dedicated/write-data/best-practices/)
- [Troubleshoot issues writing data](/influxdb/cloud-dedicated/write-data/troubleshoot/)
operationId: PostWrite
parameters:
- $ref: "#/components/parameters/TraceSpan"
- description: |
The compression applied to the line protocol in the request payload.
To send a GZIP payload, pass `Content-Encoding: gzip` header.
To send a gzip payload, pass `Content-Encoding: gzip` header.
in: header
name: Content-Encoding
schema:
@ -1530,13 +1521,10 @@ paths:
- application/json
type: string
- description: |
An organization name or ID.
Ignored. An organization name or ID.
#### InfluxDB Cloud
- Ignores `org` and `orgID` parameters.
- Authorizes the request using the specified database token
and writes data to the specified cluster database.
InfluxDB ignores this parameter; authorizes the request using the specified database token
and writes data to the specified cluster database.
in: query
name: org
required: true
@ -1544,13 +1532,10 @@ paths:
description: The organization name or ID.
type: string
- description: |
An organization ID.
Ignored. An organization ID.
#### InfluxDB Cloud
- Ignores `org` and `orgID` parameters.
- Authorizes the request using the specified database token
and writes data to the specified cluster database.
InfluxDB ignores this parameter; authorizes the request using the specified database token
and writes data to the specified cluster database.
in: query
name: orgID
schema:
@ -1585,7 +1570,7 @@ paths:
To send compressed data, do the following:
1. Use [GZIP](https://www.gzip.org/) to compress the line protocol data.
1. Use [gzip](https://www.gzip.org/) to compress the line protocol data.
2. In your request, send the compressed data and the
`Content-Encoding: gzip` header.
@ -1596,42 +1581,24 @@ paths:
responses:
"204":
description: |
Success.
#### InfluxDB Cloud
- Validated and queued the request.
- Handles the write asynchronously - the write might not have completed yet.
#### Related guides
- [How to check for write errors](/influxdb/cloud-dedicated/write-data/troubleshoot/)
Success. Data is written and queryable.
"400":
content:
application/json:
examples:
measurementSchemaFieldTypeConflict:
summary: (Cloud) field type conflict thrown by an explicit database schema
summary: field type conflict thrown by an explicit database schema
value:
code: invalid
message: 'partial write error (2 written): unable to parse ''air_sensor,service=S1,sensor=L1 temperature="90.5",humidity=70.0 1632850122'': schema: field type for field "temperature" not permitted by schema; got String but expected Float'
orgNotFound:
summary: (OSS) organization not found
value:
code: invalid
message: "failed to decode request body: organization not found"
message: 'failed to parse line protocol: error writing line 2: Unable to insert iox::column_type::field::integer type into column temp with type iox::column_type::field::string'
schema:
$ref: "#/components/schemas/LineProtocolError"
description: |
Bad request. The response body contains detail about the error.
InfluxDB returns this error if the line protocol data in the request is malformed.
InfluxDB returns this error if the line protocol data in the request is malformed or contains a database schema conflict.
The response body contains the first malformed line in the data, and indicates what was expected.
For partial writes, the number of points written and the number of points rejected are also included.
#### InfluxDB Cloud
- Returns this error for database schema conflicts.
"401":
$ref: "#/components/responses/AuthorizationError"
"404":
@ -1665,10 +1632,7 @@ paths:
The request payload is too large.
InfluxDB rejected the batch and did not write any data.
#### InfluxDB Cloud:
- Returns this error if the payload exceeds the 50MB size limit.
- Returns `Content-Type: text/html` for this error.
InfluxDB returns this error if the payload exceeds the size limit.
"429":
description: |
Too many requests.
@ -2029,7 +1993,7 @@ tags:
| &nbsp;Code&nbsp; | Status | Description |
|:-----------:|:------------------------ |:--------------------- |
| `200` | Success | |
| `204` | No content | For a `POST` request, `204` indicates that InfluxDB accepted the request and request data is valid. Asynchronous operations, such as `write`, might not have completed yet. |
| `204` | Success. No content | InfluxDB doesn't return data for the request. For example, a successful write request returns `204` status code, acknowledging that data is written and queryable. |
| `400` | Bad request | InfluxDB can't parse the request due to an incorrect parameter or bad syntax. If line protocol in the request body is malformed. The response body contains the first malformed line and indicates what was expected. For partial writes, the number of points written and the number of points rejected are also included. |
| `401` | Unauthorized | May indicate one of the following: <ul><li>`Authorization: Token` header is missing or malformed</li><li>API token value is missing from the header</li><li>API token doesn't have permission. For more information about token types and permissions, see [Manage tokens](/influxdb/cloud-dedicated/admin/tokens/)</li></ul> |
| `404` | Not found | Requested resource was not found. `message` in the response body provides details about the requested resource. |

File diff suppressed because it is too large Load Diff

View File

@ -18039,7 +18039,7 @@ paths:
- $ref: '#/components/parameters/TraceSpan'
- description: |
The compression applied to the line protocol in the request payload.
To send a GZIP payload, pass `Content-Encoding: gzip` header.
To send a gzip payload, pass `Content-Encoding: gzip` header.
in: header
name: Content-Encoding
schema:
@ -18166,7 +18166,7 @@ paths:
To send compressed data, do the following:
1. Use [GZIP](https://www.gzip.org/) to compress the line protocol data.
1. Use [gzip](https://www.gzip.org/) to compress the line protocol data.
2. In your request, send the compressed data and the
`Content-Encoding: gzip` header.

View File

@ -1445,36 +1445,27 @@ paths:
Use this endpoint to send data in [line protocol](/influxdb/clustered/reference/syntax/line-protocol/) format to InfluxDB.
#### InfluxDB Cloud
InfluxDB does the following when you send a write request:
- Does the following when you send a write request:
1. Validates the request
2. If successful, attempts to [ingest the data](/influxdb/clustered/reference/internals/durability/#data-ingest); _error_ otherwise.
3. If successful, responds with _success_ (HTTP `204` status code), acknowledging that the data is written and queryable; _error_ otherwise.
1. Validates the request and queues the write.
2. If queued, responds with _success_ (HTTP `2xx` status code); _error_ otherwise.
3. Handles the write asynchronously and reaches eventual consistency.
To ensure that InfluxDB Cloud handles writes in the order you request them,
wait for a success response (HTTP `2xx` status code) before you send the next request.
Because writes are asynchronous, your change might not yet be readable
when you receive the response.
#### Rate limits (with InfluxDB Cloud)
`write` rate limits apply.
For more information, see [limits and adjustable quotas](/influxdb/clustered/account-management/limits/).
To ensure that InfluxDB Cloud handles writes in the order you request them,
wait for a success response (HTTP `2xx` status code) before you send the next request.
#### Related guides
- [Write data with the InfluxDB API](/influxdb/clustered/write-data/developer-tools/api)
- [Optimize writes to InfluxDB](/influxdb/clustered/write-data/best-practices/optimize-writes/)
- [Get started writing data](/influxdb/clustered/get-started/write/)
- [Write data](/influxdb/clustered/write-data/)
- [Best practices for writing data](/influxdb/clustered/write-data/best-practices/)
- [Troubleshoot issues writing data](/influxdb/clustered/write-data/troubleshoot/)
operationId: PostWrite
parameters:
- $ref: "#/components/parameters/TraceSpan"
- description: |
The compression applied to the line protocol in the request payload.
To send a GZIP payload, pass `Content-Encoding: gzip` header.
To send a gzip payload, pass `Content-Encoding: gzip` header.
in: header
name: Content-Encoding
schema:
@ -1530,13 +1521,10 @@ paths:
- application/json
type: string
- description: |
An organization name or ID.
Ignored. An organization name or ID.
#### InfluxDB Cloud
- Ignores `org` and `orgID` parameters.
- Authorizes the request using the specified database token
and writes data to the specified cluster database.
InfluxDB ignores this parameter; authorizes the request using the specified database token
and writes data to the specified cluster database.
in: query
name: org
required: true
@ -1544,13 +1532,10 @@ paths:
description: The organization name or ID.
type: string
- description: |
An organization ID.
Ignored. An organization ID.
#### InfluxDB Cloud
- Ignores `org` and `orgID` parameters.
- Authorizes the request using the specified database token
and writes data to the specified cluster database.
InfluxDB ignores this parameter; authorizes the request using the specified database token
and writes data to the specified cluster database.
in: query
name: orgID
schema:
@ -1585,7 +1570,7 @@ paths:
To send compressed data, do the following:
1. Use [GZIP](https://www.gzip.org/) to compress the line protocol data.
1. Use [gzip](https://www.gzip.org/) to compress the line protocol data.
2. In your request, send the compressed data and the
`Content-Encoding: gzip` header.
@ -1596,42 +1581,24 @@ paths:
responses:
"204":
description: |
Success.
#### InfluxDB Cloud
- Validated and queued the request.
- Handles the write asynchronously - the write might not have completed yet.
#### Related guides
- [How to check for write errors](/influxdb/clustered/write-data/troubleshoot/)
Success. Data is written and queryable.
"400":
content:
application/json:
examples:
measurementSchemaFieldTypeConflict:
summary: (Cloud) field type conflict thrown by an explicit database schema
summary: field type conflict thrown by an explicit database schema
value:
code: invalid
message: 'partial write error (2 written): unable to parse ''air_sensor,service=S1,sensor=L1 temperature="90.5",humidity=70.0 1632850122'': schema: field type for field "temperature" not permitted by schema; got String but expected Float'
orgNotFound:
summary: (OSS) organization not found
value:
code: invalid
message: "failed to decode request body: organization not found"
message: 'failed to parse line protocol: error writing line 2: Unable to insert iox::column_type::field::integer type into column temp with type iox::column_type::field::string'
schema:
$ref: "#/components/schemas/LineProtocolError"
description: |
Bad request. The response body contains detail about the error.
InfluxDB returns this error if the line protocol data in the request is malformed.
InfluxDB returns this error if the line protocol data in the request is malformed or contains a database schema conflict.
The response body contains the first malformed line in the data, and indicates what was expected.
For partial writes, the number of points written and the number of points rejected are also included.
#### InfluxDB Cloud
- Returns this error for database schema conflicts.
"401":
$ref: "#/components/responses/AuthorizationError"
"404":
@ -1665,10 +1632,7 @@ paths:
The request payload is too large.
InfluxDB rejected the batch and did not write any data.
#### InfluxDB Cloud:
- Returns this error if the payload exceeds the 50MB size limit.
- Returns `Content-Type: text/html` for this error.
InfluxDB returns this error if the payload exceeds the size limit.
"429":
description: |
Too many requests.
@ -2029,7 +1993,7 @@ tags:
| &nbsp;Code&nbsp; | Status | Description |
|:-----------:|:------------------------ |:--------------------- |
| `200` | Success | |
| `204` | No content | For a `POST` request, `204` indicates that InfluxDB accepted the request and request data is valid. Asynchronous operations, such as `write`, might not have completed yet. |
| `204` | Success. No content | InfluxDB doesn't return data for the request. For example, a successful write request returns `204` status code, acknowledging that data is written and queryable. |
| `400` | Bad request | InfluxDB can't parse the request due to an incorrect parameter or bad syntax. If line protocol in the request body is malformed. The response body contains the first malformed line and indicates what was expected. For partial writes, the number of points written and the number of points rejected are also included. |
| `401` | Unauthorized | May indicate one of the following: <ul><li>`Authorization: Token` header is missing or malformed</li><li>API token value is missing from the header</li><li>API token doesn't have permission. For more information about token types and permissions, see [Manage tokens](/influxdb/clustered/admin/tokens/)</li></ul> |
| `404` | Not found | Requested resource was not found. `message` in the response body provides details about the requested resource. |

View File

@ -10049,7 +10049,7 @@ paths:
application/octet-stream:
schema:
description: |
GZIP compressed TAR file (`.tar.gz`) that contains
Gzip compressed TAR file (`.tar.gz`) that contains
[Go runtime profile](https://pkg.go.dev/runtime/pprof) reports.
externalDocs:
description: Golang pprof package
@ -14864,7 +14864,7 @@ paths:
- $ref: '#/components/parameters/TraceSpan'
- description: |
The value tells InfluxDB what compression is applied to the line protocol in the request payload.
To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header.
To make an API request with a gzip payload, send `Content-Encoding: gzip` as a request header.
in: header
name: Content-Encoding
schema:
@ -14915,7 +14915,7 @@ paths:
- $ref: '#/components/parameters/TraceSpan'
- description: |
The value tells InfluxDB what compression is applied to the line protocol in the request payload.
To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header.
To make an API request with a gzip payload, send `Content-Encoding: gzip` as a request header.
in: header
name: Content-Encoding
schema:
@ -14962,7 +14962,7 @@ paths:
- $ref: '#/components/parameters/TraceSpan'
- description: |
The value tells InfluxDB what compression is applied to the line protocol in the request payload.
To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header.
To make an API request with a gzip-compressed payload, send `Content-Encoding: gzip` as a request header.
in: header
name: Content-Encoding
schema:
@ -18958,7 +18958,7 @@ paths:
- $ref: '#/components/parameters/TraceSpan'
- description: |
The compression applied to the line protocol in the request payload.
To send a GZIP payload, pass `Content-Encoding: gzip` header.
To send a gzip payload, pass `Content-Encoding: gzip` header.
in: header
name: Content-Encoding
schema:
@ -19085,7 +19085,7 @@ paths:
To send compressed data, do the following:
1. Use [GZIP](https://www.gzip.org/) to compress the line protocol data.
1. Use [gzip](https://www.gzip.org/) to compress the line protocol data.
2. In your request, send the compressed data and the
`Content-Encoding: gzip` header.
@ -19131,8 +19131,6 @@ paths:
InfluxDB returns this error if the line protocol data in the request is malformed.
The response body contains the first malformed line in the data, and indicates what was expected.
For partial writes, the number of points written and the number of points rejected are also included.
For more information, check the `rejected_points` measurement in your `_monitoring` bucket.
#### InfluxDB Cloud
@ -19915,7 +19913,7 @@ tags:
| &nbsp;Code&nbsp; | Status | Description |
|:-----------:|:------------------------ |:--------------------- |
| `200` | Success | |
| `204` | No content | For a `POST` request, `204` indicates that InfluxDB accepted the request and request data is valid. Asynchronous operations, such as `write`, might not have completed yet. |
| `204` | Success. No content | InfluxDB doesn't return data for the request. |
| `400` | Bad request | May indicate one of the following: <ul><li>Line protocol is malformed. The response body contains the first malformed line in the data and indicates what was expected. For partial writes, the number of points written and the number of points rejected are also included. For more information, check the `rejected_points` measurement in your `_monitoring` bucket.</li><li>`Authorization` header is missing or malformed or the API token doesn't have permission for the operation.</li></ul> |
| `401` | Unauthorized | May indicate one of the following: <ul><li>`Authorization: Token` header is missing or malformed</li><li>API token value is missing from the header</li><li>API token doesn't have permission. For more information about token types and permissions, see [Manage API tokens](/influxdb/latest/security/tokens/)</li></ul> |
| `404` | Not found | Requested resource was not found. `message` in the response body provides details about the requested resource. |

View File

@ -0,0 +1,74 @@
---
title: Troubleshoot issues writing data
seotitle: Troubleshoot issues writing data to InfluxDB
weight: 106
description: >
Troubleshoot issues writing data.
Find response codes for failed writes.
Discover how writes fail, from exceeding rate or payload limits, to syntax errors and schema conflicts.
menu:
influxdb_cloud_dedicated:
name: Troubleshoot issues
parent: Write data
influxdb/cloud-dedicated/tags: [write, line protocol, errors]
related:
- /influxdb/cloud-dedicated/reference/syntax/line-protocol/
- /influxdb/cloud-dedicated/write-data/best-practices/
- /influxdb/cloud-dedicated/reference/internals/durability/
---
Learn how to avoid unexpected results and recover from errors when writing to {{% product-name %}}.
<!-- TOC -->
- [Handle write responses](#handle-write-responses)
- [Review HTTP status codes](#review-http-status-codes)
- [Troubleshoot failures](#troubleshoot-failures)
- [Troubleshoot rejected points](#troubleshoot-rejected-points)
<!-- /TOC -->
## Handle `write` responses
In {{% product-name %}}, writes are synchronous.
After InfluxDB validates the request and ingests the data, it sends a _success_ response (HTTP `204` status code) as an acknowledgement that the data is written and queryable.
To ensure that InfluxDB handles writes in the order you request them, wait for the acknowledgement before you send the next request.
If InfluxDB successfully writes all the request data to the database, it returns _success_ (HTTP `204` status code).
The first rejected point in a batch causes InfluxDB to reject the entire batch and respond with an [HTTP error status](#review-http-status-codes).
### Review HTTP status codes
InfluxDB uses conventional HTTP status codes to indicate the success or failure of a request.
The `message` property of the response body may contain additional details about the error.
Write requests return the following status codes:
| HTTP response code | Message | Description |
| :-------------------------------| :--------------------------------------------------------------- | :------------- |
| `204 "Success"` | | If InfluxDB ingested the data |
| `400 "Bad request"` | `message` contains the first malformed line | If data is malformed |
| `401 "Unauthorized"` | | If the `Authorization` header is missing or malformed or if the [token](/influxdb/cloud-dedicated/admin/tokens/) doesn't have [permission](/influxdb/cloud-dedicated/reference/cli/influxctl/token/create/#examples) to write to the database. See [examples using credentials](/influxdb/cloud-dedicated/get-started/write/#write-line-protocol-to-influxdb) in write requests. |
| `404 "Not found"` | requested **resource type** (for example, "organization" or "database"), and **resource name** | If a requested resource (for example, organization or database) wasn't found |
| `500 "Internal server error"` | | Default status for an error |
| `503` "Service unavailable" | | If the server is temporarily unavailable to accept writes. The `Retry-After` header describes when to try the write again.
If your data did not write to the database, see how to [troubleshoot rejected points](#troubleshoot-rejected-points).
## Troubleshoot failures
If you notice data is missing in your database, do the following:
- Check the `message` property in the response body for details about the error.
- If the `message` describes a field error, [troubleshoot rejected points](#troubleshoot-rejected-points).
- Verify all lines contain valid syntax ([line protocol](/influxdb/cloud-dedicated/reference/syntax/line-protocol/)).
- Verify the timestamps in your data match the [precision parameter](/influxdb/cloud-dedicated/reference/glossary/#precision) in your request.
- Minimize payload size and network errors by [optimizing writes](/influxdb/cloud-dedicated/write-data/best-practices/optimize-writes/).
## Troubleshoot rejected points
InfluxDB rejects points for the following reasons:
- The **batch** contains another point with the same series, but one of the fields has a different value type.
- The **bucket** contains another point with the same series, but one of the fields has a different value type.
Check for [field data type](/influxdb/cloud-dedicated/reference/syntax/line-protocol/#data-types-and-format) differences between the missing data point and other points that have the same [series](/influxdb/cloud-dedicated/reference/glossary/#series)--for example, did you attempt to write `string` data to an `int` field?

View File

@ -0,0 +1,75 @@
---
title: Troubleshoot issues writing data
seotitle: Troubleshoot issues writing data to InfluxDB
weight: 106
description: >
Troubleshoot issues writing data. Find response codes for failed writes. Discover how writes fail, from exceeding rate or payload limits, to syntax errors and schema conflicts.
menu:
influxdb_cloud_serverless:
name: Troubleshoot issues
parent: Write data
influxdb/cloud-serverless/tags: [write, line protocol, errors]
related:
- /influxdb/cloud-serverless/reference/syntax/line-protocol/
- /influxdb/cloud-serverless/write-data/best-practices/
- /influxdb/cloud-serverless/reference/internals/durability/
---
Learn how to avoid unexpected results and recover from errors when writing to {{% product-name %}}.
<!-- TOC -->
- [Handle write responses](#handle-write-responses)
- [Review HTTP status codes](#review-http-status-codes)
- [Troubleshoot failures](#troubleshoot-failures)
- [Troubleshoot rejected points](#troubleshoot-rejected-points)
<!-- /TOC -->
## Handle `write` responses
In {{% product-name %}}, writes are synchronous.
After InfluxDB validates the request and ingests the data, it sends a _success_ response (HTTP `204` status code) as an acknowledgement that the data is written and queryable.
To ensure that InfluxDB handles writes in the order you request them, wait for the acknowledgement before you send the next request.
If InfluxDB successfully writes all the request data to the database, it returns _success_ (HTTP `204` status code).
The first rejected point in a batch causes InfluxDB to reject the entire batch and respond with an [HTTP error status](#review-http-status-codes).
### Review HTTP status codes
InfluxDB uses conventional HTTP status codes to indicate the success or failure of a request.
The `message` property of the response body may contain additional details about the error.
Write requests return the following status codes:
| HTTP response code | Message | Description |
| :-------------------------------| :-----------------------------------------------------------------------| :------------- |
| `204 "Success"` | | If InfluxDB ingested the data |
| `400 "Bad request"` | `message` contains the first malformed line | If request data is malformed |
| `401 "Unauthorized"` | | If the `Authorization` header is missing or malformed or if the [token](/influxdb/cloud-serverless/admin/tokens/) doesn't have [permission](/influxdb/cloud-serverless/reference/cli/influxctl/token/create/#examples) to write to the database. See [examples using credentials](/influxdb/cloud-serverless/get-started/write/#write-line-protocol-to-influxdb) in write requests. |
| `404 "Not found"` | requested **resource type** (for example, "organization" or "database"), and **resource name** | If a requested resource (for example, organization or database) wasn't found |
| `413 “Request too large”` | cannot read data: points in batch is too large | If a request exceeds the maximum [global limit](/influxdb/cloud-serverless/admin/billing/limits/) |
| `429 “Too many requests”` | `Retry-After` header: xxx (seconds to wait before retrying the request) | If a request exceeds your plan's [adjustable service quotas](/influxdb/cloud-serverless/admin/billing/limits/#adjustable-service-quotas) |
| `500 "Internal server error"` | | Default status for an error |
| `503` "Service unavailable" | | If the server is temporarily unavailable to accept writes. The `Retry-After` header describes when to try the write again.
The `message` property of the response body may contain additional details about the error.
If your data did not write to the database, see how to [troubleshoot rejected points](#troubleshoot-rejected-points).
## Troubleshoot failures
If you notice data is missing in your database, do the following:
- Check the `message` property in the response body for details about the error.
- If the `message` describes a field error, [troubleshoot rejected points](#troubleshoot-rejected-points).
- Verify all lines contain valid syntax ([line protocol](/influxdb/cloud-serverless/reference/syntax/line-protocol/)).
- Verify the timestamps in your data match the [precision parameter](/influxdb/cloud-serverless/reference/glossary/#precision) in your request.
- Minimize payload size and network errors by [optimizing writes](/influxdb/cloud-serverless/write-data/best-practices/optimize-writes/).
## Troubleshoot rejected points
InfluxDB rejects points for the following reasons:
- The **batch** contains another point with the same series, but one of the fields has a different value type.
- The **bucket** contains another point with the same series, but one of the fields has a different value type.
Check for [field data type](/influxdb/cloud-serverless/reference/syntax/line-protocol/#data-types-and-format) differences between the missing data point and other points that have the same [series](/influxdb/cloud-serverless/reference/glossary/#series)--for example, did you attempt to write `string` data to an `int` field?

View File

@ -0,0 +1,74 @@
---
title: Troubleshoot issues writing data
seotitle: Troubleshoot issues writing data to InfluxDB
weight: 106
description: >
Troubleshoot issues writing data.
Find response codes for failed writes.
Discover how writes fail, from exceeding rate or payload limits, to syntax errors and schema conflicts.
menu:
influxdb_clustered:
name: Troubleshoot issues
parent: Write data
influxdb/clustered/tags: [write, line protocol, errors]
related:
- /influxdb/clustered/reference/syntax/line-protocol/
- /influxdb/clustered/write-data/best-practices/
- /influxdb/clustered/reference/internals/durability/
---
Learn how to avoid unexpected results and recover from errors when writing to {{% product-name %}}.
<!-- TOC -->
- [Handle write responses](#handle-write-responses)
- [Review HTTP status codes](#review-http-status-codes)
- [Troubleshoot failures](#troubleshoot-failures)
- [Troubleshoot rejected points](#troubleshoot-rejected-points)
<!-- /TOC -->
## Handle `write` responses
In {{% product-name %}}, writes are synchronous.
After InfluxDB validates the request and ingests the data, it sends a _success_ response (HTTP `204` status code) as an acknowledgement that the data is written and queryable.
To ensure that InfluxDB handles writes in the order you request them, wait for the acknowledgement before you send the next request.
If InfluxDB successfully writes all the request data to the database, it returns _success_ (HTTP `204` status code).
The first rejected point in a batch causes InfluxDB to reject the entire batch and respond with an [HTTP error status](#review-http-status-codes).
### Review HTTP status codes
InfluxDB uses conventional HTTP status codes to indicate the success or failure of a request.
The `message` property of the response body may contain additional details about the error.
Write requests return the following status codes:
| HTTP response code | Message | Description |
| :-------------------------------| :--------------------------------------------------------------- | :------------- |
| `204 "Success"` | | If InfluxDB ingested the data |
| `400 "Bad request"` | `message` contains the first malformed line | If data is malformed |
| `401 "Unauthorized"` | | If the `Authorization` header is missing or malformed or if the [token](/influxdb/clustered/admin/tokens/) doesn't have [permission](/influxdb/clustered/reference/cli/influxctl/token/create/#examples) to write to the database. See [examples using credentials](/influxdb/clustered/get-started/write/#write-line-protocol-to-influxdb) in write requests. |
| `404 "Not found"` | requested **resource type** (for example, "organization" or "database"), and **resource name** | If a requested resource (for example, organization or database) wasn't found |
| `500 "Internal server error"` | | Default status for an error |
| `503` "Service unavailable" | | If the server is temporarily unavailable to accept writes. The `Retry-After` header describes when to try the write again.
If your data did not write to the database, see how to [troubleshoot rejected points](#troubleshoot-rejected-points).
## Troubleshoot failures
If you notice data is missing in your database, do the following:
- Check the `message` property in the response body for details about the error.
- If the `message` describes a field error, [troubleshoot rejected points](#troubleshoot-rejected-points).
- Verify all lines contain valid syntax ([line protocol](/influxdb/clustered/reference/syntax/line-protocol/)).
- Verify the timestamps in your data match the [precision parameter](/influxdb/clustered/reference/glossary/#precision) in your request.
- Minimize payload size and network errors by [optimizing writes](/influxdb/clustered/write-data/best-practices/optimize-writes/).
## Troubleshoot rejected points
InfluxDB rejects points for the following reasons:
- The **batch** contains another point with the same series, but one of the fields has a different value type.
- The **bucket** contains another point with the same series, but one of the fields has a different value type.
Check for [field data type](/influxdb/clustered/reference/syntax/line-protocol/#data-types-and-format) differences between the missing data point and other points that have the same [series](/influxdb/clustered/reference/glossary/#series)--for example, did you attempt to write `string` data to an `int` field?