gitlab should check writeability/createability of lfs_storage_path before allowing git-lfs transfers

Repro:

  1. Add this to gitlab.rb on the server:
gitlab_rails['lfs_enabled'] = true
gitlab_rails['lfs_storage_path'] = "/some/directory/that/gitlab/doesnt/have/permission/to/create"
  1. gitlab-ctl reconfigure and do a "git push" to a repo on the server, and make sure the push has a bunch of large lfs files.
  2. Note that you get an error, but not until after all of the data for the files gets transferred. Examination of the gitlab-workhorse log on the server will show the errors:
mkdir StoreLFSPath: mkdir "/some/directory/that/gitlab/doesnt/have/permission/to/create": permission denied

On the client side, no errors are printed until a great deal of data is transferred. You also end up with a display like this, where the downloaded file count and file size is greater than the total:

(297 of 253 files) 2.56GB / 1.99 GB

--- Obviously that's out of wack.

Expected behavior: On the gitlab server side, there should be some check of the writability of the lfs_storage_path prior to allowing any git-lfs clients to push any data to the server, because otherwise it's a waste of bandwidth and makes it more difficult to understand the issue.

Edited Aug 14, 2020 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading