1

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:  git@192.168.0.115: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 :)

Bredjo
  • 19
  • 6
  • Try to remove the spaces of the directory path. It is generally never a good idea to add those in a path, as it will likely lead to problems later on. – secustor Jul 23 '17 at 14:55
  • Thank you for your comment @secustor. I renamed my HDD and while doing that I had an idea that the mounting is maybe not correct so I [mounted](https://wiki.ubuntuusers.de/mount/) the hdd (name is now SeagateExpansion) fresh and I also made an entry in the /etc/fstab regarding. But the problem remains so I thought maybe the user _git_ has not enough right so I also created a new group _GitLabUser_ and signed the user _git_ and my personal user in and after that I set the mount option of the hdd for the group id to `gid=GitLabUser`. But the error remains. – Bredjo Jul 25 '17 at 16:40
  • check the Gitlab logs under `/var/log/gitlab/`and see following post https://stackoverflow.com/questions/8170436/git-remote-error-fatal-protocol-error-bad-line-length-character-unab – secustor Jul 25 '17 at 17:27
  • I looked at the logs and the most interesting ones are empty. I also tried a few things from the thread you send me but until now without success. But I have still a few things I want to try. At the moment I'm pushing my documents to the SD card of the Banana Pi. Thank you so far for you help I think the solution is somewhere in the link you send me. I get back with an update when I made some progress. – Bredjo Jul 30 '17 at 09:24

1 Answers1

1

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 :).

Bredjo
  • 19
  • 6
  • Small update: After restarting and reconfiguring gitlab I noticed that my changes in `config.yml` were replaced by the default values ... strange. But everything is still working. – Bredjo Jul 30 '17 at 13:02
  • that is normal behaviour. If you use `gitlab-ctl reconfigure`, Gitlab will update all configuration files with the values supplied in the `gitlab.rb` file. To prevent this overwritting of the YAML files, simply change the values there. – secustor Jul 30 '17 at 19:19