Documentation

Troubleshoot issues writing data

Learn how to handle and recover from errors when writing to InfluxDB.

Common failure scenarios

InfluxDB write requests may fail for a number of reasons. Common failure scenarios that return an HTTP 4xx or 5xx error status code include the following:

  • Exceeded a rate limit.
  • API token was invalid.
  • Client or server reached a timeout threshold.
  • Size of the data payload was too large.
  • Data was not formatted correctly.
  • Data did not conform to the explicit bucket schema. See how to troubleshoot specific bucket schema errors.

Writes may fail partially or completely even though InfluxDB returns an HTTP 2xx status code for a valid request. For example, a partial write may occur when InfluxDB writes all points that conform to the bucket schema, but rejects points that have the wrong data type in a field.

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: InfluxDB validated the request data format and accepted the data for writing to the bucket.

    204 doesn’t indicate a successful write operation since writes are asynchronous. If some of your data did not write to the bucket, see how to troubleshoot rejected points.

  • 400 Bad request: The line protocol data in the request was malformed. 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:

  • 404 Not found: A requested resource (e.g. an organization or bucket) was not found. The response body contains the requested resource type, e.g. “organization”, and resource name.

  • 413 Request entity too large: The payload exceeded the 50MB limit. All request data was rejected and not written.

  • 429 Too many requests: API token is temporarily over quota. The Retry-After header describes when to try the write request again.

  • 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.

Troubleshoot failures

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

  • Check the message property in the response body for details about the error.
  • Verify all lines contain valid syntax, e.g. line protocol or CSV.
  • Verify the data types match the bucket schema. For example, did you attempt to write string data to an int field?
  • Verify the timestamps match the precision parameter.
  • Minimize payload size and network errors by optimizing writes

Troubleshoot rejected points

InfluxDB may reject points even if the HTTP request returns “Success”. If some of your data did not write to the bucket, check for field type differences between the missing data point and other points that have the same series. For example, did you attempt to write string data to an int field?

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 a saved point with the same series, but one of the fields has a different value type.

Select your region

Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.