Troubleshoot issues writing data
This page documents an earlier version of InfluxDB. InfluxDB v2.7 is the latest stable version. View this page in the v2.7 documentation.
Learn how to handle and recover from errors when writing to InfluxDB.
Discover common failure scenarios
Write requests made to InfluxDB may fail for a number of reasons.
Common failure scenarios that return an HTTP
5xx error status code include the following:
- API token was invalid. . See how to manage API tokens.
- Payload size was too large.
- Client or server reached a timeout threshold.
- Data was not formatted correctly.
To find the causes of a specific error, review HTTP status codes.
Troubleshoot partial writes
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.
To resolve partial writes and rejected points, see troubleshoot failures.
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:
204Success: InfluxDB validated the request data format and accepted the data for writing to the bucket.
204doesn’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.
400Bad 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.
401Unauthorized: May indicate one of the following:
Authorization: Tokenheader is missing or malformed.
- API token 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
404Not 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.
413Request entity too large: All request data was rejected and not written. InfluxDB OSS only returns this error if the Go (golang)
ioutil.ReadAll()function raises an error.
500Internal server error: Default HTTP status for an error.
503Service unavailable: Server is temporarily unavailable to accept writes. The
Retry-Afterheader describes when to try the write again.
message property of the response body may contain additional details about the error.
If you notice data is missing in your bucket, do the following:
- Check the
messageproperty 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 other data points with the same series.
For example, did you attempt to write
stringdata to an
- 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
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.
Was this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for InfluxDB and this documentation. To find support, use the following resources:
InfluxDB Cloud and InfluxDB Enterprise customers can contact InfluxData Support.