Search code examples
gitgitlabgitlab-omnibusgitlab-7

GitLab-omnibus 7.9 on Banana Pi error when pushing to directory on external hard drive


I'm using a Banana Pi 1 with Ubuntu 14.04.5 Trusty Tahr (32bit architecture). I like to use the Banana Pi as my privat GitLab Server. I successfully installed gitlab-omnibus 7.9. See system information below:

System information
System:
Current User:   git
Using RVM:      no
Ruby Version:   2.1.5p273
Gem Version:    2.2.1
Bundler Version:1.5.3
Rake Version:   10.4.2
Sidekiq Version:3.3.0

GitLab information
Version:        7.9.0
Revision:       16d6f0e
Directory:      /opt/gitlab/embedded/service/gitlab-rails
DB Adapter:     postgresql
URL:            http://192.168.0.115
HTTP Clone URL: http://192.168.0.115/some-project.git
SSH Clone URL:  [email protected]:some-project.git
Using LDAP:     no
Using Omniauth: no

GitLab Shell
Version:        2.6.0
Repositories:   /media/Seagate Expansion Dr/Projekte/GitLab/git-data/repositories
Hooks:          /opt/gitlab/embedded/service/gitlab-shell/hooks/
Git:            /opt/gitlab/embedded/bin/git

Commiting and pushing works fine over ssh but at the moment the git data is stored ad the SD card of the Banana Pi (where ubuntu is installed as well). I hooked up an external hard drive and I can access this drive as well when I log in via ssh. Now I want gitlab to store the git data on this external hard drive (name: Seagate Expansion Dr). I followed the guide in the gitlab README.md. So did the following:

  1. I synchronized the repositorie on the banana pi in the default location /var/opt/gitlab/git-data/ to the new location /media/Seagate\ Expansion\ Dr/Projekte/GitLab/git-data (for a more detailed description see gitlab README.md)

  2. I added the following line to /etc/gitlab/gitlab.rb:

    git_data_dir "/media/Seagate\ Expansion\ Dr/Projekte/GitLab/git-data"
    
  3. reconfigured and restarted gitlab

    gitlab-ctl reconfigure
    gitlab-ctl restart
    

But now when I try to push something from my repositorie on my Windows Desktop PC to the Banana Pi via:

git push -u origin master

I get the following error:

fatal: protocol error: bad line length character: No s

I did some research and think the error has something to do with permissions so I gave owner, group and others permission on write, reade and execute for a test but the error remains.

I would be very happy if somebody can help me. If any further information are needed ask me right away.

Best regards, Bredjo :)


Solution

  • Finally it works :) :) :)

    1. the error I experienced when pushing means No such project (source: Git push results in fatal: protocol error: bad line length character: This). So GitLab doesn't know or find the project.

    2. My log files weren't actually empty I haven't looked properly (see comments above). @secustor thank you for the hint with the logs. The error in /var/log/gitlab/gitlab-shell/gitlab-shell.log says the following:

      W, [2017-07-30T19:20:41.433749 #21264]  WARN -- : gitlab-shell: Access denied for git command <git-receive-pack 'Richard/Survival_Indie_Development.git'> by user with key key-6.
      

    During my research I found this forum entry which describes the same problem I have: https://github.com/gitlabhq/gitlabhq/issues/4730. I found this link early but at that point of time I struggled with other problems.

    To solve the problem I had to edit the gitlab-shell config file: /var/opt/gitlab/gitlab-shell/config.yml. I filled in the Banana PI IP-address and the port to the following lines: gitlab_url: "192.168.0.115:80" and host: 192.168.0.115. After this I executed:

    sudo gitlab-ctl reconfigure
    

    and

    sudo gitlab-ctl restart
    

    et voilà it works :). For testing i deleted the previous repos in the default gitlab directory and it still works. Now my git data gets stored on the external HDD :).