Cannot enable LFS on GitLab docker

Hello,
I have just installed GitLab using docker-compose
It is running fine BUT I do not have Enable LFS in project settings (not as a user, nor as a root)
This is my docker-compose:

  gitlab:
    image: 'gitlab/gitlab-ee:latest'
    restart: always
    hostname: 'XXXXX'
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'http://XXXXXX:8929'
        gitlab_rails['gitlab_shell_ssh_port'] = 2224
        gitlab_rails['lfs_enabled'] = false
        gitlab_rails['lfs_storage_path'] = "/var/opt/gitlab-lfs"
    ports:
      - '8929:8929'
      - '2224:22'
    volumes:
      - '/opt/docker/gitlab/config:/etc/gitlab'
      - '/opt/docker/gitlab/logs:/var/log/gitlab'
      - '/opt/docker/gitlab/data:/var/opt/gitlab'
      - '/opt/docker/gitlab/lfs:/var/opt/gitlab-lfs'

When I try to push simple stuff it runs fine, when I push things that fall to LFS I get:

batch response: Git LFS is not enabled on this GitLab server, contact your admin.

Is there anything I can do about it? Documentation did not help me :frowning:

Best regards, SecretGibbon

Normally, you just do this from the console side. So, I’ve cloned my repo, and then we need to enable LFS:

From the docs: Git Large File Storage (LFS) | GitLab

git lfs install

then you want to track whatever files, let’s assume ISO files:

git lfs track "*.iso"

then you can push/pull etc as normal. Obviously from the gitlab side, you need to make sure in the repo settings that LFS is enabled. So in the project settings → General → Visibility, project features, permissions.

as you will see the LFS option enabled, so that would need to be done first, before attempting the commands above.

And if you say it’s not available in the web interface, you will need to check gitlab.rb for this option:

# gitlab_rails['lfs_enabled'] = true

mine is hashed out, so default is true. If yours is unhashed and set to false, then it needs to be configured correctly. I think this is how it’s supposed to be done under docker:

so using those commands you can edit gitlab.rb and make sure lfs is enabled.

I am so sorry, thank you, just now looking at it I set it to false instead of true. Oh boy…
Thanks for pointing that out. I’ll try that today as I get to the PC and write the results here (I guess it will be ok).
Thank you again and sorry for dumb question

1 Like

For anyone lurking, yes that was it. If it happens to you check if you don’t have gitlab_rails['lfs_enabled'] = false somewhere in compose file, gitlab config or run command :slight_smile:

1 Like