Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backups on Windows are failing due to boltdb issue #344

Open
lesam opened this issue Dec 21, 2021 · 3 comments
Open

Backups on Windows are failing due to boltdb issue #344

lesam opened this issue Dec 21, 2021 · 3 comments

Comments

@lesam
Copy link
Contributor

lesam commented Dec 21, 2021

From community slack:

I am unable to backup data:
PS C:\Temp\influxbackup> influx backup .
2021/12/21 09:52:07 INFO: Downloading legacy KV snapshot
2021/12/21 09:52:07 INFO: Extracting bucket manifest from legacy KV snapshot
Error: failed to backup metadata: failed to extract bucket metadata from downloaded KV snapshot: unable to open boltdb: 
CreateFileMapping: Not enough memory resources are available to process this command.
No differences specifying organization, bucket and token. Influx CLI is configured correctly as other commands work fine.

See also underlying boltdb issue: etcd-io/bbolt#252
And #183 (comment)

Looks like we skipped a test on Windows and now its biting us. No movement on the upstream issue since Nov 2020 so we're going to have to find a workaround or fix the upstream I think.

@lesam lesam changed the title Backups on Windows with OSS 2 are failing due to boltdb issue Backups on Windows are failing due to boltdb issue Dec 21, 2021
@lesam
Copy link
Contributor Author

lesam commented Dec 21, 2021

@dgnorton for prioritization

@lesam
Copy link
Contributor Author

lesam commented Dec 21, 2021

Per Franco, this is happening on the latest docker image.

@williamhbaker
Copy link
Contributor

This should only be happening if the CLI needs to build a manifest from a pre-2.1 influxd server on a windows machine. There was a backup API change between 2.0.x and 2.1 that requires building this legacy manifest.

Running CLI v2.2.1 with InfluxDB v2.1.1 on Windows 10 to do a backup works for me - doesn't need to create a legacy manifest like the log 2021/12/21 09:52:07 INFO: Extracting bucket manifest from legacy KV snapshot indicates.

For backing up a 2.0.x influxd server, the CLI client bundled with the server release should still work on windows. These were built from the "old" CLI source code in the influxdb repository.

The old CLI code didn't need to build a legacy manifest, but it did need to open the bolt file, as in: https://github.com/influxdata/influxdb/blob/d1233b7951ddf06a3f201c84f4b0915692c22ba5/backup/backup.go#L67

I believe the reason the old CLI code can do this on Windows is because it used the same logic to open the bolt file as the influxd server, which does not use the ReadOnly option for normal use: https://github.com/influxdata/influxdb/blob/d1233b7951ddf06a3f201c84f4b0915692c22ba5/bolt/kv.go#L94-L100

A simple fix for this error when backing up a legacy server on Windows therefor might be to not use the ReadOnly option here:

db, err := bbolt.Open(boltPath, 0666, &bbolt.Options{ReadOnly: true, Timeout: 1 * time.Second})

I asked Franco in the community slack to confirm the version of influxd that is being run, since if it is actually v2.1.1 and the CLI is trying to create a legacy manifest that would be a different problem - and one that I could not reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants