Need help blocking LFS file uploads when a project reaches its quota

Hello everyone,

I’d like to reach out for your expertise regarding an issue I’m facing with GitLab. I’m working on a project where we use Git LFS to manage large files. However, we’ve noticed that even when the storage quota for a project is reached, users can still upload LFS files, which exacerbates the situation.

I’ve tried using the pre-receive hook to block LFS file uploads when the quota is reached, but it didn’t work as expected. Specifically, even though the hook correctly detected the quota being reached, it still allowed LFS file uploads to go through, and only blocked subsequent commits from being pushed.

Do you have any suggestions on the best way to implement a mechanism to prevent LFS file uploads once the quota is exceeded?

Any help or ideas would be greatly appreciated.

Thank you in advance!

Best regards