You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The [`influxctl --timeout` global flag](/influxdb3/cloud-dedicated/reference/cli/influxctl/) sets the maximum duration for API calls, including query requests.
149
+
If a query takes longer than the specified timeout, the operation will be canceled.
150
+
151
+
### Timeout examples
152
+
153
+
Use different timeout values based on your query type:
154
+
155
+
{{% code-placeholders "DATABASE_(TOKEN|NAME)" %}}
156
+
```sh
157
+
# Shorter timeout for testing dashboard queries (10 seconds)
158
+
influxctl query \
159
+
--timeout 10s \
160
+
--token DATABASE_TOKEN \
161
+
--database DATABASE_NAME \
162
+
"SELECT AVG(temperature) FROM sensors WHERE time >= now() - INTERVAL '1 day'"
163
+
164
+
# Longer timeout for analytical queries (5 minutes)
165
+
influxctl query \
166
+
--timeout 5m \
167
+
--token DATABASE_TOKEN \
168
+
--database DATABASE_NAME \
169
+
"SELECT room, AVG(temperature) FROM sensors WHERE time >= now() - INTERVAL '30 days' GROUP BY room"
170
+
```
171
+
{{% /code-placeholders %}}
172
+
173
+
For guidance on selecting appropriate timeout values, see [Query timeout best practices](/influxdb3/cloud-dedicated/query-data/troubleshoot-and-optimize/query-timeout-best-practices/).
145
174
146
175
## Output format
147
176
@@ -243,7 +272,7 @@ influxctl query \
243
272
{{% /influxdb/custom-timestamps %}}
244
273
245
274
{{< expand-wrapper >}}
246
-
{{% expand "View example results with unix nanosecond timestamps" %}}
275
+
{{% expand "View example results with Unix nanosecond timestamps" %}}
@@ -30,7 +31,9 @@ If a query doesn't return any data, it might be due to the following:
30
31
31
32
- Your data falls outside the time range (or other conditions) in the query--for example, the InfluxQL `SHOW TAG VALUES` command uses a default time range of 1 day.
32
33
- The query (InfluxDB server) timed out.
33
-
- The query client timed out.
34
+
- The query client timed out.
35
+
See [Query timeout best practices](/influxdb3/cloud-dedicated/query-data/troubleshoot-and-optimize/query-timeout-best-practices/)
36
+
for guidance on setting appropriate timeouts.
34
37
- The query return type is not supported by the client library.
35
38
For example, array or list types may not be supported.
36
39
In this case, use `array_to_string()` to convert the array value to a string--for example:
{{% product-name %}} does the following when you send a write request:
30
-
31
-
1. Validates the request.
32
-
2. If successful, attempts to [ingest data](/influxdb3/cloud-dedicated/reference/internals/durability/#data-ingest) from the request body; otherwise, responds with an [error status](#review-http-status-codes).
33
-
3. Ingests or rejects data in the batch and returns one of the following HTTP status codes:
34
-
35
-
-`204 No Content`: All data in the batch is ingested.
36
-
-`400 Bad Request`: Some (_when **partial writes** are configured for the cluster_) or all of the data has been rejected. Data that has not been rejected is ingested and queryable.
37
-
38
-
The response body contains error details about [rejected points](#troubleshoot-rejected-points), up to 100 points.
39
-
40
-
Writes are synchronous--the response status indicates the final status of the write and all ingested data is queryable.
41
-
42
-
To ensure that InfluxDB handles writes in the order you request them,
43
-
wait for the response before you send the next request.
44
-
45
-
### Review HTTP status codes
46
-
47
-
InfluxDB uses conventional HTTP status codes to indicate the success or failure of a request.
48
-
The `message` property of the response body may contain additional details about the error.
49
-
{{< product-name >}} returns one the following HTTP status codes for a write request:
50
-
51
-
| HTTP response code | Response body | Description |
|`204 No Content"`| no response body | If InfluxDB ingested all of the data in the batch |
54
-
|`400 "Bad request"`| error details about rejected points, up to 100 points: `line` contains the first rejected line, `message` describes rejections | If some (_when **partial writes** are configured for the cluster_) or all request data isn't allowed (for example, if it is malformed or falls outside of the bucket's retention period)--the response body indicates whether a partial write has occurred or if all data has been rejected |
55
-
|`401 "Unauthorized"`|| If the `Authorization` header is missing or malformed or if the [token](/influxdb3/cloud-dedicated/admin/tokens/) doesn't have [permission](/influxdb3/cloud-dedicated/reference/cli/influxctl/token/create/#examples) to write to the database. See [examples using credentials](/influxdb3/cloud-dedicated/get-started/write/#write-line-protocol-to-influxdb) in write requests. |
56
-
|`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 |
57
-
| `422 "Unprocessable Entity"` | `message` contains details about the error | If the data isn't allowed (for example, falls outside of the database’s retention period).
58
-
|`500 "Internal server error"`|| Default status for an error |
59
-
| `503 "Service unavailable"` | | If the server is temporarily unavailable to accept writes. The `Retry-After` header contains the number of seconds to wait before trying the write again.
60
-
61
-
The `message` property of the response body may contain additional details about the error.
62
-
If your data did not write to the database, see how to [troubleshoot rejected points](#troubleshoot-rejected-points).
63
-
64
-
## Troubleshoot failures
65
-
66
-
If you notice data is missing in your database, do the following:
67
-
68
-
- Check the [HTTP status code](#review-http-status-codes) in the response.
69
-
- Check the `message` property in the response body for details about the error.
70
-
- If the `message` describes a field error, [troubleshoot rejected points](#troubleshoot-rejected-points).
71
-
- Verify all lines contain valid syntax ([line protocol](/influxdb3/cloud-dedicated/reference/syntax/line-protocol/)).
72
-
- Verify the timestamps in your data match the [precision parameter](/influxdb3/cloud-dedicated/reference/glossary/#precision) in your request.
73
-
- Minimize payload size and network errors by [optimizing writes](/influxdb3/cloud-dedicated/write-data/best-practices/optimize-writes/).
74
-
75
-
## Troubleshoot rejected points
76
-
77
-
When writing points from a batch, InfluxDB rejects points that have syntax errors or schema conflicts.
78
-
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:
79
-
80
-
-`code`: `"invalid"`
81
-
-`line`: the line number of the _first_ rejected point in the batch.
82
-
-`message`: a string that contains line-separated error messages, one message for each rejected point in the batch, up to 100 rejected points.
83
-
84
-
InfluxDB rejects points for the following reasons:
85
-
86
-
- a line protocol parsing error
87
-
- an invalid timestamp
88
-
- a schema conflict
89
-
90
-
Schema conflicts occur when you try to write data that contains any of the following:
91
-
92
-
- a wrong data type: the point falls within the same partition (default partitioning is measurement and day) as existing bucket data and contains a different data type for an existing field
93
-
- a tag and a field that use the same key
94
-
95
-
### Example
96
-
97
-
The following example shows a response body for a write request that contains two rejected points:
98
-
99
-
```json
100
-
{
101
-
"code": "invalid",
102
-
"line": 2,
103
-
"message": "failed to parse line protocol:
104
-
errors encountered on line(s):
105
-
error parsing line 2 (1-based): Invalid measurement was provided
106
-
error parsing line 4 (1-based): Unable to parse timestamp value '123461000000000000000000000000'"
107
-
}
108
-
```
109
-
110
-
Check for [field data type](/influxdb3/cloud-dedicated/reference/syntax/line-protocol/#data-types-and-format) differences between the rejected data point and points within the same database and partition--for example, did you attempt to write `string` data to an `int` field?
@@ -29,7 +30,9 @@ If a query doesn't return any data, it might be due to the following:
29
30
30
31
- Your data falls outside the time range (or other conditions) in the query--for example, the InfluxQL `SHOW TAG VALUES` command uses a default time range of 1 day.
31
32
- The query (InfluxDB server) timed out.
32
-
- The query client timed out.
33
+
- The query client timed out.
34
+
See [Query timeout best practices](/influxdb3/cloud-serverless/query-data/troubleshoot-and-optimize/query-timeout-best-practices/)
35
+
for guidance on setting appropriate timeouts.
33
36
- The query return type is not supported by the client library.
34
37
For example, array or list types may not be supported.
35
38
In this case, use `array_to_string()` to convert the array value to a string--for example:
0 commit comments