From 71cb623cb737baa708c9c0746c12053941a9510e Mon Sep 17 00:00:00 2001 From: Will Assis <35489495+gassiss@users.noreply.github.com> Date: Tue, 22 Jul 2025 09:44:04 -0400 Subject: [PATCH] improve logging and fail unified-storage migration with more than 0 errors (#108471) improve logging and fail unified-storage migration with more than 0 errors --- pkg/registry/apis/dashboard/legacy/migrate.go | 1 + pkg/registry/apis/dashboard/legacy/sql_dashboards.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/registry/apis/dashboard/legacy/migrate.go b/pkg/registry/apis/dashboard/legacy/migrate.go index aa534d9643a..bb938f7e532 100644 --- a/pkg/registry/apis/dashboard/legacy/migrate.go +++ b/pkg/registry/apis/dashboard/legacy/migrate.go @@ -310,6 +310,7 @@ func (a *dashboardSqlAccess) migrateDashboards(ctx context.Context, orgId int64, "dashboard", row.Dash.Name, "uid", row.Dash.UID, "id", id, + "namespace", opts.Namespace, ) opts.Progress(-2, fmt.Sprintf("rejected: id:%s, uid:%s", id, row.Dash.Name)) } diff --git a/pkg/registry/apis/dashboard/legacy/sql_dashboards.go b/pkg/registry/apis/dashboard/legacy/sql_dashboards.go index 5c5a8ff1d83..0771f0fc3ee 100644 --- a/pkg/registry/apis/dashboard/legacy/sql_dashboards.go +++ b/pkg/registry/apis/dashboard/legacy/sql_dashboards.go @@ -175,7 +175,8 @@ func (r *rowsWrapper) Next() bool { r.row, err = r.a.scanRow(r.rows, r.history) if err != nil { - if len(r.rejected) > 1000 || r.row == nil { + r.a.log.Error("error scanning dashboard", "error", err) + if len(r.rejected) > 0 || r.row == nil { r.err = fmt.Errorf("too many rejected rows (%d) %w", len(r.rejected), err) return false }