From 214da05a417b32728ed8d8ea91a1537ac14373fb Mon Sep 17 00:00:00 2001 From: Andrew Thornton Date: Thu, 10 Nov 2022 19:54:39 +0000 Subject: [PATCH] Adjust clone timeout error to suggest increasing timeout There are far too many error reports regarding timeouts from migrations. We should adjust error report to suggest increasing this timeout. Ref #20680 Signed-off-by: Andrew Thornton --- modules/repository/repo.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/repository/repo.go b/modules/repository/repo.go index de6de3bda4494..51e1699821c0f 100644 --- a/modules/repository/repo.go +++ b/modules/repository/repo.go @@ -6,6 +6,7 @@ package repository import ( "context" + "errors" "fmt" "io" "net/http" @@ -79,6 +80,9 @@ func MigrateRepositoryGitData(ctx context.Context, u *user_model.User, Timeout: migrateTimeout, SkipTLSVerify: setting.Migrations.SkipTLSVerify, }); err != nil { + if errors.Is(err, context.DeadlineExceeded) { + return repo, fmt.Errorf("Clone timed out. Consider increasing [git.timeout] MIGRATE in app.ini. Underlying Error: %w", err) + } return repo, fmt.Errorf("Clone: %w", err) }