简体   繁体   中英

error on git push heroku master

each time I try to do the git push heroku master I seem that everything works, but after a couple of hour it fails.

The error message is:

$ git push heroku master
Counting objects: 599, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (318/318), done.
remote: fatal: early EOF
Writing objects: 100% (599/599), 552.65 MiB | 56.00 KiB/s, done.
Total 599 (delta 170), reused 585 (delta 163)
error: unpack failed: index-pack abnormal exit
To https://git.heroku.com/foo.git
 ! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'https://git.heroku.com/foo.git'

Can't solve the error, and it takes a long time before it fails each time I try.

Is the first time I'm going to deploy a project, I would also apreciate some advise if there is something better (and/or cheaper) than heroku for uploading a rails project. And a good tutorial to follow, because I need to use a custom domain (.com) and everything, and at this point I'm not sure what I have to do.

I followed this tutorial for heroku: https://devcenter.heroku.com/articles/getting-started-with-rails5

Edit: I checked since the first time I tried to upload to heroku, and now I see that the first time the error was different, and since then always the same error I commented before. This is the first error:

git push heroku master
Counting objects: 580, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (462/462), done.
error: unable to rewind rpc post data - try increasing http.postBuffer
error: RPC failed; result=56, HTTP code = 0
fatal: The remote end hung up unexpectedly | 0 bytes/s   
Writing objects: 100% (580/580), 552.65 MiB | 240.00 KiB/s, done.
Total 580 (delta 155), reused 0 (delta 0)
fatal: The remote end hung up unexpectedly
Everything up-to-date

It seems a problem with git in your case. You could try to run the git repack command or to clone your repository again, and then deploy to Heroku. If this still fails, perhaps it'd be a good idea to contact their support.

I think that if you are deploying a project for the first time, I think Heroku is the easiest way, but this is my opinion. Adding your custom domain to it is faily easy too, you can check how to do it here .

I contacted the heroku support, and they told me kindly what I was doing something wrong.

It seems that my project folder was 1,2GB, and with the .gitignore it was about 550MB. And in a free account I only can push 500MB maximum.

I looked folder by folder and file by file how many space are they using. And surprisingly it was about 50MB.

The other 500MB to the 550MB were hidden files inside the project which I didn't know anything. Maybe git files, I don't know.

So I copied all the visible files and folders to a new folder, I made a new .gitignore, a new git init, and a new heroku create. Now the main folder was only about 150MB, and when I wanted to push the project to heroku it was only 49MB.

So if you have the same problem I had check the weight of your files, maybe you have big hidden files. And it solved the problem to me.

Adding the following to gitconfig fixed this issue for me:

git config http.postBuffer 524288000

This allows for larger files to be pushed to a given repo. (I think🤓)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM