13

I am trying to push my app on to Heroku, but I am getting this error message. I have looked around, someone mentioned about GitHub recently started redirecting http repository access to https and it appears your git is unhappy about this change. But I am having troubles pushing to heroku, any help will be much appreciated.

 error: RPC failed; result=22, HTTP code = 400
Matthew W.
  • 261
  • 1
  • 4
  • 11
  • Could we get the full log of the heroku git push, including the exact command you're running? Also, what type of app is this? And your version of git (obtained by git --version). – changingrainbows Oct 18 '13 at 21:01
  • Hi changingrainbows, I am not sure what had caused the problem. But after a few more tries, it's now working. However, I still don't understand what the error message meant. Thank you very much for the help sir. – Matthew W. Oct 19 '13 at 02:27

6 Answers6

14

This may occur due the reason that Heroku's Git doesn't understand shallow clone as mentioned here.

Workaround is to disable shallow clone before deployment.

git fetch --unshallow
Pekka
  • 959
  • 2
  • 12
  • 22
6

change your postbuffer

git config --global http.postBuffer 52428800

then you postbuffer is 50M .

Honest
  • 182
  • 11
5

i hope this is not coming to late, but Heroku deployments require a full Git clone. By default, Pipelines clones your repository with a depth of 50 to shorten your build time. You can configure your Pipeline to do a full Git clone in your bitbucket-pipelines.yml file.

try adding full clone depth to your yml file

  image: node:6
  clone:
     depth: full
Matthew Igho
  • 51
  • 1
  • 2
2

It could be a glitch, as I mentioned in here.
(Actually, right as I write this, GitHub is having a "Major service outage"!)

Make sure you can reproduce the issue with an http or an https url.
If that persists, simply try and swith to an ssh url

git remote set-url heroku git@heroku.com:yourRepo

(which is the recommended approach, since heroku normally support ssh only)

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
2

The problem (could be) that you are probably used git clone --depth .. for your repository and that created so called shallow copy (without history). If you cloned somebody else repository (!), just delete /.git folder and create a recreate repository as new with

cd <my-project>/
git init

Then you can push even with remote https://<youprojectname>.herokuapp.com/

roman-mkh
  • 130
  • 1
  • 7
0

For Rails 4: make sure you add "rails_12factor" gem to your Gemfile.

Amr Arafat
  • 469
  • 3
  • 8