From 07076f838d0274068db268e9eaf86c19c5fef223 Mon Sep 17 00:00:00 2001 From: Noel Date: Thu, 16 May 2024 18:06:44 -0700 Subject: [PATCH] fix(mirror): skip LFS instead of failing to mirror a repo If an LFS client can't be created because it's not compatible for some reason, skip it entirely for a mirrored repo. This prevents one possible crash when mirroring fails. It still seems to crash when accessing user info, so something is still missing. Either way, it seems valid to skip LFS if it just won't work. --- pkg/backend/repo.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/backend/repo.go b/pkg/backend/repo.go index 231d94e6f..ddc27dadd 100644 --- a/pkg/backend/repo.go +++ b/pkg/backend/repo.go @@ -190,7 +190,8 @@ func (d *Backend) ImportRepository(_ context.Context, name string, user proto.Us client := lfs.NewClient(ep) if client == nil { - return fmt.Errorf("failed to create lfs client: unsupported endpoint %s", endpoint) + d.logger.Warn("failed to create lfs client: unsupported endpoint", "endpoint", endpoint) + return nil } if err := StoreRepoMissingLFSObjects(ctx, r, d.db, d.store, client); err != nil {