---
title: Troubleshoot issues writing data
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.
url: https://docs.influxdata.com/influxdb/v2/write-data/troubleshoot/
estimated_tokens: 2161
product: InfluxDB OSS v2
version: v2
---

# Troubleshoot issues writing data

This page documents an earlier version of InfluxDB OSS. [InfluxDB 3 Core](/influxdb3/core/) is the latest stable version.

#### API token hashing is enabled by default in InfluxDB OSS 2.9.0

Stronger token security: tokens are stored as hashes on disk, so a copy of the database file doesn’t expose usable tokens. Existing tokens are hashed on first startup and the original strings can’t be recovered afterward — **capture any plaintext tokens you still need before you upgrade**.

For more information, see [Token hashing](/influxdb/v2/admin/tokens/#token-hashing).

Learn how to avoid unexpected results and recover from errors when writing to InfluxDB.

-   [Handle `write` and `delete` responses](#handle-write-and-delete-responses)
-   [Troubleshoot failures](#troubleshoot-failures)
-   [Troubleshoot rejected points](#troubleshoot-rejected-points)

## Handle `write` and `delete` responses

InfluxDB does the following when you send a write request:

1. Validates the request.
    
2. If successful, attempts to [ingest data](/influxdb/v2/reference/internals/durability/#data-ingest) from the request body; otherwise, responds with an [error status](#review-http-status-codes).
    
3. Ingests or rejects data from the batch and returns one of the following HTTP status codes:
    
    -   `204 No Content`: All of the data is ingested and queryable.
    -   `422 Unprocessable Entity`: Some or all of the data has been rejected. Data that has not been rejected is ingested and queryable.
    
    The response body contains error details about [rejected points](#troubleshoot-rejected-points).
    

Writes are synchronous–the response status indicates the final status of the write and all ingested data is queryable.

To ensure that InfluxDB handles writes in the order you request them, wait for the response before you send the next request.

### Review HTTP status codes

InfluxDB uses conventional HTTP status codes to indicate the success or failure of a request. Write requests return the following status codes:

-   `204` **Success**: All request data was written to the bucket.
-   `400` **Bad request**: The response body contains the first malformed line in the data. All request data was rejected and not written.
-   `401` **Unauthorized**: May indicate one of the following:
    -   [`Authorization: Token` header](/influxdb/v2/api-guide/api_intro/#authentication) is missing or malformed.
    -   [API token](/influxdb/v2/api-guide/api_intro/#authentication) value is missing from the header.
    -   API token does not have sufficient permissions to write to the organization and the bucket. For more information about token types and permissions, see [Manage API tokens](/influxdb/v2/admin/tokens/).
-   `404` **Not found**: A requested resource, such as an organization or bucket, was not found. The response body contains the requested resource type (for example, “organization”) and resource name.
-   `413` **Request entity too large**: All request data was rejected and not written. InfluxDB OSS only returns this error if the [Go (golang) `ioutil.ReadAll()`](https://pkg.go.dev/io/ioutil#ReadAll) function raises an error.
-   `422` **Unprocessable entity**: The request was well-formed, but some or all the points were rejected due to semantic errors–for example, schema conflicts or retention policy violations.
-   `500` **Internal server error**: Default HTTP status for an error.
-   `503` **Service unavailable**: 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 some of your data did not write to the bucket, see how to [troubleshoot rejected points](#troubleshoot-rejected-points).

## Troubleshoot failures

If you notice data is missing in your bucket, do the following:

-   Check the [HTTP status code](#review-http-status-codes) in the response.
-   Check the `message` property in the response body for details about the error–for example, `partial write` indicates [rejected points](#troubleshoot-rejected-points).
-   Verify all lines contain valid syntax ([line protocol](/influxdb/v2/reference/syntax/line-protocol/) or [CSV](/influxdb/v2/reference/syntax/annotated-csv/)).
-   Verify the timestamps match the [precision parameter](/influxdb/v2/write-data/#timestamp-precision) in your request.
-   Minimize payload size and network errors by [optimizing writes](/influxdb/v2/write-data/best-practices/optimize-writes/).

## Troubleshoot rejected points

When writing points from a batch, InfluxDB rejects points that have syntax errors or schema conflicts.

If InfluxDB processes the data in your batch and then rejects points, the [HTTP response](#handle-write-responses) body contains the following properties that describe rejected points:

-   `code`: `"unprocessable entity"`
-   `message`: a string that describes the reason points were rejected and may provide details, such as database, retention policy, and which bound was violated.

For example, the following `message` indicates that points were rejected because the timestamps fall outside the `1d` retention policy:

```text
failure writing points to database: partial write: dropped 4 points outside retention policy of duration 24h0m0s - oldest point home,room=Living\\ Room at 1970-01-01T00:00:01.541Z dropped because it violates a Retention Policy Lower Bound at 2025-05-20T19:06:17.612973Z, newest point home,room=Living\\ Room at 1970-01-01T00:00:01.5410006Z dropped because it violates a Retention Policy Lower Bound at 2025-05-20T19:06:17.612973Z dropped=4 for database: 9f282d63c7d3a5c0 for retention policy: autogen
```

InfluxDB rejects points for the following reasons:

-   a line protocol parsing error
-   an invalid timestamp
-   a schema conflict
-   retention policy violation

Schema conflicts occur when you try to write data that contains any of the following:

-   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 type](/influxdb/v2/reference/key-concepts/data-elements/#field-value) differences between the missing data point and other points that have the same [series](/influxdb/v2/reference/key-concepts/data-elements/#series)–for example, did you attempt to write `string` data to an `int` field?

#### Related

-   [InfluxDB v1 API /write endpoint](/influxdb/v2/api/write-data-v1-compatible/#operation/PostLegacyWrite)
-   [InfluxDB API /api/v2/write endpoint](/influxdb/v2/api/write-data/#operation/PostWrite)
-   [InfluxDB internals](/influxdb/v2/reference/internals/)
-   [influx write](/influxdb/v2/reference/cli/influx/write/)

[write](/influxdb/v2/tags/write/) [line protocol](/influxdb/v2/tags/line-protocol/) [errors](/influxdb/v2/tags/errors/)
