0
votes

I need some help configuring a samba share as gitlab data folder.

I've tried following suggestions here:

change the data directory gitlab to store repos elsewhere

and the official documentation to no avail. Here is what I did:

1] I've installed gitlab 7.6.2 using the omnibus package and I've also checked that everything worked using the preconfigured /var/opt/gitlab/git-data folder

2] I've mounted my samba share (located on a nas server) on /media/gitlab-data by modifying my /etc/fstab file.

Here is the fstab line:

//xxx.xxx.x.xx/test /media/gitlab-data cifs username=xxx,password=xxx 0 0

the user I'm using to connect has full permissions on the share. After the mount operation the permissions on that folder are the following:

Initial permissions

3] I've modified the configuration of gitlab in /etc/gitlab/gitlab.rb changing the gitlab_user_data parameter to

/media/gitlab-data

I've then proceeded with a

sudo gitlab-ctl reconfigure

At the end of the reconfigure script the privileges of my share are:

Permissions after reconfigure

and the initial gitlab-satellites and repositories folder have been created succesfull.

Now, the gitlab web interface is fully operational but I'm unable to create a new project (or add a new user). As soon as I click 'Create project' the web interface returns with the following error:

Failed to create repository

I'm quite sure it is a permission problem but I don't know how to solve this. I also add 2 strange things:

1] I wasn't able to find any error inside the logs related to this operation. The only related message I see is inside the gitlab-shell log:

I, [2015-01-13T14:27:50.408394 #1658] INFO -- : Adding project root/test.git at .

2] The test.git folder inside /media/gitlab-data is indeeed created but, doing an ls -la on my mounted folder returns this permissions:

 drwxrwxrwx 3 1024 users 0 Jan 13 14:27 .
 drwxrwxrwx 3 git  git   0 Jan 13 14:27 ..
 drwxrwxrwx 7 1024 users 0 Jan 13 14:27 test.git

Probably something is trying to make a chown on these folder and that command ultimately fails. I also don't know who is the owner of this 1024 uid.

Any help is appreciated. Thanks in advance!

1
I'm facing the exact same problem. Did you ever manage to get this to work? - informer2000

1 Answers

0
votes

This is because it cannot create a symlink to the file:

/opt/gitlab/embedded/lib/ruby/2.1.0/fileutils.rb:355:in `symlink': Operation not supported @ sys_fail2 - (/opt/gitlab/embedded/service/gitlab-shell/hooks, /<path>/gitlab/git-data/repositories/root/repo.git/hooks) (Errno::EOPNOTSUPP)
    from /opt/gitlab/embedded/lib/ruby/2.1.0/fileutils.rb:355:in `block in ln_s'
    from /opt/gitlab/embedded/lib/ruby/2.1.0/fileutils.rb:1595:in `fu_each_src_dest0'
    from /opt/gitlab/embedded/lib/ruby/2.1.0/fileutils.rb:353:in `ln_s'
    from /opt/gitlab/embedded/service/gitlab-shell/lib/gitlab_projects.rb:28:in `create_hooks'
    from /opt/gitlab/embedded/service/gitlab-shell/lib/gitlab_projects.rb:99:in `add_project'
    from /opt/gitlab/embedded/service/gitlab-shell/lib/gitlab_projects.rb:48:in `exec'
    from /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-projects:31:in `<main>'

I just commented out line 28 in /opt/gitlab/embedded/service/gitlab-shell/lib/gitlab_projects.rb and was then able to create the project.