Troubleshooting
Why influx backup fails with multipart boundary is empty
Short answer
Point the Influx CLI at the database's own port 8086 with no path suffix: the client drops a reverse-proxy path prefix such as /influxdb, receives an HTML page with no multipart boundary, and aborts. Configure external storage and a valid token first, forward the port on a virtualized controller, then run influx backup over the direct connection and prove the result with a restore to a scratch instance.
On this page
- Why does influx backup fail with multipart boundary is empty?
- How do I prove the CLI is dropping the path?
- Why does influx bucket list fail with a text/html decode error?
- Which URL and port should the backup command use?
- What must be true on the device before the backup runs?
- How do I run the backup from a Windows PC?
- How do I back up over TLS when port 8086 is not allowed?
- How do I confirm the backup is complete and restorable?
- Questions asked
Point the Influx CLI at the database port on the device, not at the reverse-proxy URL. The command fails with Error: failed to backup metadata: multipart: boundary is empty because the CLI client drops the /influxdb path prefix from its requests, so the proxy's HTML start page arrives where a multipart backup stream should be. The device side is not at fault: a REST client through the same proxy URL returns the binary backup data. This article shows the proof, the prerequisites on the controller (external storage, token, port forwarding), the backup command that runs, and the restore test that closes the case.
Why does influx backup fail with multipart boundary is empty? #
The influx backup command fails with multipart: boundary is empty because the CLI client drops the /influxdb path from its requests: the reverse proxy then answers with an HTML page, that reply has no boundary in its Content-Type header, and the multipart reader aborts.
The backup download is a multipart body. The CLI reads the boundary string from the response Content-Type header and splits the stream on it. When the request lands on the proxy root instead of the InfluxDB API, the reply is an HTML page with a content type of text/html; charset=utf-8. That header carries no boundary parameter, so the multipart reader aborts before one byte of backup data is written. The same wrong reply explains the line before the error, WARN: Couldn't parse version "" reported by server: an HTML page has no InfluxDB version header, so the client assumes the latest backup APIs. The fault sits in the CLI client, not in the proxy; a defect report for the dropped path is filed in the influx-cli project's issue tracker.
The failing command looks like this, with the device address, your organization and your token:
influx backup --host https://192.168.0.100/influxdb --org plant-ot --token TOKEN --skip-verify C:\temp\influxdb.bkp
Symptoms and their causes:
multipart: boundary is emptyright afterINFO: Downloading metadata snapshot— the CLI sent its request to the proxy root; switch to the direct-port URL.unable to decode response content type "text/html; charset=utf-8"oninflux bucket list— the same path loss; every CLI command is affected, not only backup.- Timeout or connection refused on the direct port of a virtualized controller — port forwarding is not enabled yet.
500 Internal Server Erroron the direct URL — the app itself is faulted: storage not configured, or the CLI has no token configured.
How do I prove the CLI is dropping the path? #
Run any CLI command with --http-debug and read the request line: on the failing setup the path carries no /influxdb prefix, while the same proxy URL called from a REST client returns binary backup data, which clears the device side.
Append --http-debug to a cheap command such as influx bucket list --http-debug and look at the outgoing request: the path has no /influxdb prefix even though the --host value included it. Then call the same URL, https://192.168.0.100/influxdb, from a REST client such as Postman or Bruno with the token in the Authorization header: it returns the binary backup data, which proves the proxy serves the InfluxDB API correctly under that prefix. The client drops the path, the server keeps it; that split is the whole diagnosis.
Path prefixes through a plant reverse proxy trip other clients in similar ways; the server-side counterpart is exposing a historian web client through a reverse proxy, where the prefix is configured deliberately instead of being fed a stripped path.
Why does influx bucket list fail with a text/html decode error? #
The same defect: influx bucket list sends its request to the proxy root, receives text/html; charset=utf-8 instead of JSON, and aborts with unable to decode response content type — every CLI command is affected, not only backup, so the bucket list is your fastest test.
Use it as the gate after every change: it is read-only, takes a second, and its error names the content type it actually received. A bucket table means the CLI reached InfluxDB and authentication works. The decode error means the reply is still the proxy's HTML page, so the URL has not really changed. Fix the URL first and only then attempt the backup; a bucket table on the direct URL is the gate for every step that follows.
Which URL and port should the backup command use? #
Point the CLI at InfluxDB directly: --host-url http://192.168.0.100:8086 with no path suffix, token and organization set, and the backup runs — on a VirtualCORE, port 8086 must first be forwarded in the ctrlX WORKS VirtualCORE extended configuration, which a physical CORE does not need.
The working host URL has the http scheme, the device address, the InfluxDB port and nothing after it:
--host-url http://192.168.0.100:8086
Compare the routes before you pick one:
| Route | Transport | Result |
|---|---|---|
| Influx CLI to the /influxdb proxy URL | TLS through the reverse proxy | Fails: the client drops the path prefix |
| Influx CLI to the device on the direct port | Cleartext HTTP; the token crosses the wire readable | Backup runs; verified with client 2.7.5 against server 2.7.11 |
| REST client to the /influxdb proxy URL | TLS through the reverse proxy | Returns the binary backup data; you script and validate it |
One safety note: cleartext HTTP exposes the all-access token on the wire, so run the direct route only from a PC on an isolated engineering segment or over a direct cable, and keep the port closed to everything else. Where policy forbids cleartext, the scripted REST route below is the fallback; no secured CLI route exists on this setup today.
What must be true on the device before the backup runs? #
Three things must be true before the first backup: the InfluxDB app runs on external storage with bolt-path and engine-path set in config.yaml and restarted, a valid all-access token is stored in the CLI config, and port 8086 answers a TCP connection from your PC.
External storage. InfluxDB on the controller requires an external storage medium. In the app's config.yaml, point bolt-path and engine-path at the mounted drive; the tested configuration used /media/sda1/ctrlx-influxdb/common/bolt-path and /media/sda1/ctrlx-influxdb/common/engine, and with a storage extension the paths live under /var/snap/ctrlx-influxdb/common/storage-extension/ctrlx-influxdb/. Configuration changes take effect only after restarting the app under Settings | App. Gate: the app shows running and the diagnostic logbook records no new InfluxDB fault.
Token and organization. Create an API token with all-access rights in the InfluxDB UI and note the exact organization name as the server shows it; guessing either value produces the 500 later. Writers on the same network fail on the same two values: when Telegraf failed to send metrics to any configured server, the host URL and the token were the first two things to check. If that engineering PC also ships metrics through Telegraf, configuring the Telegraf INFLUX_TOKEN to survive apt upgrades keeps the token from vanishing on the next package update.
Port forwarding. On a VirtualCORE only, enable port forwarding for 8086 in the ctrlX WORKS VirtualCORE extended configuration; a physical CORE does not need it. Gate: a TCP connection from the PC to the direct port succeeds.
When the direct URL answers 500. Read the ctrlX OS diagnostic logbook; InfluxDB logs persist there, not in a separate folder inside the app's snap. Then re-check the storage paths and confirm a config update actually supplied authentication — passing only --host on the backup command leaves the client without a token.
How do I run the backup from a Windows PC? #
Run influx bucket list once — a bucket table proves authentication and the direct URL — then run influx backup to an existing local folder; on the verified setup the log prints INFO: Downloading metadata snapshot and continues past it instead of printing the boundary error.
- Open PowerShell in the folder holding the CLI binary. The pairing verified end to end is client 2.7.5 against server 2.7.11.
- Store the connection once: host URL with no path, organization, token, active. Use
influx config createfor a first config andinflux config updatewith the same flags to change an existing one.
.\influx config update --config-name CONFIG `
--host-url http://192.168.0.100:8086 `
--org plant-ot `
--token TOKEN `
--active
Gate: influx config list shows CONFIG with an asterisk in the Active column and the port URL.
- Prove authentication before the backup: run
.\influx bucket list. Gate: a bucket table returns. The text/html decode error means the URL still points at the proxy; a 500 sends you back to the storage and logbook checks. - Run the backup into an existing local folder:
.\influx backup C:\temp\influxdb.bkp
Gate: the log prints INFO: Downloading metadata snapshot and then proceeds past it with no boundary error. For a one-off run without a stored config, pass --host, --org and --token directly — but a host flag alone, with no token supplied, produces the 500.
How do I back up over TLS when port 8086 is not allowed? #
When policy forbids cleartext port 8086, script the backup endpoints under /api/v2/backup/ through the /influxdb proxy URL with a REST client that keeps the path: send the token in the Authorization header, save each binary response body to disk, and treat the output as yours to validate.
The proxy already serves the API under /influxdb — the REST test above proves it — so request the backup endpoints documented in the InfluxDB v2 API reference for release 2.7, in order, and store every response body. Accept two limits up front. The output is not the directory layout influx backup produces, so a restore depends on your script rather than a documented command path. The validation is also yours: restore the scripted output into a scratch InfluxDB 2.x instance with influx restore, run a bucket list against it, and only then treat the route as a backup. This route stays available while the CLI defect stands, and it is the only encrypted path on this setup today.
How do I confirm the backup is complete and restorable? #
A complete backup holds the metadata snapshot plus shard files totaling on the order of the engine directory: if that directory is 3.4 GB, an 18 kB backup folder means the run stopped at metadata, and the final acceptance check is a restore to a scratch instance.
Check contents, then size, then restore. A finished run leaves a metadata snapshot file plus shard data files and exits without an error line; a folder holding only a few kilobytes means the run never reached the data.
Worked size example, with example figures: suppose the engine directory on the external drive holds 3.4 GB, which is 3,400,000,000 bytes, and a failed-looking run left 18 kB, which is 18,000 bytes. The share is 18,000 ÷ 3,400,000,000 ≈ 0.0000053, about 0.0005 percent of the data — a metadata-only run, not a backup. Measure your own engine directory and expect the backup folder to land in the same order of magnitude, since bucket count and retention move the total.
The final acceptance check is a restore into a scratch InfluxDB 2.x instance — a local install or a second device — using influx restore, followed by a bucket list against the restored server. Every production bucket appearing there closes the case; until that list matches, the backup is not proven.
Questions asked
Which CLI and server versions was the direct-port fix verified with?
The verified pairing is Influx CLI client 2.7.5 on Windows against InfluxDB server 2.7.11 on the controller. Because the fault lives in the client's path handling, rerun a bucket list with --http-debug after every CLI upgrade before you trust a scheduled backup again.
Does the backup token need all-access rights?
The tested setup used an all-access token created in the InfluxDB UI. A backup reads the metadata snapshot and the shards of every bucket, so a token that cannot read all buckets stops partway through. Store it only on the engineering PC and rotate it like any credential.
Can influx restore run over the same direct connection?
Yes. Restore uses the same client transport as backup, so it needs the direct port URL without the proxy path too. Restore into a scratch instance first, confirm its bucket list matches production, and keep the live server out of the first test.
Is the version warning a separate fault?
No. The warning that the server version could not be parsed appears because the proxy's HTML page carries no InfluxDB version header, so the client assumes the latest backup APIs are supported. It is a symptom of the dropped path and disappears once the CLI talks to InfluxDB directly.
Can influx backup run unattended on a schedule?
Yes. The stored CLI config holds host URL, organization and token, so Task Scheduler on the Windows engineering PC or a cron job on a Linux host only needs to invoke the backup command against the saved config. Keep the port limited to the engineering segment and check the folder size after every run.