Merge branch '6021-add-schedule-plugin-test-docs' of github.com:influxdata/docs-v2 into 6021-add-schedule-plugin-test-docs
commit
4de84bbc9a
|
@ -218,11 +218,11 @@ tags:
|
|||
|:-----------:|:------------------------ |:--------------------- |
|
||||
| `200` | Success | |
|
||||
| `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> |
|
||||
| `400` | Bad request | May indicate one of the following:<ul><li>the request body is malformed</li><li>`Authorization` header is missing or malformed</li><li>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/v2/security/tokens/)</li></ul> |
|
||||
| `404` | Not found | Requested resource was not found. `message` in the response body provides details about the requested resource. |
|
||||
| `413` | Request entity too large | Request payload exceeds the size limit. |
|
||||
| `422` | Unprocessable entity | Request data is invalid. `code` and `message` in the response body provide details about the problem. |
|
||||
| `422` | Unprocessable entity | Request data is invalid. The request was well-formed, but couldn't complete due to semantic errors--for example, some or all points in a write request were rejected due to a schema or retention policy violation. The response body provides details about the problem. For more information about rejected points, see how to [Troubleshoot issues writing data](/influxdb/v2/write-data/troubleshoot/)|
|
||||
| `429` | Too many requests | API token is temporarily over the request quota. The `Retry-After` header describes when to try the request again. |
|
||||
| `500` | Internal server error | |
|
||||
| `503` | Service unavailable | Server is temporarily unavailable to process the request. The `Retry-After` header describes when to try the request again. |
|
||||
|
@ -12752,6 +12752,12 @@ paths:
|
|||
|
||||
- Returns this error only if the [Go (golang) `ioutil.ReadAll()`](https://pkg.go.dev/io/ioutil#ReadAll) function raises an error.
|
||||
- Returns `Content-Type: application/json` for this error.
|
||||
'422':
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
description: 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. Error message contains details for one or more rejected points.
|
||||
'429':
|
||||
description: |
|
||||
Too many requests.
|
||||
|
@ -13190,6 +13196,14 @@ paths:
|
|||
- Legacy Query
|
||||
/write:
|
||||
post:
|
||||
description: |-
|
||||
Writes line protocol to the specified bucket.
|
||||
|
||||
This endpoint provides backward compatibility for InfluxDB 1.x write workloads using tools such as InfluxDB 1.x client libraries, the Telegraf `outputs.influxdb` output plugin, or third-party tools.
|
||||
|
||||
Use this endpoint to send data in [line protocol](https://docs.influxdata.com/influxdb/v2/reference/syntax/line-protocol/) format to InfluxDB.
|
||||
Use query parameters to specify options for writing data.
|
||||
|
||||
operationId: PostLegacyWrite
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/TraceSpan'
|
||||
|
@ -13263,6 +13277,12 @@ paths:
|
|||
schema:
|
||||
$ref: '#/components/schemas/LineProtocolLengthError'
|
||||
description: Write has been rejected because the payload is too large. Error message returns max size supported. All data in body was rejected and not written.
|
||||
'422':
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
description: 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. Error message contains details for one or more rejected points.
|
||||
'429':
|
||||
description: Token is temporarily over quota. The Retry-After header describes when to try the write again.
|
||||
headers:
|
||||
|
|
|
@ -40,6 +40,7 @@ tags:
|
|||
See how to [create a management token](/influxdb3/cloud-dedicated/admin/tokens/management/).
|
||||
|
||||
By default, management tokens in InfluxDB 3 are short-lived tokens issued by an OAuth2 identity provider that grant a specific user administrative access to your InfluxDB cluster. However, for automation purposes, you can manually create management tokens that authenticate directly with your InfluxDB cluster and do not require human interaction with your identity provider.
|
||||
<!-- ReDoc-Inject: <security-definitions> -->
|
||||
- name: Database tokens
|
||||
description: Manage database read/write tokens for a cluster
|
||||
- name: Databases
|
||||
|
|
|
@ -52,7 +52,7 @@ tags:
|
|||
#### Related guides
|
||||
|
||||
- [Manage tokens](/influxdb3/core/admin/tokens/)
|
||||
- [Authentication and authorization](/influxdb3/core/reference/authentication/)
|
||||
- [Authentication and authorization](/influxdb3/core/reference/internals/authentication/)
|
||||
x-traitTag: true
|
||||
- name: Cache data
|
||||
description: |
|
||||
|
|
|
@ -52,7 +52,7 @@ tags:
|
|||
#### Related guides
|
||||
|
||||
- [Manage tokens](/influxdb3/enterprise/admin/tokens/)
|
||||
- [Authentication and authorization](/influxdb3/enterprise/reference/authentication/)
|
||||
- [Authentication and authorization](/influxdb3/enterprise/reference/internals/authentication/)
|
||||
x-traitTag: true
|
||||
- name: Cache data
|
||||
description: |
|
||||
|
@ -1936,8 +1936,6 @@ components:
|
|||
scheme: bearer
|
||||
bearerFormat: JWT
|
||||
description: |
|
||||
_During Alpha release, an API token is not required._
|
||||
|
||||
A Bearer token for authentication.
|
||||
|
||||
Provide the scheme and the API token in the `Authorization` header--for example:
|
||||
|
|
|
@ -19,4 +19,5 @@ source: /shared/influxdb-v2/write-data/troubleshoot.md
|
|||
---
|
||||
|
||||
<!-- The content of this file is at
|
||||
// SOURCE content/shared/influxdb-v2/write-data/troubleshoot.md-->
|
||||
// SOURCE content/shared/influxdb-v2/write-data/troubleshoot.md
|
||||
-->
|
|
@ -164,13 +164,13 @@ gpg: key 7C3D57159FC2F927: public key "InfluxData Package Signing Key <support@i
|
|||
<!--test:setup
|
||||
```sh
|
||||
curl --silent --location --output-dir ~/Downloads -O \
|
||||
"https://download.influxdata.com/influxdb/releases/influxdb2-{{< latest-patch >}}_darwin_amd64.tar.gz" \
|
||||
"https://download.influxdata.com/influxdb/releases/v{{< latest-patch >}}/influxdb2-{{< latest-patch >}}_darwin_amd64.tar.gz" \
|
||||
```
|
||||
-->
|
||||
|
||||
```sh
|
||||
curl --silent --location \
|
||||
https://download.influxdata.com/influxdb/releases/influxdb2-{{< latest-patch >}}_darwin_amd64.tar.gz.asc \
|
||||
https://download.influxdata.com/influxdb/releases/v{{< latest-patch >}}/influxdb2-{{< latest-patch >}}_darwin_amd64.tar.gz.asc \
|
||||
| gpg --verify - ~/Downloads/influxdb2-{{< latest-patch >}}_darwin_amd64.tar.gz \
|
||||
2>&1 | grep 'InfluxData Package Signing Key <support@influxdata.com>'
|
||||
```
|
||||
|
@ -239,12 +239,12 @@ brew install influxdb
|
|||
|
||||
1. In your browser or your terminal, download the InfluxDB package.
|
||||
|
||||
<a class="btn download" href="https://download.influxdata.com/influxdb/releases/influxdb2-{{< latest-patch >}}_darwin_amd64.tar.gz" download>InfluxDB v2 (macOS)</a>
|
||||
<a class="btn download" href="https://download.influxdata.com/influxdb/releases/v{{< latest-patch >}}/influxdb2-{{< latest-patch >}}_darwin_amd64.tar.gz" download>InfluxDB v2 (macOS)</a>
|
||||
|
||||
```sh
|
||||
# Download using cURL
|
||||
curl --location -O \
|
||||
"https://download.influxdata.com/influxdb/releases/influxdb2-{{< latest-patch >}}_darwin_amd64.tar.gz"
|
||||
"https://download.influxdata.com/influxdb/releases/v{{< latest-patch >}}/influxdb2-{{< latest-patch >}}_darwin_amd64.tar.gz"
|
||||
```
|
||||
|
||||
2. {{< req text="Recommended:" color="magenta" >}}: Verify the integrity of the download--for example, enter the
|
||||
|
@ -443,18 +443,18 @@ _If necessary, adjust the example file paths and utilities for your system._
|
|||
1. In your browser or your terminal, download the InfluxDB binary for your
|
||||
system architecture (AMD64 or ARM).
|
||||
|
||||
<a class="btn download" href="https://download.influxdata.com/influxdb/releases/influxdb2-{{< latest-patch >}}_linux_amd64.tar.gz" download >InfluxDB v2 (amd64)</a>
|
||||
<a class="btn download" href="https://download.influxdata.com/influxdb/releases/influxdb2-{{< latest-patch >}}_linux_arm64.tar.gz" download >InfluxDB v2 (arm)</a>
|
||||
<a class="btn download" href="https://download.influxdata.com/influxdb/releases/v{{< latest-patch >}}/influxdb2-{{< latest-patch >}}_linux_amd64.tar.gz" download >InfluxDB v2 (amd64)</a>
|
||||
<a class="btn download" href="https://download.influxdata.com/influxdb/releases/v{{< latest-patch >}}/influxdb2-{{< latest-patch >}}_linux_arm64.tar.gz" download >InfluxDB v2 (arm)</a>
|
||||
|
||||
<!--test:actual
|
||||
```sh
|
||||
curl -s --location -O \
|
||||
"https://download.influxdata.com/influxdb/releases/influxdb2-{{< latest-patch >}}_linux_amd64.tar.gz"
|
||||
"https://download.influxdata.com/influxdb/releases/v{{< latest-patch >}}/influxdb2-{{< latest-patch >}}_linux_amd64.tar.gz"
|
||||
```
|
||||
|
||||
```sh
|
||||
curl -s --location -O \
|
||||
"https://download.influxdata.com/influxdb/releases/influxdb2-{{< latest-patch >}}_linux_arm64.tar.gz"
|
||||
"https://download.influxdata.com/influxdb/releases/v{{< latest-patch >}}/influxdb2-{{< latest-patch >}}_linux_arm64.tar.gz"
|
||||
```
|
||||
-->
|
||||
|
||||
|
@ -463,7 +463,7 @@ _If necessary, adjust the example file paths and utilities for your system._
|
|||
```sh
|
||||
# Use curl to download the amd64 binary.
|
||||
curl --location -O \
|
||||
https://download.influxdata.com/influxdb/releases/influxdb2-{{< latest-patch >}}_linux_amd64.tar.gz
|
||||
https://download.influxdata.com/influxdb/releases/v{{< latest-patch >}}/influxdb2-{{< latest-patch >}}_linux_amd64.tar.gz
|
||||
```
|
||||
|
||||
<!--pytest.mark.skip-->
|
||||
|
@ -471,7 +471,7 @@ _If necessary, adjust the example file paths and utilities for your system._
|
|||
```sh
|
||||
# Use curl to download the arm64 binary.
|
||||
curl --location -O \
|
||||
https://download.influxdata.com/influxdb/releases/influxdb2-{{< latest-patch >}}_linux_arm64.tar.gz
|
||||
https://download.influxdata.com/influxdb/releases/v{{< latest-patch >}}/influxdb2-{{< latest-patch >}}_linux_arm64.tar.gz
|
||||
```
|
||||
|
||||
2. [Choose the InfluxData key-pair for your OS version](#choose-the-influxdata-key-pair-for-your-system).
|
||||
|
@ -505,7 +505,7 @@ _If necessary, adjust the example file paths and utilities for your system._
|
|||
| grep 'InfluxData Package Signing Key <support@influxdata.com>' \
|
||||
&&
|
||||
# Download and verify the binary's signature file
|
||||
curl --silent --location "https://download.influxdata.com/influxdb/releases/influxdb2-{{< latest-patch >}}_linux_amd64.tar.gz.asc" \
|
||||
curl --silent --location "https://download.influxdata.com/influxdb/releases/v{{< latest-patch >}}/influxdb2-{{< latest-patch >}}_linux_amd64.tar.gz.asc" \
|
||||
| gpg --verify - influxdb2-{{< latest-patch >}}_linux_amd64.tar.gz \
|
||||
2>&1 | grep 'InfluxData Package Signing Key <support@influxdata.com>'
|
||||
```
|
||||
|
@ -519,7 +519,7 @@ _If necessary, adjust the example file paths and utilities for your system._
|
|||
| grep 'InfluxData Package Signing Key <support@influxdata.com>' \
|
||||
&&
|
||||
# Download and verify the binary's signature file
|
||||
curl --silent --location "https://download.influxdata.com/influxdb/releases/influxdb2-{{< latest-patch >}}_linux_arm64.tar.gz.asc" \
|
||||
curl --silent --location "https://download.influxdata.com/influxdb/releases/v{{< latest-patch >}}/influxdb2-{{< latest-patch >}}_linux_arm64.tar.gz.asc" \
|
||||
| gpg --verify - influxdb2-{{< latest-patch >}}_linux_arm64.tar.gz \
|
||||
2>&1 | grep 'InfluxData Package Signing Key <support@influxdata.com>'
|
||||
```
|
||||
|
@ -618,7 +618,7 @@ chmod 0750 ~/.influxdbv2
|
|||
>
|
||||
> _You'll install the `influx CLI` in a [later step](#download-install-and-configure-the-influx-cli)._
|
||||
|
||||
<a class="btn download" href="https://download.influxdata.com/influxdb/releases/influxdb2-{{< latest-patch >}}-windows.zip" download >InfluxDB v2 (Windows)</a>
|
||||
<a class="btn download" href="https://download.influxdata.com/influxdb/releases/v{{< latest-patch >}}/influxdb2-{{< latest-patch >}}-windows.zip" download >InfluxDB v2 (Windows)</a>
|
||||
|
||||
Expand the downloaded archive into `C:\Program Files\InfluxData\` and rename the
|
||||
files if desired.
|
||||
|
|
|
@ -2744,6 +2744,61 @@ storage-validate-keys = true
|
|||
|
||||
---
|
||||
|
||||
### storage-wal-flush-on-shutdown
|
||||
Flush the WAL on shutdown.
|
||||
|
||||
**Default:** `false`
|
||||
|
||||
| influxd flag | Environment variable | Configuration key |
|
||||
| :------------------------------ | :------------------------------------ | :---------------------------- |
|
||||
| `--storage-wal-flush-on-shutdown` | `INFLUXD_STORAGE_WAL_FLUSH_ON_SHUTDOWN` | `storage-wal-flush-on-shutdown` |
|
||||
|
||||
If set, `influxd` flushes or snapshots all WALs prior to completing shutdown--`influxd` performs cache snapshots on shutdown, which
|
||||
results in the WAL files being written to TSM files and then deleted.
|
||||
|
||||
This is useful in upgrade and downgrade scenarios to prevent WAL format
|
||||
compatibility issues.
|
||||
|
||||
###### influxd flag
|
||||
<!--pytest.mark.skip-->
|
||||
|
||||
```sh
|
||||
influxd --storage-wal-flush-on-shutdown
|
||||
```
|
||||
|
||||
###### Environment variable
|
||||
```sh
|
||||
export INFLUXD_STORAGE_WAL_FLUSH_ON_SHUTDOWN=true
|
||||
```
|
||||
|
||||
###### Configuration file
|
||||
{{< code-tabs-wrapper >}}
|
||||
{{% code-tabs %}}
|
||||
[YAML](#)
|
||||
[TOML](#)
|
||||
[JSON](#)
|
||||
{{% /code-tabs %}}
|
||||
{{% code-tab-content %}}
|
||||
```yml
|
||||
storage-wal-flush-on-shutdown: true
|
||||
```
|
||||
{{% /code-tab-content %}}
|
||||
{{% code-tab-content %}}
|
||||
```toml
|
||||
storage-wal-flush-on-shutdown = true
|
||||
```
|
||||
{{% /code-tab-content %}}
|
||||
{{% code-tab-content %}}
|
||||
```json
|
||||
{
|
||||
"storage-wal-flush-on-shutdown": true
|
||||
}
|
||||
```
|
||||
{{% /code-tab-content %}}
|
||||
{{< /code-tabs-wrapper >}}
|
||||
|
||||
---
|
||||
|
||||
### storage-wal-fsync-delay
|
||||
Duration a write will wait before fsyncing.
|
||||
A duration greater than `0` batches multiple fsync calls.
|
||||
|
|
|
@ -8,6 +8,27 @@ menu:
|
|||
weight: 101
|
||||
---
|
||||
|
||||
## v2.7.12 {date="2025-05-20"}
|
||||
|
||||
### Features
|
||||
|
||||
- Add a `--pid-file` option to write a PID file to the specified location on startup. InfluxDB removes the PID file on shutdown.
|
||||
- Add a `--storage-wal-flush-on-shutdown` option to flush the WAL on database shutdown to ensure all data is written to disk.
|
||||
- Improve response error messages for dropped points, adding details including database, retention policy, and which bound was violated for partial writes.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Fix a locking issue in `TagValueIterator` that could cause reads and writes in buckets to block. [PR #26414](https://github.com/influxdata/influxdb/pull/26414)
|
||||
|
||||
### Maintenance
|
||||
|
||||
- Improved startup logging with an "are we there yet" counter for the number and percentage of shards opened.
|
||||
- Update Go to 1.23.9.
|
||||
- Update Flux to v0.196.1.
|
||||
- Refresh dependencies to address security vulnerabilities and improve stability.
|
||||
|
||||
---
|
||||
|
||||
## v2.7.11 {date="2024-12-02"}
|
||||
|
||||
### Features
|
||||
|
@ -606,7 +627,7 @@ to migrate InfluxDB key-value metadata schemas to earlier 2.x versions when nece
|
|||
#### Flux
|
||||
|
||||
- Update to [Flux v0.139.0](/flux/v0/release-notes/#v01390).
|
||||
- Enable writing to remote hosts using the Flux [`to()`](/flux/v0/stdlib/influxdata/influxdb/to/) and [`experimental.to()`](/flux/v0/v0.x/stdlib/experimental/to/) functions.
|
||||
- Enable writing to remote hosts using the Flux [`to()`](/flux/v0/stdlib/influxdata/influxdb/to/) and [`experimental.to()`](/flux/v0/stdlib/experimental/to/) functions.
|
||||
- Flux now supports locations that dynamically modify time offsets based on your specified timezone. You can also specify fixed time offsets relative to UTC.
|
||||
- Perform [bitwise operations](/flux/v0/stdlib/experimental/bitwise/)
|
||||
on integers and unsigned integers.
|
||||
|
@ -673,24 +694,24 @@ New features include:
|
|||
|
||||
- Add a new route `/api/v2/resources` that returns a list of known resources to the platform, including the following resource types. Makes it easier to update All Access tokens with current resources:
|
||||
|
||||
- `AuthorizationsResourceType`
|
||||
- `BucketsResourceType`
|
||||
- `ChecksResourceType`
|
||||
- `DashboardsResourceType`
|
||||
- `DBRPResourceType`
|
||||
- `DocumentsResourceType`
|
||||
- `LabelsResourceType`
|
||||
- `NotificationEndpointResourceType`
|
||||
- `NotificationRuleResourceType`
|
||||
- `OrgsResourceType`
|
||||
- `ScraperResourceType`
|
||||
- `SecretsResourceType`
|
||||
- `SourcesResourceType`
|
||||
- `TasksResourceType`
|
||||
- `TelegrafsResourceType`
|
||||
- `UsersResourceType`
|
||||
- `VariablesResourceType`
|
||||
- `ViewsResourceType`
|
||||
- `AuthorizationsResourceType`
|
||||
- `BucketsResourceType`
|
||||
- `ChecksResourceType`
|
||||
- `DashboardsResourceType`
|
||||
- `DBRPResourceType`
|
||||
- `DocumentsResourceType`
|
||||
- `LabelsResourceType`
|
||||
- `NotificationEndpointResourceType`
|
||||
- `NotificationRuleResourceType`
|
||||
- `OrgsResourceType`
|
||||
- `ScraperResourceType`
|
||||
- `SecretsResourceType`
|
||||
- `SourcesResourceType`
|
||||
- `TasksResourceType`
|
||||
- `TelegrafsResourceType`
|
||||
- `UsersResourceType`
|
||||
- `VariablesResourceType`
|
||||
- `ViewsResourceType`
|
||||
|
||||
#### Flux updates
|
||||
|
||||
|
@ -992,10 +1013,10 @@ The startup process automatically generates replacement `tsi1` indexes for shard
|
|||
- Fix timeout setup for `influxd` graceful shutdown.
|
||||
- Require user to set password during initial user onboarding.
|
||||
- Error message improvements:
|
||||
- Remove duplication from task error messages.
|
||||
- Improve error message shown when influx CLI can't find an `org` by name.
|
||||
- Improve error message when opening BoltDB with unsupported file system options.
|
||||
- Improve messages in DBRP API validation errors.
|
||||
- Remove duplication from task error messages.
|
||||
- Improve error message shown when influx CLI can't find an `org` by name.
|
||||
- Improve error message when opening BoltDB with unsupported file system options.
|
||||
- Improve messages in DBRP API validation errors.
|
||||
- `influxd upgrade` improvements:
|
||||
- Add confirmation step with file sizes before copying data files.
|
||||
- Prevent panic in `influxd upgrade` when v1 users exist but v1 config is missing.
|
||||
|
@ -1072,8 +1093,8 @@ Previously, the database retention policy (DBRP) mapping API did not match the s
|
|||
|
||||
### Features
|
||||
- Improvements to upgrade from 1.x to 2.x:
|
||||
- Warning appears if auth is not enabled in 1.x (`auth-enabled = false`), which is not an option in 2.x. For details, see [Upgrade from InfluxDB 1.x to InfluxDB 2.0](/influxdb/v2/upgrade/v1-to-v2/).
|
||||
- `upgrade` command now checks to see if continuous queries are running and automatically exports them to a local file.
|
||||
- Warning appears if auth is not enabled in 1.x (`auth-enabled = false`), which is not an option in 2.x. For details, see [Upgrade from InfluxDB 1.x to InfluxDB 2.0](/influxdb/v2/upgrade/v1-to-v2/).
|
||||
- `upgrade` command now checks to see if continuous queries are running and automatically exports them to a local file.
|
||||
- Upgrade to [Flux v0.95.0](/flux/v0/release-notes/#v0-95-0).
|
||||
- Upgrade `flux-lsp-browser` to v.0.5.23.
|
||||
- Manage database retention policy (DBRP) mappings via CLI. See [`influx v1 dbrp`](/influxdb/v2/reference/cli/influx/v1/dbrp/).
|
||||
|
@ -1117,8 +1138,8 @@ When there are multiple [DBRP mappings](/influxdb/v2/reference/api/influxdb-1x/d
|
|||
Highlights include:
|
||||
|
||||
- Support for **upgrading to InfluxDB 2.0**:
|
||||
- To upgrade **from InfluxDB 1.x**, see [Upgrade from InfluxDB 1.x to InfluxDB 2.0](/influxdb/v2/upgrade/v1-to-v2).
|
||||
- To upgrade **from InfluxDB 2.0 beta 16 or earlier**, see [Upgrade from InfluxDB 2.0 beta to InfluxDB 2.0](/influxdb/v2/upgrade/v2-beta-to-v2).
|
||||
- To upgrade **from InfluxDB 1.x**, see [Upgrade from InfluxDB 1.x to InfluxDB 2.0](/influxdb/v2/upgrade/v1-to-v2).
|
||||
- To upgrade **from InfluxDB 2.0 beta 16 or earlier**, see [Upgrade from InfluxDB 2.0 beta to InfluxDB 2.0](/influxdb/v2/install/upgrade/v2-beta-to-v2/).
|
||||
- **Flux**, our powerful new functional data scripting language designed for querying, analyzing, and acting on data. This release includes [Flux v0.94.0](/flux/v0/release-notes/#v0940). If you're new to Flux, [check out how to get started with Flux](/influxdb/v2/query-data/get-started/). Next, delve deeper into the [Flux standard library](/flux/v0/stdlib//) reference docs and see how to [query with Flux](/influxdb/v2/query-data/flux/).
|
||||
- Support for [InfluxDB 1.x API compatibility](/influxdb/v2/reference/api/influxdb-1x/).
|
||||
- **Templates** and **stacks**. Discover how to [use community templates](/influxdb/v2/tools/influxdb-templates/use/) and how to [manage templates with stacks](/influxdb/v2/tools/influxdb-templates/stacks/).
|
||||
|
@ -1241,14 +1262,14 @@ If you're new to InfluxDB 2.0, we recommend checking out [how to get started](/i
|
|||
{{% warn %}}
|
||||
#### Manual upgrade required
|
||||
|
||||
To simplify the migration for existing users of InfluxDB 1.x, this release includes significant breaking changes that require a manual upgrade from all alpha and beta versions. For more information, see [Upgrade to InfluxDB OSS 2.0rc](/influxdb/v2/upgrade/v2-beta-to-v2/),
|
||||
To simplify the migration for existing users of InfluxDB 1.x, this release includes significant breaking changes that require a manual upgrade from all alpha and beta versions. For more information, see [Upgrade to InfluxDB OSS 2.0rc](/influxdb/v2/install/upgrade/v2-beta-to-v2/),
|
||||
{{% /warn %}}
|
||||
|
||||
### Breaking changes
|
||||
|
||||
#### Manual upgrade
|
||||
|
||||
- To continue using data from InfluxDB 2.0 beta 16 or earlier, you must move all existing data out of the `~/.influxdbv2` (or equivalent) path, including `influxd.bolt`. All existing dashboards, tasks, integrations, alerts, users, and tokens must be recreated. For information on how to migrate your data, see [Upgrade to InfluxDB OSS 2.0rc](/influxdb/v2/upgrade/v2-beta-to-v2/).
|
||||
- To continue using data from InfluxDB 2.0 beta 16 or earlier, you must move all existing data out of the `~/.influxdbv2` (or equivalent) path, including `influxd.bolt`. All existing dashboards, tasks, integrations, alerts, users, and tokens must be recreated. For information on how to migrate your data, see [Upgrade to InfluxDB OSS 2.0rc](/influxdb/v2/install/upgrade/v2-beta-to-v2/).
|
||||
|
||||
#### Port update to 8086
|
||||
|
||||
|
@ -2045,7 +2066,7 @@ _**This will remove all data from your InfluxDB v2.0 instance including time ser
|
|||
|
||||
###### Linux and macOS
|
||||
```sh
|
||||
rm ~/.influxdbv2/influxd.bolt
|
||||
rm -f ~/.influxdbv2/influxd.bolt
|
||||
```
|
||||
|
||||
Once completed, `v2.0.0-alpha.6` can be started.
|
||||
|
@ -2079,7 +2100,7 @@ run the following command.
|
|||
|
||||
###### Linux and macOS
|
||||
```sh
|
||||
rm -r ~/.influxdbv2/engine
|
||||
rm -rf ~/.influxdbv2/engine
|
||||
```
|
||||
|
||||
Once completed, InfluxDB v2.0.0-alpha.5 can be started.
|
||||
|
|
|
@ -13,312 +13,9 @@ related:
|
|||
- /influxdb/v2/api/#tag/Write, InfluxDB API /write endpoint
|
||||
- /influxdb/v2/reference/internals
|
||||
- /influxdb/v2/reference/cli/influx/write
|
||||
source: /shared/influxdb-v2/write-data/troubleshoot.md
|
||||
---
|
||||
Learn how to avoid unexpected results and recover from errors when writing to InfluxDB.
|
||||
|
||||
{{% show-in "v2" %}}
|
||||
|
||||
- [Handle `write` and `delete` responses](#handle-write-and-delete-responses)
|
||||
- [Troubleshoot failures](#troubleshoot-failures)
|
||||
|
||||
{{% /show-in %}}
|
||||
|
||||
{{% show-in "cloud,cloud-serverless" %}}
|
||||
|
||||
- [Handle `write` and `delete` responses](#handle-write-and-delete-responses)
|
||||
- [Troubleshoot failures](#troubleshoot-failures)
|
||||
- [Troubleshoot rejected points](#troubleshoot-rejected-points)
|
||||
|
||||
{{% /show-in %}}
|
||||
|
||||
## Handle `write` and `delete` responses
|
||||
|
||||
{{% show-in "cloud,cloud-serverless" %}}
|
||||
|
||||
In InfluxDB Cloud, writes and deletes are asynchronous and eventually consistent.
|
||||
Once InfluxDB validates your request and [queues](/influxdb/cloud/reference/internals/durability/#backup-on-write) the write or delete, it sends a _success_ response (HTTP `204` status code) as an acknowledgement.
|
||||
To ensure that InfluxDB handles writes and deletes in the order you request them, wait for the acknowledgement before you send the next request.
|
||||
Because writes are asynchronous, keep the following in mind:
|
||||
|
||||
- Data might not yet be queryable when you receive _success_ (HTTP `204` status code).
|
||||
- InfluxDB may still reject points after you receive _success_ (HTTP `204` status code).
|
||||
|
||||
{{% /show-in %}}
|
||||
|
||||
{{% show-in "v2" %}}
|
||||
|
||||
If InfluxDB OSS successfully writes all the request data to the bucket, InfluxDB 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).
|
||||
|
||||
{{% /show-in %}}
|
||||
|
||||
### 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:
|
||||
|
||||
{{% show-in "cloud,cloud-serverless" %}}
|
||||
|
||||
| HTTP response code | Message | Description |
|
||||
| :-------------------------------| :--------------------------------------------------------------- | :------------- |
|
||||
| `204 "Success"` | | If InfluxDB validated the request data format and queued the data for writing to the bucket |
|
||||
| `400 "Bad request"` | `message` contains the first malformed line | If data is malformed |
|
||||
| `401 "Unauthorized"` | | If the [`Authorization: Token` header](/influxdb/cloud/api-guide/api_intro/#authentication) is missing or malformed or if the [API token](/influxdb/cloud/api-guide/api_intro/#authentication) doesn't have [permission](/influxdb/cloud/admin/tokens/) to write to the bucket |
|
||||
| `404 "Not found"` | requested **resource type**, e.g. "organization", and **resource name** | If a requested resource (e.g. organization or bucket) wasn't found |
|
||||
| `413 “Request too large”` | cannot read data: points in batch is too large | If a **write** request exceeds the maximum [global limit](/influxdb/cloud/account-management/limits/#global-limits) |
|
||||
| `429 “Too many requests”` | `Retry-After` header: xxx (seconds to wait before retrying the request) | If a **read** or **write** request exceeds your plan's [adjustable service quotas](/influxdb/cloud/account-management/limits/#adjustable-service-quotas) or if a **delete** request exceeds the maximum [global limit](/influxdb/cloud/account-management/limits/#global-limits) |
|
||||
| `500 "Internal server error"` | | Default status for an error |
|
||||
| `503 “Service unavailable“` | Series cardinality exceeds your plan's service quota | If **series cardinality** exceeds your plan's [adjustable service quotas](/influxdb/cloud/account-management/limits/#adjustable-service-quotas) |
|
||||
|
||||
{{% /show-in %}}
|
||||
|
||||
{{% show-in "v2" %}}
|
||||
|
||||
- `204` **Success**: All request data was written to the bucket.
|
||||
- `400` **Bad request**: The [line protocol](/influxdb/v2/reference/syntax/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:
|
||||
- [`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 (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**: 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.
|
||||
- `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.
|
||||
|
||||
{{% /show-in %}}
|
||||
|
||||
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).
|
||||
|
||||
{{% show-in "cloud,cloud-serverless" %}}
|
||||
|
||||
### Troubleshoot partial writes
|
||||
|
||||
Because writes are asynchronous, they 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 check for writes that fail asynchronously, create a [task](/influxdb/cloud/process-data/manage-tasks/) to [check the _monitoring bucket for rejected points](#review-rejected-points).
|
||||
To resolve partial writes and rejected points, see [troubleshoot failures](#troubleshoot-failures).
|
||||
|
||||
{{% /show-in %}}
|
||||
|
||||
## Troubleshoot failures
|
||||
|
||||
{{% show-in "v2" %}}
|
||||
|
||||
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.
|
||||
- If the `message` describes a field error, [troubleshoot 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).
|
||||
- Minimize payload size and network errors by [optimizing writes](/influxdb/v2/write-data/best-practices/optimize-writes/).
|
||||
|
||||
{{% /show-in %}}
|
||||
|
||||
{{% show-in "cloud,cloud-serverless" %}}
|
||||
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--for example, `partial write error` indicates [rejected points](#troubleshoot-rejected-points).
|
||||
- Check for [rejected points](#troubleshoot-rejected-points) in your organization's `_monitoring` bucket.
|
||||
- Verify all lines contain valid syntax ([line protocol](/influxdb/cloud/reference/syntax/line-protocol/) or [CSV](/influxdb/cloud/reference/syntax/annotated-csv/)). See how to [find parsing errors](#find-parsing-errors).
|
||||
- Verify the data types match the [series](/influxdb/cloud/reference/key-concepts/data-elements/#series) or [bucket schema](/influxdb/cloud/admin/buckets/bucket-schema/). See how to resolve [explicit schema rejections](#resolve-explicit-schema-rejections).
|
||||
- Verify the timestamps match the [precision parameter](/influxdb/cloud/write-data/#timestamp-precision).
|
||||
- Minimize payload size and network errors by [optimizing writes](/influxdb/cloud/write-data/best-practices/optimize-writes/).
|
||||
{{% /show-in %}}
|
||||
|
||||
## Troubleshoot rejected points
|
||||
|
||||
{{% show-in "v2" %}}
|
||||
|
||||
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 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?
|
||||
|
||||
{{% /show-in %}}
|
||||
|
||||
{{% show-in "cloud,cloud-serverless" %}}
|
||||
|
||||
InfluxDB may have rejected points even if the HTTP request returned "Success".
|
||||
InfluxDB logs rejected data points and associated errors to your organization's `_monitoring` bucket.
|
||||
|
||||
- [Review rejected points](#review-rejected-points)
|
||||
- [Find parsing errors](#find-parsing-errors)
|
||||
- [Find data type conflicts and schema rejections](#find-data-type-conflicts-and-schema-rejections)
|
||||
- [Resolve data type conflicts](#resolve-data-type-conflicts)
|
||||
- [Resolve explicit schema rejections](#resolve-explicit-schema-rejections)
|
||||
|
||||
### Review rejected points
|
||||
|
||||
To get a log of rejected points, query the [`rejected_points` measurement](/influxdb/cloud/reference/internals/system-buckets/#_monitoring-bucket-schema) in your organization's `_monitoring` bucket.
|
||||
To more quickly locate `rejected_points`, keep the following in mind:
|
||||
|
||||
- If your line protocol batch contains single lines with multiple [fields](/influxdb/cloud/reference/syntax/line-protocol/#field-set), InfluxDB logs an entry for each point (each unique field) that is rejected.
|
||||
- Each entry contains a `reason` tag that describes why the point was rejected.
|
||||
- Entries for [data type conflicts and schema rejections](#find-data-type-conflicts-and-schema-rejections) have a `count` field value of `1`.
|
||||
- Entries for [parsing errors](#find-parsing-errors) contain an `error` field (and don't contain a `count` field).
|
||||
|
||||
#### rejected_points schema
|
||||
|
||||
| Name | Value |
|
||||
|:------ |:----- |
|
||||
| `_measurement`| `rejected_points` |
|
||||
| `_field` | [`count`](#find-data-type-conflicts-and-schema-rejections) or [`error`](#find-parsing-errors) |
|
||||
| `_value` | [`1`](#find-data-type-conflicts-and-schema-rejections) or [error details](#find-parsing-errors) |
|
||||
| `bucket` | ID of the bucket that rejected the point |
|
||||
| `measurement` | Measurement name of the point |
|
||||
| `field` | Name of the field that caused the rejection |
|
||||
| `reason` | Brief description of the problem. See specific reasons in [data type conflicts and schema rejections](#find-data-type-conflicts-and-schema-rejections) |
|
||||
| `gotType` | Received [field](/influxdb/cloud/reference/key-concepts/data-elements/#field-value) type: `Boolean`, `Float`, `Integer`, `String`, or `UnsignedInteger` |
|
||||
| `wantType` | Expected [field](/influxdb/cloud/reference/key-concepts/data-elements/#field-value) type: `Boolean`, `Float`, `Integer`, `String`, or `UnsignedInteger` |
|
||||
| `<timestamp>` | Time the rejected point was logged |
|
||||
|
||||
#### Find parsing errors
|
||||
|
||||
If InfluxDB can't parse a line (e.g. due to syntax problems), the response `message` might not provide details.
|
||||
To find parsing error details, query `rejected_points` entries that contain the `error` field.
|
||||
|
||||
```js
|
||||
from(bucket: "_monitoring")
|
||||
|> range(start: -1h)
|
||||
|> filter(fn: (r) => r._measurement == "rejected_points")
|
||||
|> filter(fn: (r) => r._field == "error")
|
||||
```
|
||||
|
||||
#### Find data type conflicts and schema rejections
|
||||
|
||||
To find `rejected_points` caused by [data type conflicts](#resolve-data-type-conflicts) or [schema rejections](#resolve-explicit-schema-rejections),
|
||||
query for the `count` field.
|
||||
|
||||
```js
|
||||
from(bucket: "_monitoring")
|
||||
|> range(start: -1h)
|
||||
|> filter(fn: (r) => r._measurement == "rejected_points")
|
||||
|> filter(fn: (r) => r._field == "count")
|
||||
```
|
||||
|
||||
### Resolve data type conflicts
|
||||
|
||||
When you write to a bucket that has the `implicit` schema type, InfluxDB compares new points to points that have the same [series](/influxdb/cloud/reference/key-concepts/data-elements/#series).
|
||||
If a point has a field with a different data type than the series, InfluxDB rejects the point and logs a `rejected_points` entry.
|
||||
The `rejected_points` entry contains one of the following reasons:
|
||||
|
||||
| Reason | Meaning |
|
||||
|:------ |:------- |
|
||||
| `type conflict in batch write` | The **batch** contains another point with the same series, but one of the fields has a different value type. |
|
||||
| `type conflict with existing data` | The **bucket** contains another point with the same series, but one of the fields has a different value type. |
|
||||
|
||||
### Resolve explicit schema rejections
|
||||
|
||||
If you write to a bucket with an
|
||||
[explicit schema](/influxdb/cloud/admin/buckets/bucket-schema/),
|
||||
the data must conform to the schema. Otherwise, InfluxDB rejects the data.
|
||||
|
||||
Do the following to interpret explicit schema rejections:
|
||||
|
||||
- [Detect a measurement mismatch](#detect-a-measurement-mismatch)
|
||||
- [Detect a field type mismatch](#detect-a-field-type-mismatch)
|
||||
|
||||
#### Detect a measurement mismatch
|
||||
|
||||
InfluxDB rejects a point if the [measurement](/influxdb/cloud/reference/key-concepts/data-elements/#measurement) doesn't match the **name** of a [bucket schema](/influxdb/cloud/admin/buckets/bucket-schema/).
|
||||
The `rejected_points` entry contains the following `reason` tag value:
|
||||
|
||||
| Reason | Meaning |
|
||||
|:------ |:-------
|
||||
| `measurement not allowed by schema` | The **bucket** is configured to use explicit schemas and none of the schemas matches the **measurement** of the point. |
|
||||
|
||||
Consider the following [line protocol](/influxdb/cloud/reference/syntax/line-protocol) data.
|
||||
|
||||
```
|
||||
airSensors,sensorId=TLM0201 temperature=73.97,humidity=35.23,co=0.48 1637014074
|
||||
```
|
||||
|
||||
The line has an `airSensors` measurement and three fields (`temperature`, `humidity`, and `co`).
|
||||
If you try to write this data to a bucket that has the [`explicit` schema type](/influxdb/cloud/admin/buckets/bucket-schema/) and doesn't have an `airSensors` schema, the `/api/v2/write` InfluxDB API returns an error and the following data:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": "invalid",
|
||||
"message": "3 out of 3 points rejected (check rejected_points in your _monitoring bucket for further information)"
|
||||
}
|
||||
```
|
||||
|
||||
InfluxDB logs three `rejected_points` entries, one for each field.
|
||||
|
||||
| _measurement | _field | _value | field | measurement | reason |
|
||||
|:----------------|:-------|:-------|:------------|:------------|:----------------------------------|
|
||||
| rejected_points | count | 1 | humidity | airSensors | measurement not allowed by schema |
|
||||
| rejected_points | count | 1 | co | airSensors | measurement not allowed by schema |
|
||||
| rejected_points | count | 1 | temperature | airSensors | measurement not allowed by schema |
|
||||
|
||||
#### Detect a field type mismatch
|
||||
|
||||
InfluxDB rejects a point if the [measurement](/influxdb/cloud/reference/key-concepts/data-elements/#measurement) matches the **name** of a bucket schema and the field data types don't match.
|
||||
The `rejected_points` entry contains the following reason:
|
||||
|
||||
| Reason | Meaning |
|
||||
|:------------------------------------|:-----------------------------------------------------------------------------------------------------|
|
||||
| `field type mismatch with schema` | The point has the same measurement as a configured schema and they have different field value types. |
|
||||
|
||||
Consider a bucket that has the following `airSensors` [`explicit bucket schema`](/influxdb/cloud/admin/buckets/bucket-schema/):
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "airSensors",
|
||||
"columns": [
|
||||
{
|
||||
"name": "time",
|
||||
"type": "timestamp"
|
||||
},
|
||||
{
|
||||
"name": "sensorId",
|
||||
"type": "tag"
|
||||
},
|
||||
{
|
||||
"name": "temperature",
|
||||
"type": "field",
|
||||
"dataType": "float"
|
||||
},
|
||||
{
|
||||
"name": "humidity",
|
||||
"type": "field",
|
||||
"dataType": "float"
|
||||
},
|
||||
{
|
||||
"name": "co",
|
||||
"type": "field",
|
||||
"dataType": "float"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
The following [line protocol](/influxdb/cloud/reference/syntax/line-protocol/) data has an `airSensors` measurement, a `sensorId` tag, and three fields (`temperature`, `humidity`, and `co`).
|
||||
|
||||
```
|
||||
airSensors,sensorId=L1 temperature=90.5,humidity=70.0,co=0.2 1637014074
|
||||
airSensors,sensorId=L1 temperature="90.5",humidity=70.0,co=0.2 1637014074
|
||||
```
|
||||
|
||||
In the example data above, the second point has a `temperature` field value with the _string_ data type.
|
||||
Because the `airSensors` schema requires `temperature` to have the _float_ data type,
|
||||
InfluxDB returns a `400` error and a message that describes the result:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": "invalid",
|
||||
"message": "partial write error (5 accepted): 1 out of 6 points rejected (check rejected_points in your _monitoring bucket for further information)"
|
||||
}
|
||||
```
|
||||
|
||||
InfluxDB logs the following `rejected_points` entry to the `_monitoring` bucket:
|
||||
|
||||
| _measurement | _field | _value | bucket | field | gotType | measurement | reason | wantType |
|
||||
|:------------------|:-------|:-------|:-------------------|:--------------|:---------|:------------|:----------------------------------|:---------|
|
||||
| rejected_points | count | 1 | a7d5558b880a93da | temperature | String | airSensors | field type mismatch with schema | Float |
|
||||
|
||||
{{% /show-in %}}
|
||||
<!-- The content of this file is at
|
||||
// SOURCE content/shared/influxdb-v2/write-data/troubleshoot.md
|
||||
-->
|
|
@ -175,7 +175,7 @@ influxdb:3-{{< product-key >}}
|
|||
container_name: influxdb3-{{< product-key >}}
|
||||
image: influxdb:3-{{< product-key >}}
|
||||
ports:
|
||||
- 9999:9999
|
||||
- 8181:8181
|
||||
command:
|
||||
- influxdb3
|
||||
- serve
|
||||
|
|
|
@ -13,7 +13,7 @@ related:
|
|||
- /influxdb3/core/reference/cli/influxdb3/query/
|
||||
- /influxdb3/core/reference/sql/
|
||||
- /influxdb3/core/reference/influxql/
|
||||
# - /influxdb3/core/get-started/query/#execute-an-sql-query, Get started querying data
|
||||
# - /influxdb3/core/query-data/execute-queries/, Get started querying data
|
||||
list_code_example: |
|
||||
```sh
|
||||
influxdb3 query \
|
||||
|
|
|
@ -13,7 +13,7 @@ related:
|
|||
- /influxdb3/enterprise/reference/cli/influxdb3/query/
|
||||
- /influxdb3/enterprise/reference/sql/
|
||||
- /influxdb3/enterprise/reference/influxql/
|
||||
# - /influxdb3/enterprise/get-started/query/#execute-an-sql-query, Get started querying data
|
||||
# - /influxdb3/enterprise/query-data/execute-queries/, Get started querying data
|
||||
list_code_example: |
|
||||
```sh
|
||||
influxdb3 query \
|
||||
|
|
|
@ -8,5 +8,5 @@ For more information, see the [C# client example on GitHub](https://github.com/a
|
|||
> We recommend using the [`influxdb3-csharp` C# client library](/influxdb3/version/reference/client-libraries/v3/csharp/) for integrating InfluxDB 3 with your C# application code.
|
||||
>
|
||||
> [InfluxDB 3 client libraries](/influxdb3/version/reference/client-libraries/v3/) wrap Apache Arrow Flight clients
|
||||
> and provide convenient methods for [writing](/influxdb3/version/get-started/write/#write-line-protocol-to-influxdb), [querying](/influxdb3/version/get-started/query/#execute-an-sql-query), and processing data stored in {{% product-name %}}.
|
||||
> and provide convenient methods for [writing](/influxdb3/version/write-data/api-client-libraries/), [querying](/influxdb3/version/query-data/execute-queries/), and processing data stored in {{% product-name %}}.
|
||||
> Client libraries can query using SQL or InfluxQL.
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
> We recommend using the [`influxdb3-go` Go client library](/influxdb3/version/reference/client-libraries/v3/go/) for integrating InfluxDB 3 with your Go application code.
|
||||
>
|
||||
> [InfluxDB 3 client libraries](/influxdb3/version/reference/client-libraries/v3/) wrap Apache Arrow Flight clients
|
||||
> and provide convenient methods for [writing](/influxdb3/version/get-started/write/#write-line-protocol-to-influxdb), [querying](/influxdb3/version/get-started/query/#execute-an-sql-query), and processing data stored in {{% product-name %}}.
|
||||
> and provide convenient methods for [writing](/influxdb3/version/write-data/api-client-libraries/), [querying](/influxdb3/version/query-data/execute-queries/), and processing data stored in {{% product-name %}}.
|
||||
> Client libraries can query using SQL or InfluxQL.
|
||||
|
||||
## Flight SQL client
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
> We recommend using the [`influxdb3-java` Java client library](/influxdb3/version/reference/client-libraries/v3/java/) for integrating InfluxDB 3 with your Java application code.
|
||||
>
|
||||
> [InfluxDB 3 client libraries](/influxdb3/version/reference/client-libraries/v3/) wrap Apache Arrow Flight clients
|
||||
> and provide convenient methods for [writing](/influxdb3/version/get-started/write/#write-line-protocol-to-influxdb), [querying](/influxdb3/version/get-started/query/#execute-an-sql-query), and processing data stored in {{% product-name %}}.
|
||||
> and provide convenient methods for [writing](/influxdb3/version/write-data/api-client-libraries/), [querying](/influxdb3/version/query-data/execute-queries/), and processing data stored in {{% product-name %}}.
|
||||
> Client libraries can query using SQL or InfluxQL.
|
||||
|
||||
<!-- TOC -->
|
||||
|
|
|
@ -6,21 +6,20 @@
|
|||
> We recommend using the [`influxdb3-python` Python client library](/influxdb3/version/reference/client-libraries/v3/python/) for integrating InfluxDB 3 with your Python application code.
|
||||
>
|
||||
> [InfluxDB 3 client libraries](/influxdb3/version/reference/client-libraries/v3/) wrap Apache Arrow Flight clients
|
||||
> and provide convenient methods for [writing](/influxdb3/version/get-started/write/#write-line-protocol-to-influxdb), [querying](/influxdb3/version/get-started/query/#execute-an-sql-query), and processing data stored in {{% product-name %}}.
|
||||
> and provide convenient methods for [writing](/influxdb3/version/write-data/api-client-libraries/), [querying](/influxdb3/version/query-data/execute-queries/), and processing data stored in {{% product-name %}}.
|
||||
> Client libraries can query using SQL or InfluxQL.
|
||||
|
||||
The following examples show how to use the `pyarrow.flight` and `pandas` Python modules to query and format data stored in an {{% product-name %}} database:
|
||||
|
||||
{{% code-tabs-wrapper %}}
|
||||
{{< code-tabs-wrapper >}}
|
||||
{{% code-tabs %}}
|
||||
[SQL](#sql-python)
|
||||
[InfluxQL](#influxql-python)
|
||||
{{% /code-tabs %}}
|
||||
|
||||
{{% code-tab-content %}}
|
||||
<!-- BEGIN SQL -->
|
||||
{{% code-placeholders "DATABASE_NAME|DATABASE_TOKEN" %}}
|
||||
```py
|
||||
```python
|
||||
# Using pyarrow>=12.0.0 FlightClient
|
||||
from pyarrow.flight import FlightClient, Ticket, FlightCallOptions
|
||||
import json
|
||||
|
@ -62,7 +61,7 @@ print(data_frame.to_markdown())
|
|||
{{% code-tab-content %}}
|
||||
<!-- BEGIN INFLUXQL -->
|
||||
{{% code-placeholders "DATABASE_NAME|DATABASE_TOKEN" %}}
|
||||
```py
|
||||
```python
|
||||
# Using pyarrow>=12.0.0 FlightClient
|
||||
from pyarrow.flight import FlightClient, Ticket, FlightCallOptions
|
||||
import json
|
||||
|
@ -97,6 +96,7 @@ print(data_frame.to_markdown())
|
|||
{{% /code-placeholders %}}
|
||||
<!-- END INFLUXQL -->
|
||||
{{% /code-tab-content %}}
|
||||
{{< /code-tabs-wrapper >}}
|
||||
|
||||
Replace the following:
|
||||
|
||||
|
@ -104,5 +104,3 @@ Replace the following:
|
|||
- {{% code-placeholder-key %}}`DATABASE_TOKEN`{{% /code-placeholder-key %}}:
|
||||
a [database token](/influxdb3/version/admin/tokens/database/)
|
||||
with sufficient permissions to the specified database
|
||||
|
||||
{{% /code-tabs-wrapper %}}
|
||||
|
|
|
@ -6,7 +6,7 @@ The [Python `flightsql-dbapi` Flight SQL DBAPI library](https://github.com/influ
|
|||
> We recommend using the [`influxdb3-python` Python client library](/influxdb3/version/reference/client-libraries/v3/python/) for integrating InfluxDB 3 with your Python application code.
|
||||
>
|
||||
> [InfluxDB 3 client libraries](/influxdb3/version/reference/client-libraries/v3/) wrap Apache Arrow Flight clients
|
||||
> and provide convenient methods for [writing](/influxdb3/version/get-started/write/#write-line-protocol-to-influxdb), [querying](/influxdb3/version/get-started/query/#execute-an-sql-query), and processing data stored in {{% product-name %}}.
|
||||
> and provide convenient methods for [writing](/influxdb3/version/write-data/api-client-libraries/), [querying](/influxdb3/version/query-data/execute-queries/), and processing data stored in {{% product-name %}}.
|
||||
> Client libraries can query using SQL or InfluxQL.
|
||||
|
||||
## Installation
|
||||
|
@ -32,7 +32,7 @@ from flightsql import FlightSQLClient
|
|||
```
|
||||
|
||||
- `flightsql.FlightSQLClient` class: an interface for [initializing
|
||||
a client](#initialization) and interacting with a Flight SQL server.
|
||||
a client](#initialize-a-client) and interacting with a Flight SQL server.
|
||||
|
||||
## API reference
|
||||
|
||||
|
@ -41,11 +41,11 @@ a client](#initialization) and interacting with a Flight SQL server.
|
|||
- [Initialize a client](#initialize-a-client)
|
||||
- [Instance methods](#instance-methods)
|
||||
- [FlightSQLClient.execute](#flightsqlclientexecute)
|
||||
- [Syntax {#execute-query-syntax}](#syntax-execute-query-syntax)
|
||||
- [Example {#execute-query-example}](#example-execute-query-example)
|
||||
- [Syntax](#execute-query-syntax)
|
||||
- [Example](#execute-query-example)
|
||||
- [FlightSQLClient.do_get](#flightsqlclientdo_get)
|
||||
- [Syntax {#retrieve-data-syntax}](#syntax-retrieve-data-syntax)
|
||||
- [Example {#retrieve-data-example}](#example-retrieve-data-example)
|
||||
- [Syntax](#retrieve-data-syntax)
|
||||
- [Example](#retrieve-data-example)
|
||||
|
||||
## Class FlightSQLClient
|
||||
|
||||
|
|
|
@ -0,0 +1,345 @@
|
|||
|
||||
Learn how to avoid unexpected results and recover from errors when writing to InfluxDB.
|
||||
|
||||
{{% show-in "v2,cloud" %}}
|
||||
|
||||
- [Handle `write` and `delete` responses](#handle-write-and-delete-responses)
|
||||
- [Troubleshoot failures](#troubleshoot-failures)
|
||||
- [Troubleshoot rejected points](#troubleshoot-rejected-points)
|
||||
|
||||
{{% /show-in %}}
|
||||
|
||||
## Handle `write` and `delete` responses
|
||||
|
||||
{{% show-in "cloud" %}}
|
||||
|
||||
In InfluxDB Cloud, writes and deletes are asynchronous and eventually consistent.
|
||||
Once InfluxDB validates your request and [queues](/influxdb/cloud/reference/internals/durability/#backup-on-write) the write or delete, it sends a _success_ response (HTTP `204` status code) as an acknowledgement.
|
||||
To ensure that InfluxDB handles writes and deletes in the order you request them, wait for the acknowledgement before you send the next request.
|
||||
Because writes are asynchronous, keep the following in mind:
|
||||
|
||||
- Data might not yet be queryable when you receive _success_ (HTTP `204` status code).
|
||||
- InfluxDB may still reject points after you receive _success_ (HTTP `204` status code).
|
||||
|
||||
{{% /show-in %}}
|
||||
|
||||
{{% show-in "v2" %}}
|
||||
|
||||
{{% product-name %}} 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.
|
||||
|
||||
{{% /show-in %}}
|
||||
|
||||
### 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:
|
||||
|
||||
{{% show-in "cloud" %}}
|
||||
|
||||
| HTTP response code | Message | Description |
|
||||
| :-------------------------------| :--------------------------------------------------------------- | :------------- |
|
||||
| `204 "Success"` | | If InfluxDB validated the request data format and queued the data for writing to the bucket |
|
||||
| `400 "Bad request"` | `message` contains the first malformed line | If data is malformed |
|
||||
| `401 "Unauthorized"` | | If the [`Authorization: Token` header](/influxdb/cloud/api-guide/api_intro/#authentication) is missing or malformed or if the [API token](/influxdb/cloud/api-guide/api_intro/#authentication) doesn't have [permission](/influxdb/cloud/admin/tokens/) to write to the bucket |
|
||||
| `404 "Not found"` | requested **resource type** (for example, "organization") and **resource name** | If a requested resource, such as an organization or bucket, wasn't found |
|
||||
| `413 "Request too large"` | cannot read data: points in batch is too large | If a **write** request exceeds the maximum [global limit](/influxdb/cloud/account-management/limits/#global-limits) |
|
||||
| `429 “Too many requests”` | `Retry-After` header: xxx (seconds to wait before retrying the request) | If a **read** or **write** request exceeds your plan's [adjustable service quotas](/influxdb/cloud/account-management/limits/#adjustable-service-quotas) or if a **delete** request exceeds the maximum [global limit](/influxdb/cloud/account-management/limits/#global-limits) |
|
||||
| `500 "Internal server error"` | | Default status for an error |
|
||||
| `503 “Service unavailable“` | Series cardinality exceeds your plan's service quota | If **series cardinality** exceeds your plan's [adjustable service quotas](/influxdb/cloud/account-management/limits/#adjustable-service-quotas) |
|
||||
|
||||
{{% /show-in %}}
|
||||
|
||||
{{% show-in "v2" %}}
|
||||
|
||||
- `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.
|
||||
|
||||
{{% /show-in %}}
|
||||
|
||||
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).
|
||||
|
||||
{{% show-in "cloud" %}}
|
||||
|
||||
### Troubleshoot partial writes
|
||||
|
||||
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 check for writes that fail asynchronously, create a [task](/influxdb/cloud/process-data/manage-tasks/) to [check the _monitoring bucket for rejected points](#review-rejected-points).
|
||||
To resolve partial writes and rejected points, see [troubleshoot failures](#troubleshoot-failures).
|
||||
|
||||
{{% /show-in %}}
|
||||
|
||||
## Troubleshoot failures
|
||||
|
||||
{{% show-in "v2" %}}
|
||||
|
||||
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/).
|
||||
|
||||
{{% /show-in %}}
|
||||
|
||||
{{% show-in "cloud" %}}
|
||||
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--for example, `partial write error` indicates [rejected points](#troubleshoot-rejected-points).
|
||||
- Check for [rejected points](#troubleshoot-rejected-points) in your organization's `_monitoring` bucket.
|
||||
- Verify all lines contain valid syntax ([line protocol](/influxdb/cloud/reference/syntax/line-protocol/) or [CSV](/influxdb/cloud/reference/syntax/annotated-csv/)). See how to [find parsing errors](#find-parsing-errors).
|
||||
- Verify the data types match the [series](/influxdb/cloud/reference/key-concepts/data-elements/#series) or [bucket schema](/influxdb/cloud/admin/buckets/bucket-schema/). See how to resolve [explicit schema rejections](#resolve-explicit-schema-rejections).
|
||||
- Verify the timestamps match the [precision parameter](/influxdb/cloud/write-data/#timestamp-precision).
|
||||
- Minimize payload size and network errors by [optimizing writes](/influxdb/cloud/write-data/best-practices/optimize-writes/).
|
||||
|
||||
{{% /show-in %}}
|
||||
|
||||
## Troubleshoot rejected points
|
||||
|
||||
{{% show-in "v2" %}}
|
||||
|
||||
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?
|
||||
|
||||
{{% /show-in %}}
|
||||
|
||||
{{% show-in "cloud" %}}
|
||||
|
||||
When you receive an HTTP `204` (Success) status code, InfluxDB has validated your request format and queued your data for writing.
|
||||
However, {{% product-name %}} processes data asynchronously, which means points may still be rejected after you receive a success response.
|
||||
|
||||
InfluxDB may reject points for several reasons:
|
||||
- Line protocol parsing errors
|
||||
- Invalid timestamps
|
||||
- Data type conflicts with existing schema
|
||||
- Retention policy violations
|
||||
- Series cardinality exceeding your plan's limits
|
||||
|
||||
To verify if your data was successfully written, query your data or check the `_monitoring` bucket for rejected points.
|
||||
|
||||
- [Review rejected points](#review-rejected-points)
|
||||
- [Find parsing errors](#find-parsing-errors)
|
||||
- [Find data type conflicts and schema rejections](#find-data-type-conflicts-and-schema-rejections)
|
||||
- [Resolve data type conflicts](#resolve-data-type-conflicts)
|
||||
- [Resolve explicit schema rejections](#resolve-explicit-schema-rejections)
|
||||
|
||||
### Review rejected points
|
||||
|
||||
To get a log of rejected points, query the [`rejected_points` measurement](/influxdb/cloud/reference/internals/system-buckets/#_monitoring-bucket-schema) in your organization's `_monitoring` bucket.
|
||||
To more quickly locate `rejected_points`, keep the following in mind:
|
||||
|
||||
- If your line protocol batch contains single lines with multiple [fields](/influxdb/cloud/reference/syntax/line-protocol/#field-set), InfluxDB logs an entry for each point (each unique field) that is rejected.
|
||||
- Each entry contains a `reason` tag that describes why the point was rejected.
|
||||
- Entries for [data type conflicts and schema rejections](#find-data-type-conflicts-and-schema-rejections) have a `count` field value of `1`.
|
||||
- Entries for [parsing errors](#find-parsing-errors) contain an `error` field (and don't contain a `count` field).
|
||||
|
||||
#### rejected_points schema
|
||||
|
||||
| Name | Value |
|
||||
|:------ |:----- |
|
||||
| `_measurement`| `rejected_points` |
|
||||
| `_field` | [`count`](#find-data-type-conflicts-and-schema-rejections) or [`error`](#find-parsing-errors) |
|
||||
| `_value` | [`1`](#find-data-type-conflicts-and-schema-rejections) or [error details](#find-parsing-errors) |
|
||||
| `bucket` | ID of the bucket that rejected the point |
|
||||
| `measurement` | Measurement name of the point |
|
||||
| `field` | Name of the field that caused the rejection |
|
||||
| `reason` | Brief description of the problem. See specific reasons in [data type conflicts and schema rejections](#find-data-type-conflicts-and-schema-rejections) |
|
||||
| `gotType` | Received [field](/influxdb/cloud/reference/key-concepts/data-elements/#field-value) type: `Boolean`, `Float`, `Integer`, `String`, or `UnsignedInteger` |
|
||||
| `wantType` | Expected [field](/influxdb/cloud/reference/key-concepts/data-elements/#field-value) type: `Boolean`, `Float`, `Integer`, `String`, or `UnsignedInteger` |
|
||||
| `<timestamp>` | Time the rejected point was logged |
|
||||
|
||||
#### Find parsing errors
|
||||
|
||||
If InfluxDB can't parse a line (for example, due to syntax problems), the response `message` might not provide details.
|
||||
To find parsing error details, query `rejected_points` entries that contain the `error` field.
|
||||
|
||||
```js
|
||||
from(bucket: "_monitoring")
|
||||
|> range(start: -1h)
|
||||
|> filter(fn: (r) => r._measurement == "rejected_points")
|
||||
|> filter(fn: (r) => r._field == "error")
|
||||
```
|
||||
|
||||
#### Find data type conflicts and schema rejections
|
||||
|
||||
To find `rejected_points` caused by [data type conflicts](#resolve-data-type-conflicts) or [schema rejections](#resolve-explicit-schema-rejections),
|
||||
query for the `count` field.
|
||||
|
||||
```js
|
||||
from(bucket: "_monitoring")
|
||||
|> range(start: -1h)
|
||||
|> filter(fn: (r) => r._measurement == "rejected_points")
|
||||
|> filter(fn: (r) => r._field == "count")
|
||||
```
|
||||
|
||||
### Resolve data type conflicts
|
||||
|
||||
When you write to a bucket that has the `implicit` schema type, InfluxDB compares new points to points that have the same [series](/influxdb/cloud/reference/key-concepts/data-elements/#series).
|
||||
If a point has a field with a different data type than the series, InfluxDB rejects the point and logs a `rejected_points` entry.
|
||||
The `rejected_points` entry contains one of the following reasons:
|
||||
|
||||
| Reason | Meaning |
|
||||
|:------ |:------- |
|
||||
| `type conflict in batch write` | The **batch** contains another point with the same series, but one of the fields has a different value type. |
|
||||
| `type conflict with existing data` | The **bucket** contains another point with the same series, but one of the fields has a different value type. |
|
||||
|
||||
### Resolve explicit schema rejections
|
||||
|
||||
If you write to a bucket with an
|
||||
[explicit schema](/influxdb/cloud/admin/buckets/bucket-schema/),
|
||||
the data must conform to the schema. Otherwise, InfluxDB rejects the data.
|
||||
|
||||
Do the following to interpret explicit schema rejections:
|
||||
|
||||
- [Detect a measurement mismatch](#detect-a-measurement-mismatch)
|
||||
- [Detect a field type mismatch](#detect-a-field-type-mismatch)
|
||||
|
||||
#### Detect a measurement mismatch
|
||||
|
||||
InfluxDB rejects a point if the [measurement](/influxdb/cloud/reference/key-concepts/data-elements/#measurement) doesn't match the **name** of a [bucket schema](/influxdb/cloud/admin/buckets/bucket-schema/).
|
||||
The `rejected_points` entry contains the following `reason` tag value:
|
||||
|
||||
| Reason | Meaning |
|
||||
|:------ |:-------
|
||||
| `measurement not allowed by schema` | The **bucket** is configured to use explicit schemas and none of the schemas matches the **measurement** of the point. |
|
||||
|
||||
Consider the following [line protocol](/influxdb/cloud/reference/syntax/line-protocol) data.
|
||||
|
||||
```
|
||||
airSensors,sensorId=TLM0201 temperature=73.97,humidity=35.23,co=0.48 1637014074
|
||||
```
|
||||
|
||||
The line has an `airSensors` measurement and three fields (`temperature`, `humidity`, and `co`).
|
||||
If you try to write this data to a bucket that has the [`explicit` schema type](/influxdb/cloud/admin/buckets/bucket-schema/) and doesn't have an `airSensors` schema, the `/api/v2/write` InfluxDB API returns an error and the following data:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": "invalid",
|
||||
"message": "3 out of 3 points rejected (check rejected_points in your _monitoring bucket for further information)"
|
||||
}
|
||||
```
|
||||
|
||||
InfluxDB logs three `rejected_points` entries, one for each field.
|
||||
|
||||
| _measurement | _field | _value | field | measurement | reason |
|
||||
|:----------------|:-------|:-------|:------------|:------------|:----------------------------------|
|
||||
| rejected_points | count | 1 | humidity | airSensors | measurement not allowed by schema |
|
||||
| rejected_points | count | 1 | co | airSensors | measurement not allowed by schema |
|
||||
| rejected_points | count | 1 | temperature | airSensors | measurement not allowed by schema |
|
||||
|
||||
#### Detect a field type mismatch
|
||||
|
||||
InfluxDB rejects a point if the [measurement](/influxdb/cloud/reference/key-concepts/data-elements/#measurement) matches the **name** of a bucket schema and the field data types don't match.
|
||||
The `rejected_points` entry contains the following reason:
|
||||
|
||||
| Reason | Meaning |
|
||||
|:------------------------------------|:-----------------------------------------------------------------------------------------------------|
|
||||
| `field type mismatch with schema` | The point has the same measurement as a configured schema and they have different field value types. |
|
||||
|
||||
Consider a bucket that has the following `airSensors` [`explicit bucket schema`](/influxdb/cloud/admin/buckets/bucket-schema/):
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "airSensors",
|
||||
"columns": [
|
||||
{
|
||||
"name": "time",
|
||||
"type": "timestamp"
|
||||
},
|
||||
{
|
||||
"name": "sensorId",
|
||||
"type": "tag"
|
||||
},
|
||||
{
|
||||
"name": "temperature",
|
||||
"type": "field",
|
||||
"dataType": "float"
|
||||
},
|
||||
{
|
||||
"name": "humidity",
|
||||
"type": "field",
|
||||
"dataType": "float"
|
||||
},
|
||||
{
|
||||
"name": "co",
|
||||
"type": "field",
|
||||
"dataType": "float"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
The following [line protocol](/influxdb/cloud/reference/syntax/line-protocol/) data has an `airSensors` measurement, a `sensorId` tag, and three fields (`temperature`, `humidity`, and `co`).
|
||||
|
||||
```
|
||||
airSensors,sensorId=L1 temperature=90.5,humidity=70.0,co=0.2 1637014074
|
||||
airSensors,sensorId=L1 temperature="90.5",humidity=70.0,co=0.2 1637014074
|
||||
```
|
||||
|
||||
In the example data above, the second point has a `temperature` field value with the _string_ data type.
|
||||
Because the `airSensors` schema requires `temperature` to have the _float_ data type,
|
||||
InfluxDB returns a `400` error and a message that describes the result:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": "invalid",
|
||||
"message": "partial write error (5 accepted): 1 out of 6 points rejected (check rejected_points in your _monitoring bucket for further information)"
|
||||
}
|
||||
```
|
||||
|
||||
InfluxDB logs the following `rejected_points` entry to the `_monitoring` bucket:
|
||||
|
||||
| _measurement | _field | _value | bucket | field | gotType | measurement | reason | wantType |
|
||||
|:------------------|:-------|:-------|:-------------------|:--------------|:---------|:------------|:----------------------------------|:---------|
|
||||
| rejected_points | count | 1 | a7d5558b880a93da | temperature | String | airSensors | field type mismatch with schema | Float |
|
||||
|
||||
{{% /show-in %}}
|
|
@ -10,6 +10,7 @@ processing engine.
|
|||
influxdb3 create trigger [OPTIONS] \
|
||||
--database <DATABASE_NAME> \
|
||||
--token <AUTH_TOKEN> \
|
||||
--plugin-filename <PLUGIN_FILENAME> \
|
||||
--trigger-spec <TRIGGER_SPECIFICATION> \
|
||||
<TRIGGER_NAME>
|
||||
```
|
||||
|
@ -20,16 +21,21 @@ influxdb3 create trigger [OPTIONS] \
|
|||
|
||||
## Options
|
||||
|
||||
| Option | | Description |
|
||||
| :----- | :--------------- | :--------------------------------------------------------------------------------------- |
|
||||
| `-H` | `--host` | Host URL of the running {{< product-name >}} server (default is `http://127.0.0.1:8181`) |
|
||||
| `-d` | `--database` | _({{< req >}})_ Name of the database to operate on |
|
||||
| | `--token` | _({{< req >}})_ Authentication token |
|
||||
| | `--trigger-spec` | Trigger specification--for example `table:<TABLE_NAME>` or `all_tables` |
|
||||
| | `--disabled` | Create the trigger in disabled state |
|
||||
| | `--tls-ca` | Path to a custom TLS certificate authority (for testing or self-signed certificates) |
|
||||
| `-h` | `--help` | Print help information |
|
||||
| | `--help-all` | Print detailed help information |
|
||||
| Option | | Description |
|
||||
| :----- | :------------------ | :------------------------------------------------------------------------------------------------------- |
|
||||
| `-H` | `--host` | Host URL of the running {{< product-name >}} server (default is `http://127.0.0.1:8181`) |
|
||||
| `-d` | `--database` | _({{< req >}})_ Name of the database to operate on |
|
||||
| | `--token` | _({{< req >}})_ Authentication token |
|
||||
| | `--plugin-filename` | _({{< req >}})_ Name of the file, stored in the server's `plugin-dir`, that contains the Python plugin code to run |
|
||||
| | `--trigger-spec` | Trigger specification--for example `table:<TABLE_NAME>` or `all_tables` |
|
||||
| | `--disabled` | Create the trigger in disabled state |
|
||||
| | `--tls-ca` | Path to a custom TLS certificate authority (for testing or self-signed certificates) |
|
||||
| `-h` | `--help` | Print help information |
|
||||
| | `--help-all` | Print detailed help information |
|
||||
|
||||
If you want to use a plugin from the [Plugin Library](https://github.com/influxdata/influxdb3_plugins) repo, use the url path with `gh:` specified as the prefix.
|
||||
For example, to use the [System Metrics](https://github.com/influxdata/influxdb3_plugins/blob/main/examples/schedule/system_metrics/system_metrics.py) plugin, the plugin filename is `gh:examples/schedule/system_metrics/system_metrics.py`.
|
||||
|
||||
|
||||
### Option environment variables
|
||||
|
||||
|
@ -47,8 +53,8 @@ The following examples show how to use the `influxdb3 create trigger` command to
|
|||
|
||||
|
||||
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: Database name
|
||||
- {{% code-placeholder-key %}}`AUTH_TOKEN`{{% /code-placeholder-key %}}:
|
||||
Authentication token
|
||||
- {{% code-placeholder-key %}}`AUTH_TOKEN`{{% /code-placeholder-key %}}: Authentication token
|
||||
- {{% code-placeholder-key %}}`PLUGIN_FILENAME`{{% /code-placeholder-key %}}: Python plugin filename
|
||||
- {{% code-placeholder-key %}}`TRIGGER_NAME`{{% /code-placeholder-key %}}:
|
||||
Name of the trigger to create
|
||||
- {{% code-placeholder-key %}}`TABLE_NAME`{{% /code-placeholder-key %}}:
|
||||
|
@ -66,6 +72,7 @@ Create a trigger that processes data from a specific table.
|
|||
influxdb3 create trigger \
|
||||
--database DATABASE_NAME \
|
||||
--token AUTH_TOKEN \
|
||||
--plugin-filename PLUGIN_FILENAME \
|
||||
--trigger-spec table:TABLE_NAME \
|
||||
TRIGGER_NAME
|
||||
```
|
||||
|
@ -80,6 +87,7 @@ Create a trigger that applies to all tables in the specified database.
|
|||
influxdb3 create trigger \
|
||||
--database DATABASE_NAME \
|
||||
--token AUTH_TOKEN \
|
||||
--plugin-filename <PLUGIN_FILENAME> \
|
||||
--trigger-spec all_tables \
|
||||
TRIGGER_NAME
|
||||
```
|
||||
|
@ -97,6 +105,7 @@ influxdb3 create trigger \
|
|||
--disabled \
|
||||
--database DATABASE_NAME \
|
||||
--token AUTH_TOKEN \
|
||||
--plugin-filename <PLUGIN_FILENAME> \
|
||||
--trigger-spec table:TABLE_NAME \
|
||||
TRIGGER_NAME
|
||||
```
|
||||
|
|
|
@ -41,7 +41,7 @@ Write requests return the following status codes:
|
|||
| :-------------------------------| :--------------------------------------------------------------- | :------------- |
|
||||
| `204 "Success"` | | If InfluxDB ingested the data |
|
||||
| `400 "Bad request"` | error details about rejected points, up to 100 points: `line` contains the first rejected line, `message` describes rejections | If some 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 |
|
||||
| `401 "Unauthorized"` | | If the `Authorization` header is missing or malformed or if the [token](/influxdb3/version/admin/tokens/) doesn't have [permission](/influxdb3/version/reference/cli/influxctl/token/create/#examples) to write to the database. See [examples using credentials](/influxdb3/version/get-started/write/#write-line-protocol-to-influxdb) in write requests. |
|
||||
| `401 "Unauthorized"` | | If the `Authorization` header is missing or malformed or if the [token](/influxdb3/version/admin/tokens/) doesn't have [permission](/influxdb3/version/reference/cli/influxctl/token/create/#examples) to write to the database. See [examples using credentials](/influxdb3/version/write-data/api-client-libraries/) 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.
|
||||
|
|
|
@ -161,6 +161,9 @@
|
|||
- flag: "--storage-validate-keys"
|
||||
added: 2.0
|
||||
|
||||
- flag: "--storage-wal-flush-on-shutdown"
|
||||
added: 2.7
|
||||
|
||||
- flag: "--storage-wal-fsync-delay"
|
||||
added: 2.0
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ influxdb:
|
|||
- v1
|
||||
latest: v2.7
|
||||
latest_patches:
|
||||
v2: 2.7.11
|
||||
v2: 2.7.12
|
||||
v1: 1.11.8
|
||||
latest_cli:
|
||||
v2: 2.7.5
|
||||
|
|
Loading…
Reference in New Issue