0

in this case I have installed a turnkey linux with gitlab. I´ve setted a static ip. When I push a file it goes ok, but when I push all my symfony project it return an error

$ git push
Counting objects: 7854, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (7449/7449), done.
Writing objects: 100% (7854/7854), 6.45 MiB | 2.08 MiB/s, done.
Total 7854 (delta 2669), reused 0 (delta 0)
error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413 Request Entity Too Large
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date

What I tried:

  • Modify the gitlab.yml inside /home/git/gitlab/config change the git max-size to 20971520 (20 mb)
  • Changed the postBuffer: git config --global http.postBuffer 524288000
  • also made different commits with a small portion of file, that works but not at all
jkucharovic
  • 4,214
  • 1
  • 31
  • 46
Braian Mellor
  • 1,934
  • 3
  • 31
  • 50

2 Answers2

1

Apparently, this is a known issue in gitlab (https://gitlab.com/gitlab-org/omnibus-gitlab/issues/1883). A workaround is to push using ssh not http.

Mateusz Chrzaszcz
  • 1,240
  • 14
  • 32
  • Hi thanks for your answer. I´m in windows enviroment and i made a prublic/pivate key with putty generator. Then I tipe in console $ type ssh-gitlab.pub | clip and when I make the push I ask me for a password but don´t know what password is it. Tried all ones, any idea? – Braian Mellor Jul 21 '17 at 12:50
  • While generating public/private key you can choose the password. If you didn't choose any it will be blank. I assume though that the reason it complains is because your remote is set as http, check this using `git remote -v` if you see origin as http you need to remove old remote using `git remote remove origin` and add it again `git remote add origin GITSTYLEURL` :) EDIT: Even simpler you can go with `git remote set-url origin git@github.com:USERNAME/REPOSITORY.git` – Mateusz Chrzaszcz Jul 21 '17 at 13:02
  • thanks again for the answer. The remote is set just fine. The only extrange thing is that the ssh is calling a user name git that I think we don´t create it. – Braian Mellor Jul 21 '17 at 13:16
  • The fact it asks for password is a red herring. In that case you either didn't add ssh public key to gitlab or if you added, you did not register it on your local machinewith ssh-agent. Use git bash and type `eval $(ssh-agent -s)`. If it returns pid then use `ssh-add ~/.ssh/id_rsa` and in the same session try to push it. In that comment `~/.ssh/id_rsa` is where your generated private key is. – Mateusz Chrzaszcz Jul 21 '17 at 13:24
  • The ssh-agent return Agent pid 3168. The filename .pub or .ppk is called ssh-gitlab. Should I change it? I thied with that name and return it "Error loading key ... invalid format" – Braian Mellor Jul 21 '17 at 13:30
  • Yeah, I would recommend generating the key again. Follow steps for instance here: https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/ Don't set any password and go with default name :) – Mateusz Chrzaszcz Jul 21 '17 at 13:37
  • I do step by step but still asking for git password :/ – Braian Mellor Jul 21 '17 at 13:46
  • I connected by SSH to the debian as root and change the git user password ($ passwd git) to a new one. Now when I do a git push with that password it return: fatal: 'xx/xxxx.git' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. – Braian Mellor Jul 21 '17 at 13:57
  • I have no idea what you did now. Did you change password on your remote git host? If so, this is wrong. Again, it was asking you for password because it could not authenticate you through ssh public/private key pair, so as mentioned earlier, password thingy is a red herring. The underlying issue is fact it does not accept your key pair. – Mateusz Chrzaszcz Jul 21 '17 at 14:02
  • What I do is change the password of user git inside the VM. When using SSH generally I user {USER_NAME}@host to connect. git is not my username inside gitlab interface. So I don´t know why user interface make me connect to git@host. After changing the password when i make the push the new password is accepted but there is no user git inside the gitlab interface with access to the repositorio and reject the push (logic). I´m out of ideas. The step by step creation of public/private didn´t work. Any other idea? shouldn´t be that hard (btw hate windows) – Braian Mellor Jul 21 '17 at 14:09
  • Why did creation not work? What happened? Show me the result of `git remote -v` and `ssh-add -l` – Mateusz Chrzaszcz Jul 21 '17 at 14:21
  • $ git remote return origin git@{host}:{group}/{proyect].git for fetch and push and $ ssh-add -l return "Could not open a connection to your authentication agent" – Braian Mellor Jul 21 '17 at 14:26
  • Diagnose since beginning is correct. However,your ssh agent is not working: https://stackoverflow.com/questions/18683092/how-to-run-ssh-add-on-windows – Mateusz Chrzaszcz Jul 21 '17 at 14:29
  • ok here is here this is not working: I made again $ eval$(ssh-agent -s) $ssh-add id_rsa, then ask for passwork. Recheck with $ ssh-add -l and return the sha. Now $git push -u origin dev and said: git@host's password : and what password should I put? so write the password setted before and said again that does not appear to be a git repository ... – Braian Mellor Jul 21 '17 at 14:35
  • at this moment you are my only friend XD – Braian Mellor Jul 21 '17 at 14:36
  • Log in to that debian root again, reset password to blank. It will work :) – Mateusz Chrzaszcz Jul 21 '17 at 15:00
  • It return "No password supplied" :( – Braian Mellor Jul 21 '17 at 15:02
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/149823/discussion-between-braian-mellor-and-mateusz-chrzaszcz). – Braian Mellor Jul 21 '17 at 15:08
0

Another way to make it work as HTTP is to change the the config file og NGINX. The client_max_body_size default is 1M. So inside file /etc/nginx/nginx.conf add something like

http {
    client_max_body_size 100M;
}

By this way you can push through HTTP up to 100 mb

Braian Mellor
  • 1,934
  • 3
  • 31
  • 50