From 5df737cbc77b928dea574944720739126dd6dd69 Mon Sep 17 00:00:00 2001 From: "J. Emrys Landivar" Date: Mon, 15 Mar 2021 13:32:50 -0500 Subject: [PATCH] fix(cmd/influx): log error details when `influxd upgrade` fails to migrate databases (#20929) Co-authored-by: Dan Moran --- CHANGELOG.md | 1 + cmd/influxd/upgrade/upgrade.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 899d2ced30..fe16c520cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ or `/query` HTTP endpoints. 1. [20856](https://github.com/influxdata/influxdb/pull/20856): Respect 24 hour clock formats in the UI and allow more choices 1. [20875](https://github.com/influxdata/influxdb/pull/20875): Prevent "do not have an execution context" error when parsing Flux options in tasks. 1. [20932](https://github.com/influxdata/influxdb/pull/20932): Prevent time field names from being formatted in the Table visualization +1. [20929](https://github.com/influxdata/influxdb/pull/20929): Log error details when `influxd upgrade` fails to migrate databases. ## v2.0.4 [2021-02-08] diff --git a/cmd/influxd/upgrade/upgrade.go b/cmd/influxd/upgrade/upgrade.go index 7ce8e17046..ea0372011d 100644 --- a/cmd/influxd/upgrade/upgrade.go +++ b/cmd/influxd/upgrade/upgrade.go @@ -459,8 +459,8 @@ func runUpgradeE(ctx context.Context, ui *input.UI, options *options, log *zap.L db2BucketIds, err := upgradeDatabases(ctx, ui, v1, v2, options, or.Org.ID, log) if err != nil { - //remove all files - log.Info("Database upgrade error, removing data") + // remove all files + log.Error("Database upgrade error, removing data", zap.Error(err)) if e := os.Remove(options.target.boltPath); e != nil { log.Error("Unable to remove bolt database", zap.Error(e)) }