From 158b088ec3eb39e2129c2244179006b030eba947 Mon Sep 17 00:00:00 2001 From: zeripath Date: Sat, 12 Nov 2022 18:58:26 +0000 Subject: Adjust clone timeout error to suggest increasing timeout (#21769) 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(+) (limited to 'modules/repository') diff --git a/modules/repository/repo.go b/modules/repository/repo.go index de6de3bda4..51e1699821 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) } -- cgit v1.2.3